React Native Firebase
repository·main·Indexed 11 days ago
https://github.com/invertase/react-native-firebaseA suite of modules that bridge React Native applications to native Firebase SDKs on iOS and Android. It provides native performance and TypeScript support with an API designed to mirror the Firebase Web SDK. Available modules include @react-native-firebase/app, auth, firestore, functions, messaging, analytics, ai, and more.
What's inside React Native Firebase
- React Native Firebase Performance Monitoring allows you to gain insights into how your app performs from your users' perspective. It provides both automatic and customized performance tracing to identify bottlenecks and optimize user experience.
Overview of @react-native-firebase/ai
mainThe@react-native-firebase/aipackage provides a modular interface for interacting with Firebase AI Logic. It allows developers to access generative models through a unified API using thegetAIfunction and various backend implementations.Overview of Firebase AI Logic
mainFirebase AI Logic provides client-side access to Google's latest generative AI models (such as Gemini) directly from mobile apps. Unlike server-side implementations, these client SDKs are designed for mobile and web environments, providing security measures to prevent unauthorized client access and offering seamless integration with other Firebase services.Overview of Firebase Phone Number Verification (PNV)
mainFirebase Phone Number Verification (PNV) provides carrier-level phone number verification on Android devices without requiring SMS. It verifies the user's phone number directly through the device's SIM card and carrier network, offering a seamless and secure experience.Overview of React Native Firebase Messaging
mainReact Native Firebase Messaging provides native integration of Firebase Cloud Messaging (FCM) for both Android and iOS. FCM is a cost-free service that enables server-to-device and device-to-device communication. The module exposes a JavaScript API to interact with these native FCM capabilities.Overview of Firebase In-App Messaging
mainFirebase In-App Messaging allows you to engage active users by sending targeted, contextual messages designed to nudge them toward key in-app actions, such as completing a game level, making a purchase, or subscribing to content.Overview of React Native Firebase - Functions
mainThe Cloud Functions for Firebase client SDKs allow you to call HTTPS Callable functions directly from your React Native application. To use this, you must first write and deploy an HTTPS Callable function in the Firebase Cloud Functions environment, then use the client SDK to invoke it from your app logic.Overview of React Native Firebase
mainReact Native Firebase is a collection of official React Native modules that connect your application to Firebase services. Each module acts as a lightweight JavaScript layer that interfaces directly with the native Firebase SDKs for both iOS and Android.
Key characteristics include:
- Native Performance: Connects directly to native iOS and Android Firebase SDKs.
- TypeScript Support: Provides first-class support for TypeScript.
- Web SDK Parity: Designed to mirror the official Firebase Web SDK, allowing for high cross-platform code re-usability between React Native and Web applications.
- Extensive Testing: Modules are extensively tested to ensure high reliability.
Understand the React Native New Architecture migration status
mainThe
react-native-firebaselibrary is undergoing a phased migration to the React Native New Architecture (TurboModules). The migration progress and package complexity are categorized into several tiers and phases.Package Categories
- No native bridge: Packages that are pure JavaScript and do not require TurboModule migration (e.g.,
@react-native-firebase/ai,@react-native-firebase/vertexai). - Already migrated: Packages that have already transitioned to TurboModules (e.g.,
@react-native-firebase/functions). - Native packages: Packages requiring migration, categorized by complexity (Tier A to Tier D) based on their number of legacy modules, events, and methods.
Migration Phases
The migration follows a specific strategy: foundation → hard probe → easy wins → remaining complex → sync conversion → coordinated break → cleanup.
Note: A coordinated major version release for consumers will occur once Phases 0–5, S, and R are complete. Phases C (EventEmitter cleanup) and E (Shared-state encapsulation) are optional post-break cleanup steps and do not gate the major release.
- No native bridge: Packages that are pure JavaScript and do not require TurboModule migration (e.g.,
Platform support and New Architecture for In-App Messaging
mainIn-App Messaging supports Android and iOS (using the native Firebase SDK).
Important: As of version 26, the React Native New Architecture is required. If you are upgrading, refer to the migration guide for New Architecture requirements.
App Check platform support and requirements
mainPlatforms
- Android: Supported via native Firebase SDK.
- iOS: Supported via native Firebase SDK.
New Architecture
- Required from v26 onwards. See the migration guide for details.
Attestation Providers
Use
ReactNativeFirebaseAppCheckProviderfor native attestation.Note: The
ReCaptchaEnterpriseProviderandReCaptchaV3Providerfrom thefirebase-js-sdkare web only and are not supported here.Platform support and New Architecture requirements
mainReact Native Firebase supports Android and iOS using the native Firebase SDKs.
Important Requirements:
- New Architecture: As of version v26, the React Native New Architecture is required.
- Async Initialization: The
initializeAppmethod is asynchronous on React Native due to the native bridge. - Web-only methods: The
registerVersionmethod is intended for web environments only and will throw an error on native Android or iOS platforms.