Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@react-native-firebase/app
Advanced tools
A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Sto
@react-native-firebase/app is a module that provides the core functionality for integrating Firebase services into a React Native application. It acts as the base for other Firebase services such as authentication, database, storage, and more.
Initialize Firebase
This code initializes the Firebase app with the provided configuration. It checks if any Firebase app instances already exist to avoid re-initialization.
import firebase from '@react-native-firebase/app';
const firebaseConfig = {
apiKey: 'your-api-key',
authDomain: 'your-auth-domain',
projectId: 'your-project-id',
storageBucket: 'your-storage-bucket',
messagingSenderId: 'your-messaging-sender-id',
appId: 'your-app-id',
};
if (!firebase.apps.length) {
firebase.initializeApp(firebaseConfig);
}
Access Firebase Services
This code demonstrates how to access Firebase services like Authentication and Firestore. It includes examples of signing in a user and fetching data from a Firestore collection.
import auth from '@react-native-firebase/auth';
import firestore from '@react-native-firebase/firestore';
// Example: Using Firebase Authentication
const signIn = async (email, password) => {
try {
await auth().signInWithEmailAndPassword(email, password);
console.log('User signed in!');
} catch (error) {
console.error(error);
}
};
// Example: Using Firestore
const getUsers = async () => {
const usersCollection = await firestore().collection('Users').get();
usersCollection.forEach(documentSnapshot => {
console.log('User ID: ', documentSnapshot.id, documentSnapshot.data());
});
};
react-native-firebase is a well-maintained package that provides comprehensive support for Firebase services in React Native applications. It offers a similar set of functionalities as @react-native-firebase/app but is often used as a more integrated solution with additional modules for each Firebase service.
expo-firebase-core is a package designed for Expo managed workflow users. It provides a simplified way to integrate Firebase into Expo projects. While it offers similar core functionalities, it is tailored for use with the Expo ecosystem and may not provide the same level of customization as @react-native-firebase/app.
React Native Firebase is a light-weight javascript layer connecting you to the native Firebase SDKs for both iOS and Android which aimes to mirror the offical Firebase Web SDK as closely as possible.
Although the official Firebase JS SDK will work with React Native; it is mainly built for the web and has a limited feature-set compared to native.
Using the native Firebase SDKs with React Native Firebase allows you to consume device SDKs which don't exist on the Firebase JS SDK - for example; Remote Config, Performance Monitoring, Dynamic Links, Analytics and more (see the feature table below for comparison).
The Web SDK column indicates what modules/functionality from the Web SDK are usable within React Native.
'?' indicates partial support
Firebase Features | v5.x.x | Web SDK |
---|---|---|
AdMob | ✅ | ❌ |
Analytics | ✅ | ❌ |
App Indexing | ❌ | ❌ |
Authentication | ✅ | ✅ |
-- Phone Auth | ✅ | ✅ |
Core | ✅ | ✅ |
-- Multiple Apps | ✅ | ✅ |
Cloud Firestore | ✅ | ✅ |
Cloud Messaging (FCM) | ✅ | ❌ |
Crashlytics | ✅ | ❌ |
Dynamic Links | ✅ | ❌ |
Functions Callable | ✅ | ✅ |
Invites | ✅ | ❌ |
Instance ID | ✅ | ❌ |
Performance Monitoring | ✅ | ❌ |
Realtime Database | ✅ | ✅ |
-- Offline Persistence | ✅ | ? |
Remote Config | ✅ | ❌ |
Storage | ✅ | ✅ |
The table below shows the supported versions of React Native and the Firebase SDKs for different versions of
react-native-firebase
.
3.3.x | 4.3.x | 5.x.x | |
---|---|---|---|
React Native | 0.50-52 | 0.52-55 | ^0.56 - ^0.57 |
Play Services Android SDK | 11.8.0 + | 15.0.1 | ^16.0.1 |
Firebase iOS SDK | 4.7.0 + | 5.3.0 | ^5.10.0 - ^5.11.0 |
To check out our latest docs, visit https://invertase.io/oss/react-native-firebase
For questions and support please use our Discord chat or Stack Overflow. The issue list of this repo is exclusively for bug reports.
Please make sure to complete the issue template before opening an issue. Issues not conforming to the guidelines may be closed immediately.
For feature requests please visit our Feature Request Board.
Detailed changes for each release are documented in the releases notes.
RNFirebase is an Apache-2.0 licensed open source project. It's an independent project with its ongoing development made possible entirely thanks to the support by these awesome sponsors and backers. If you'd like to join them, please consider:
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]
Thank you to all our backers! 🙏 [Become a backer]
Please make sure to read the Contributing Guide before making a pull request.
Thank you to all the people who have already contributed to RNFirebase!
FAQs
A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Sto
The npm package @react-native-firebase/app receives a total of 467,144 weekly downloads. As such, @react-native-firebase/app popularity was classified as popular.
We found that @react-native-firebase/app demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.