react-native-firebase
🔥 A well-tested feature-rich modular Firebase implementation for React Native. Supports both iOS & Android platforms for all Firebase services.
A collection of modules that connects React Native mobile apps to Firebase backend services, authentication, real-time databases, push notifications, crash reporting, and analytics, so you access Google's platform from JavaScript without writing native iOS or Android code.
React Native Firebase is a collection of modules that connect React Native mobile apps to Firebase, Google's platform for app backend services. Firebase provides things like user authentication, a real-time database, file storage, push notifications, crash reporting, and analytics. This library wraps Firebase's native iOS and Android code so that React Native developers can access all of those services from JavaScript without having to write platform-specific native code themselves.
The library is organized into separate packages, one for each Firebase service. The main app package is required as a foundation, and from there a developer installs only the specific services their app needs: authentication, Cloud Firestore (a document database), Cloud Messaging for push notifications, Crashlytics for crash reporting, Analytics, Cloud Storage, Cloud Functions, Performance Monitoring, and more. Having them as separate packages means the app only includes what it actually uses.
The project is built around four stated principles: thorough test coverage (over 95% per module), full TypeScript support for code editor assistance, detailed documentation with guides and reference material, and close alignment with Firebase's own web SDK so that code can be shared between a React Native app and a web app with minimal changes.
Setting up the library involves installing the npm package for each needed service and then following platform-specific steps to link the native Firebase SDK for iOS and Android. The documentation site (rnfirebase.io) covers these steps in detail. The codebase is a mono-repository managed with Lerna, meaning all the individual packages live together under one GitHub repository for easier development and versioning.
Where it fits
- Add email or Google sign-in to a React Native app using Firebase Authentication without writing native code.
- Store and sync app data in real time across devices with Cloud Firestore from a JavaScript codebase.
- Send push notifications to iOS and Android users through Firebase Cloud Messaging.
- Automatically track crashes and monitor app performance with Crashlytics and Firebase Analytics.