Version 26 removes the deprecated namespaced JavaScript API from selected packages. Each migrated package is modular-only: use getX(app?) and root-level helper functions from the package entry point. Namespaced default exports, firebase.<module>(), and Firebase*Types namespaces are removed from those packages.
If you are upgrading from v24 or earlier, complete Migrating to v25 first — v25 TypeScript alignment changes still apply.
- New Architecture requirement
- Platform behavior differences
- firebase-js-sdk API parity improvements
- General pattern
- App
- Machine Learning (ML)
- In-App Messaging
- Installations
- Cloud Messaging
- App Distribution
- Cloud Functions
- Performance Monitoring
- App Check
- Analytics
- Remote Config
- Crashlytics
- Realtime Database
- Cloud Storage
- Authentication
- Cloud Firestore
- Automated migration checklist
From v26 onward, every React Native Firebase package with a native bridge is implemented as a Codegen TurboModule and requires React Native's New Architecture. The legacy bridge modules were removed in the coordinated v26 break.
If you cannot enable New Architecture yet, stay on v25 (or v23 if you still depend on legacy-architecture Cloud Functions — see below).
| Package | Why |
|---|---|
@react-native-firebase/ai | Pure JavaScript — uses the firebase-js-sdk web interop layer; no native TurboModule. |
@react-native-firebase/vertexai | Pure JavaScript — same as ai; deprecated in favor of @react-native-firebase/ai. |
@react-native-firebase/functions has required New Architecture since v24 (Migrating to v24 — Cloud Functions). v26 extends the same requirement to all remaining native modules.
React Native CLI (Android) — set in android/gradle.properties:
newArchEnabled=trueReact Native CLI (iOS) — New Architecture is enabled when RCT_NEW_ARCH_ENABLED=1 during pod install (React Native sets this from newArchEnabled on recent templates). Follow the React Native New Architecture guide for your RN version.
Expo — enable in your app config (Expo SDK 52+):
{
"expo": {
"newArchEnabled": true
}
}Rebuild native projects after changing this (pod install, clean Android build).
Native builds fail early with explicit guards:
- Android: Gradle scripts print
New Architecture support is required for @react-native-firebase/<package>and fail the build. - iOS:
pod installfails with<PodName> requires New Architecture. Enable New Architecture to use this module.
When migrating from firebase-js-sdk web examples, watch for these high-impact runtime divergences:
{/* prettier-ignore */}
| Area | firebase-js-sdk (web) | React Native Firebase |
|---|---|---|
| Auth | Browser persistence, redirects, reCAPTCHA, revokeAccessToken, useDeviceLanguage, linkWithPhoneNumber / reauthenticateWithPhoneNumber | Native iOS/Android SDKs manage persistence. Several web-only helpers throw synchronously on React Native (setPersistence, getRedirectResult, revokeAccessToken, useDeviceLanguage, linkWithPhoneNumber, reauthenticateWithPhoneNumber). Use native provider flows instead. |
| Analytics | Cross-platform modular API | On-device conversion measurement helpers (initiateOnDeviceConversionMeasurement*) are iOS only; on Android and web the JS layer resolves without calling native (no-op). logTransaction (verified iOS in-app purchase events) is iOS only and rejects on other platforms. |
| Realtime Database | goOnline / goOffline are synchronous; web transport toggles | goOnline / goOffline are synchronous through TurboModules, matching firebase-js-sdk. getServerTime, setPersistenceEnabled, and setPersistenceCacheSizeBytes are RN-specific. forceLongPolling / forceWebSockets throw — transport is native-controlled. |
| Phone Number Verification | N/A (Android SDK only) | Android only — all entry points throw on iOS and Web. |
| Cloud Storage | uploadBytes / uploadString from JS blobs; upload task controls return sync boolean | putFile and writeToFile are native-only file-path APIs. UploadTask.pause() / .resume() / .cancel() also return sync boolean values through native TurboModules. |
| Cloud Messaging | Web push / service-worker surface | FCM token lifecycle, permissions, background handlers, and APNs token APIs are iOS only. Event delivery still uses the legacy native event proxy during the TurboModule migration; behavior matches pre-v26 releases but will change when Codegen events land in a future release. |
| Remote Config | reset() clears server and local state | reset() is Android only — iOS does not clear activated, fetched, or default Remote Config values. setDefaultsFromResource loads from native resource files (.plist / XML). |
| Performance | initializePerformance returns synchronously; trace start/stop are sync | initializePerformance is synchronous on RN (applies settings to the native instance). Trace, HTTP metric, and screen trace start/stop are synchronous through TurboModules, matching firebase-js-sdk. |
| Firestore | IndexedDB persistence, memoryLocalCache, persistentLocalCache, FieldValue maximum() / minimum() sentinels | Local cache factories and IndexedDB APIs are web only. Persistence is controlled by the native Firestore SDK. initializeFirestore returns Firestore synchronously. FieldValue maximum() / minimum() are not exported yet because iOS SDK 12.15.0 lacks matching native factories. |
| App Check | reCAPTCHA version 3 / Enterprise web providers | Use ReactNativeFirebaseAppCheckProvider for Device Check, App Attest, Play Integrity, etc. Web reCAPTCHA provider classes have no RN equivalent. |
| RN-native-only modules | No web SDK | crashlytics, in-app-messaging, app-distribution, and ml are React Native only — no firebase-js-sdk modular surface. |
Per-package notes also appear in each module's usage page under Platform support.
v26 aligns React Native Firebase modular types and several runtime signatures with firebase-js-sdk where TurboModules removed bridge-forced Promise wrappers. Use this section when porting web SDK examples or when scripted upgrades hit TypeScript or runtime errors.
Migration rule: If a method below is sync, remove await and any .then() / .catch() chain on its return value — sync APIs return void or a value directly; calling .then() on void throws at runtime.
{/* prettier-ignore */}
| Method | Before (pre-v26 / legacy bridge) | After (v26) | Notes |
|---|---|---|---|
registerVersion(library, version, variant?) | Promise<void> (web) | void — throws on RN | Web-only on RN; remove await if copied from web samples |
isSignInWithEmailLink(auth, emailLink) | Promise<boolean> | boolean | Remove await |
TotpSecret.generateQrCodeUrl(accountName?, issuer?) | Promise<string> | string | Remove await; omitted args default from current user / app name |
trace(…).start() / .stop() | Promise<null> | void | Remove await on perf trace lifecycle |
httpMetric(…).start() / .stop() | Promise<null> | void | Same as traces |
ScreenTrace.start() / .stop() | Promise<null> | void | Same as traces |
startScreenTrace(performance, screenName) | Promise<ScreenTrace> | ScreenTrace | Remove await |
goOnline(db) / goOffline(db) | Promise<void> | void | Remove await |
UploadTask.pause() / .resume() / .cancel() | Promise<boolean> | boolean | Remove await; use the returned boolean directly |
{/* prettier-ignore */}
| Export / method | Before | After | Notes |
|---|---|---|---|
onSnapshotsInSync(firestore, observer) | next?: () => void; error?: Error | next?: (value: void) => void; error?: FirestoreError | Callback overload onSnapshotsInSync(firestore, () => {}) unchanged |
uploadBytes(ref, data, metadata?) | Return type TaskResult | UploadResult | Alias rename only |
uploadBytesResumable(ref, data, metadata?) | Return type Task | UploadTask | Alias rename only |
| Storage / Remote Config error callbacks | NativeFirebaseError | FirebaseError / StorageError | NativeFirebaseError remains assignable to FirebaseError |
AppCheckTokenListener | Not exported | Exported type alias | Matches firebase-js-sdk observer typing |
FunctionsError, FunctionsErrorCodeCore | Missing or misaligned | Exported / aligned | Registry + compare-types config |
firestore/pipelines (StageOptions, TimeGranularity, isType, …) | Declaration drift | Aligned to SDK .d.ts | Type-only; no call-shape change |
{/* prettier-ignore */}
| Method | Before | After | Notes |
|---|---|---|---|
logEvent(analytics, …) | Promise<void> | void | Fire-and-forget; remove await / .then() |
initializeAppCheck(app?, options?) | Promise<AppCheck> | AppCheck | Returns handle immediately; provider setup continues natively |
initializeFirestore(app, settings, databaseId?) | Promise<Firestore> | Firestore | Returns instance immediately; settings() runs on native bridge |
getRemoteConfig(app?, options?) | (app?) only | (app?, options?: RemoteConfigOptions) | options accepted for parity; no-op on native |
aggregateFieldEqual() | Not exported | Exported | Aggregate query helper |
LastFetchStatus literals | — | — | Unchanged — native still uses no_fetch_yet / throttled (documented drift) |
{/* prettier-ignore */}
| Export / method | Before | After | Notes |
|---|---|---|---|
TransactionOptions | Not exported | Exported | Type for transaction retry options |
runTransaction(firestore, updateFunction, options?) | No options argument | Accepts options?: TransactionOptions | { maxAttempts?: number } on native iOS and Android; omitted options use the SDK default of 5 retries; explicit values < 1 throw Max attempts must be at least 1 (firebase-js-sdk parity) |
aggregateQuerySnapshotEqual() | Not exported | Exported | Aggregate query snapshot equality helper, alongside aggregateFieldEqual() |
maximum(n) / minimum(n) FieldValue sentinels | Exported by firebase-js-sdk 12.15.0 | Not exported by RNFB yet | Android SDK 34.15.0 has native factories, but iOS Firebase Firestore SDK 12.15.0 does not; RNFB waits for cross-platform parity |
{/* prettier-ignore */}
| Pitfall | Symptom | Fix |
|---|---|---|
.then() on sync API | TypeError: … .then is not a function | Use direct call: logEvent(…) not logEvent(…).then(…) |
await on sync API | Unnecessary microtask delay; misleading types in strict TS | Drop await where the table above marks the API sync |
onConfigUpdate(remoteConfig, observer) | Runtime throw: observer must include both next and error functions | Pass { next: (update) => {…}, error: (err) => {…} } — do not omit error |
onSnapshotsInSync observer form | Type error on error callback | Type error as (error: FirestoreError) => void, or use the () => void callback overload |
runTransaction(..., { maxAttempts: 0 }) or negative | Runtime throw: Max attempts must be at least 1 | Omit options for the default 5 attempts, or pass maxAttempts: 1 or higher |
For each package listed in this guide:
- Remove default export /
firebase.<module>()usage — import modular helpers from the package root. - Replace
Firebase*Typesnamespace imports with root types (InAppMessaging,Installations,FirebaseML, etc.). - Prefer free functions (
getId(installations),setMessagesDisplaySuppressed(inAppMessaging, enabled)) over instance methods on service objects.
Modular-only in v26: @react-native-firebase/app, @react-native-firebase/ml, @react-native-firebase/in-app-messaging, @react-native-firebase/installations, @react-native-firebase/messaging, @react-native-firebase/app-distribution, @react-native-firebase/functions, @react-native-firebase/perf, @react-native-firebase/app-check, @react-native-firebase/remote-config, @react-native-firebase/crashlytics, @react-native-firebase/database, @react-native-firebase/storage, @react-native-firebase/analytics, @react-native-firebase/auth, and @react-native-firebase/firestore. Other packages may still expose the namespaced API with deprecation warnings; modular imports remain the supported path.
The namespaced API for @react-native-firebase/app has been removed. This package is modular-only — use named exports such as getApp(), initializeApp(), and getUtils().
| Removed | Replacement (modular) |
|---|---|
Default export firebase | Named exports from @react-native-firebase/app |
firebase.app(name?) | getApp(name?) |
firebase.apps | getApps() |
firebase.initializeApp(options, name?) | initializeApp(options, name?) |
firebase.utils(app?) | getUtils(app?) |
firebase.utils.FilePath | FilePath (named export) |
firebase.SDK_VERSION | SDK_VERSION (named export) |
firebase.setLogLevel(...) | setLogLevel(...) |
firebase.<module>() accessors on the default export | Import modular helpers from each @react-native-firebase/* package |
// Previously (removed)
import firebase from '@react-native-firebase/app';
firebase.app().name;
firebase.initializeApp(options, 'secondary');
firebase.utils().FilePath.DOCUMENT_DIRECTORY;// Now
import { getApp, initializeApp, getUtils, FilePath } from '@react-native-firebase/app';
getApp().name;
initializeApp(options, 'secondary');
getUtils().FilePath.DOCUMENT_DIRECTORY;
// or
FilePath.DOCUMENT_DIRECTORY;The namespaced API for @react-native-firebase/ml has been removed. This package is modular-only — use getML(app?).
| Removed | Replacement (modular) |
|---|---|
firebase.ml() | getML() or getML(app) |
Default export ml() | getML() or getML(app) |
FirebaseMLTypes namespace | Import FirebaseML from package root |
// Previously (removed)
import firebase from '@react-native-firebase/app';
import ml from '@react-native-firebase/ml';
firebase.ml().app.name;
ml().app.name;// Now
import { getApp } from '@react-native-firebase/app';
import { getML } from '@react-native-firebase/ml';
getML().app.name; // default app
getML(getApp('secondaryFromNative')).app.name;The namespaced API for @react-native-firebase/in-app-messaging has been removed. This package is modular-only — use getInAppMessaging() and the root-level helper functions.
There is no firebase/in-app-messaging entry in the firebase-js-sdk modular surface; React Native Firebase follows the same modular service-instance pattern used for other native-only modules.
| Removed | Replacement (modular) |
|---|---|
firebase.inAppMessaging() | getInAppMessaging() |
Default export inAppMessaging() | getInAppMessaging() |
FirebaseInAppMessagingTypes | Import InAppMessaging and helpers (setMessagesDisplaySuppressed, etc.) from root |
| Instance-only usage without modular helpers | Prefer free functions: setMessagesDisplaySuppressed(inAppMessaging, enabled), etc. |
// Previously (removed)
import firebase from '@react-native-firebase/app';
import inAppMessaging from '@react-native-firebase/in-app-messaging';
await firebase.inAppMessaging().setMessagesDisplaySuppressed(true);
// or
await inAppMessaging().setMessagesDisplaySuppressed(true);// Now
import {
getInAppMessaging,
setMessagesDisplaySuppressed,
} from '@react-native-firebase/in-app-messaging';
await setMessagesDisplaySuppressed(getInAppMessaging(), true);See In-App Messaging usage for additional examples.
The namespaced API for @react-native-firebase/installations has been removed. This package is modular-only — use getInstallations() and the root-level helper functions.
Modular getInstallations() returns a firebase-js-sdk-shaped Installations object exposing only app. Use modular helper functions instead of instance methods.
| Removed | Replacement (modular) |
|---|---|
firebase.installations() | getInstallations() |
Default export installations() | getInstallations() |
FirebaseInstallationsTypes | Import Installations and helpers (getId, getToken, deleteInstallations) from root |
installations.getId() / .getToken() / .delete() | getId(installations), getToken(installations), deleteInstallations(installations) |
| Before | Now |
|---|---|
installations.getId() | getId(installations) |
installations.getToken() | getToken(installations) |
installations.delete() | deleteInstallations(installations) — argument is required |
// Previously (removed)
import firebase from '@react-native-firebase/app';
import installations from '@react-native-firebase/installations';
const id = await firebase.installations().getId();
// or
const id = await installations().getId();// Now
import { getInstallations, getId } from '@react-native-firebase/installations';
const installations = getInstallations();
const id = await getId(installations);See Installations usage for additional examples.
The namespaced API for @react-native-firebase/messaging has been removed. This package is modular-only — use getMessaging() and the root-level helper functions.
Modular getMessaging() returns a firebase-js-sdk-shaped Messaging object. Prefer free functions (getToken(messaging), onMessage(messaging, listener), etc.) over calling methods on the service instance.
| Removed | Replacement (modular) |
|---|---|
firebase.messaging() | getMessaging() |
Default export messaging() | getMessaging() |
FirebaseMessagingTypes | Import Messaging, RemoteMessage, and helpers from package root |
messaging.getToken() / .onMessage() / etc. | getToken(messaging), onMessage(messaging, listener), etc. |
messaging.setDeliveryMetricsExportToBigQuery() | experimentalSetDeliveryMetricsExportedToBigQueryEnabled(messaging, enabled) |
firebase.messaging.SDK_VERSION / messaging.SDK_VERSION | SDK_VERSION top-level export from package root |
// Previously (removed)
import firebase from '@react-native-firebase/app';
import messaging from '@react-native-firebase/messaging';
firebase.messaging().onMessage(message => {
console.log(message.data);
});
// or
messaging().onMessage(message => {
console.log(message.data);
});// Now
import { getMessaging, onMessage } from '@react-native-firebase/messaging';
onMessage(getMessaging(), message => {
console.log(message.data);
});// Previously (removed)
await firebase.messaging().setDeliveryMetricsExportToBigQuery(true);// Now
import {
getMessaging,
experimentalSetDeliveryMetricsExportedToBigQueryEnabled,
} from '@react-native-firebase/messaging';
await experimentalSetDeliveryMetricsExportedToBigQueryEnabled(getMessaging(), true);See Cloud Messaging usage for additional examples.
The namespaced API for @react-native-firebase/app-distribution has been removed. This package is modular-only — use getAppDistribution() and the root-level helper functions.
| Removed | Replacement (modular) |
|---|---|
firebase.appDistribution() | getAppDistribution() |
Default export appDistribution() | getAppDistribution() |
FirebaseAppDistributionTypes | Import AppDistribution, AppDistributionRelease from package root |
appDistribution.isTesterSignedIn() / etc. | isTesterSignedIn(appDistribution), signInTester(appDistribution), checkForUpdate(appDistribution), signOutTester(appDistribution) |
firebase.appDistribution.SDK_VERSION | SDK_VERSION top-level export from package root |
// Previously (removed)
import firebase from '@react-native-firebase/app';
import appDistribution from '@react-native-firebase/app-distribution';
await firebase.appDistribution().isTesterSignedIn();// Now
import { getAppDistribution, isTesterSignedIn } from '@react-native-firebase/app-distribution';
const appDistribution = getAppDistribution();
await isTesterSignedIn(appDistribution);The namespaced API for @react-native-firebase/functions has been removed. This package is modular-only — use getFunctions() and root-level helper functions.
| Removed | Replacement (modular) |
|---|---|
firebase.functions() | getFunctions() or getFunctions(app, regionOrCustomDomain) |
Default export functions() | getFunctions() |
FirebaseFunctionsTypes | Import Functions, HttpsCallable, HttpsErrorCode, etc. from package root |
functions().httpsCallable() | httpsCallable(functions, name, options?) |
functions().useEmulator() | connectFunctionsEmulator(functions, host, port) |
// Previously (removed)
import firebase from '@react-native-firebase/app';
import functions from '@react-native-firebase/functions';
await firebase.functions().httpsCallable('myFn')({ foo: 'bar' });// Now
import { getFunctions, httpsCallable } from '@react-native-firebase/functions';
const functions = getFunctions();
await httpsCallable(functions, 'myFn')({ foo: 'bar' });The namespaced API for @react-native-firebase/perf has been removed. This package is modular-only — use getPerformance() and root-level helper functions.
| Removed | Replacement (modular) |
|---|---|
firebase.perf() | getPerformance() |
Default export perf() | getPerformance() |
FirebasePerformanceTypes | Import FirebasePerformance, PerformanceTrace, etc. from package root |
perf().newTrace() | trace(performance, name) |
perf().newHttpMetric() | httpMetric(performance, url, httpMethod) |
Trace,HttpMetric, andScreenTracestart()/stop()now returnvoidsynchronously (previouslyPromise<null>), matching the firebase-js-sdk webPerformanceTrace. The underlying native calls are in-memory, so noawaitis required — remove anyawaiton these calls.startScreenTrace(performance, screenName)and the internalstartTrace(name)helper now return the trace instance synchronously instead of aPromise.
The namespaced API for @react-native-firebase/app-check has been removed. This package is modular-only — use getAppCheck() / initializeAppCheck() and root-level helper functions.
| Removed | Replacement (modular) |
|---|---|
firebase.appCheck() | getAppCheck() or initializeAppCheck(app, options) |
Default export appCheck() | getAppCheck() |
FirebaseAppCheckTypes | Import AppCheck, AppCheckTokenResult, etc. from package root |
appCheck().getToken() | getToken(appCheck, forceRefresh?) |
initializeAppCheck(app?, options?)returnsAppChecksynchronously (previouslyPromise<AppCheck>). Native provider setup continues in the background — removeawaitand do not chain.then().
The namespaced API for @react-native-firebase/analytics has been removed. This package is modular-only — use getAnalytics() and root-level helper functions.
Analytics supports only the default Firebase app (same as before). Calling getAnalytics(secondaryApp) throws.
| Removed | Replacement (modular) |
|---|---|
firebase.analytics() | getAnalytics() |
Default export analytics() | getAnalytics() |
FirebaseAnalyticsTypes | Import Analytics, event parameter types, etc. from package root |
analytics().logEvent(...) | logEvent(analytics, ...) |
analytics().setUserId(...) etc. | setUserId(analytics, ...), setConsent(analytics, ...), etc. |
Deprecated helper events (logScreenView, logPurchase, …) | Still exported as modular helpers; prefer logEvent(analytics, 'screen_view', params) |
logEvent(analytics, …)returnsvoidsynchronously (previouslyPromise<void>). Removeawaitand.then()chains.
// Previously (removed)
import firebase from '@react-native-firebase/app';
import analytics from '@react-native-firebase/analytics';
await firebase.analytics().logEvent('screen_view', { screen_name: 'Home' });
await analytics().setUserId('user-123');// Now
import { getAnalytics, logEvent, setUserId } from '@react-native-firebase/analytics';
const analytics = getAnalytics();
logEvent(analytics, 'screen_view', { screen_name: 'Home' });
await setUserId(analytics, 'user-123');See Analytics usage for additional examples.
The namespaced API for @react-native-firebase/remote-config has been removed. This package is modular-only — use getRemoteConfig() and root-level helper functions.
Modular getRemoteConfig() returns a firebase-js-sdk-shaped RemoteConfig object with app, settings, defaultConfig, fetchTimeMillis, and lastFetchStatus. Use modular helper functions for fetch/activate/getters; assign remoteConfig.settings and remoteConfig.defaultConfig instead of removed modular setConfigSettings() / setDefaults() helpers.
| Removed | Replacement (modular) |
|---|---|
firebase.remoteConfig() | getRemoteConfig() |
Default export remoteConfig() | getRemoteConfig() |
FirebaseRemoteConfigTypes | Import RemoteConfig, Value, etc. from package root |
remoteConfig().activate() etc. | activate(remoteConfig), fetchConfig(remoteConfig), getValue(remoteConfig, key), etc. |
remoteConfig.LastFetchStatus / .ValueSource on namespace | LastFetchStatus, ValueSource named exports |
| Before | Now |
|---|---|
remoteConfig().fetch() | fetchConfig(remoteConfig) |
remoteConfig().setConfigSettings({ ... }) | remoteConfig.settings = { ... } |
remoteConfig().setDefaults({ ... }) | remoteConfig.defaultConfig = { ... } |
remoteConfig().onConfigUpdated(listener) | onConfigUpdate(remoteConfig, observer) |
// Previously (removed)
import firebase from '@react-native-firebase/app';
import remoteConfig from '@react-native-firebase/remote-config';
await firebase.remoteConfig().fetchAndActivate();
const value = firebase.remoteConfig().getValue('key').asString();// Now
import { getRemoteConfig, fetchAndActivate, getValue } from '@react-native-firebase/remote-config';
const remoteConfig = getRemoteConfig();
await fetchAndActivate(remoteConfig);
const value = getValue(remoteConfig, 'key').asString();See Remote Config usage for additional examples.
The namespaced API for @react-native-firebase/crashlytics has been removed. This package is modular-only — use getCrashlytics() and root-level helper functions.
| Removed | Replacement (modular) |
|---|---|
firebase.crashlytics() | getCrashlytics() |
Default export crashlytics() | getCrashlytics() |
FirebaseCrashlyticsTypes | Import Crashlytics from package root |
crashlytics().log() | log(crashlytics, message) |
crashlytics().recordError() | recordError(crashlytics, error, jsErrorName?) |
The namespaced API for @react-native-firebase/database has been removed. This package is modular-only — use getDatabase() and root-level helper functions.
| Removed | Replacement (modular) |
|---|---|
firebase.database() | getDatabase() or getDatabase(app, url?) |
Default export database() | getDatabase() |
FirebaseDatabaseTypes | Import Database, DatabaseReference, etc. from package root |
database().ref() | ref(database, path?) |
database().refFromURL() | refFromURL(database, url) |
goOnline(db)andgoOffline(db)(and the database instance methods) now returnvoidsynchronously (previouslyPromise<void>), matching firebase-js-sdk. Remove anyawaiton these calls.
The namespaced API for @react-native-firebase/storage has been removed. This package is modular-only — use getStorage() and root-level helper functions.
| Removed | Replacement (modular) |
|---|---|
firebase.storage() | getStorage() or getStorage(app, bucketUrl?) |
Default export storage() | getStorage() |
FirebaseStorageTypes | Import FirebaseStorage, StorageReference, etc. from package root |
storage().ref() | ref(storage, path?) |
storageRef.put() | uploadBytesResumable(storageRef, data, metadata?) |
UploadTask.pause(),UploadTask.resume(), andUploadTask.cancel()now returnbooleansynchronously (previouslyPromise<boolean>), matching firebase-js-sdk task semantics. Removeawait,.then(), and.catch()from these control calls and use the returned boolean directly.cancel()delegates to the native SDK. Android cancels active uploads; iOS active-upload cancel follows the current Firebase Storage iOS SDK 12.15.0 behavior tracked in firebase-ios-sdk#16353.
The namespaced API for @react-native-firebase/auth has been removed. This package is modular-only — use getAuth() / initializeAuth() and root-level helper functions.
| Removed | Replacement (modular) |
|---|---|
firebase.auth() | getAuth() or getAuth(app) |
Default export auth() | getAuth() |
FirebaseAuthTypes namespace | Import Auth, User, UserCredential, etc. from package root |
auth().signInWithEmailAndPassword(...) | signInWithEmailAndPassword(getAuth(), ...) |
auth().useEmulator(url) | connectAuthEmulator(getAuth(), url, options?) |
firebase.auth.EmailAuthProvider | EmailAuthProvider (named export) |
isSignInWithEmailLink(auth, emailLink)now returnsbooleansynchronously, matching firebase-js-sdk.TotpSecret.generateQrCodeUrl(accountName?, issuer?)now returnsstringsynchronously, matching firebase-js-sdk. WhenaccountNameorissueris omitted, React Native Firebase fills the same defaults from the current user email and Firebase app name.
// Previously (removed)
import firebase from '@react-native-firebase/app';
import auth from '@react-native-firebase/auth';
firebase.auth().signOut();
auth().currentUser;// Now
import { getAuth, signOut } from '@react-native-firebase/auth';
const auth = getAuth();
await signOut(auth);
auth.currentUser;The namespaced API for @react-native-firebase/firestore has been removed. This package is modular-only — use getFirestore() / initializeFirestore() and root-level helper functions. The @react-native-firebase/firestore/pipelines subpath export is unchanged.
| Removed | Replacement (modular) |
|---|---|
firebase.firestore() | getFirestore() or getFirestore(app, databaseId?) |
Default export firestore() | getFirestore() |
FirebaseFirestoreTypes namespace | Import Firestore, DocumentReference, Query, etc. from package root |
firestore().collection(...) | collection(getFirestore(), ...) |
firestore().doc(...) | doc(getFirestore(), ...) |
firestore().batch() | writeBatch(getFirestore()) |
firestore().runTransaction(...) | runTransaction(getFirestore(), updateFunction, options?) |
firestore().useEmulator(...) | connectFirestoreEmulator(getFirestore(), ...) |
firestore().settings(...) | initializeFirestore(app, settings, databaseId?) |
firestore.FieldValue / firestore.Timestamp | FieldValue, Timestamp, FieldPath, Bytes, GeoPoint, Filter (named exports) |
firestore.Blob | Bytes |
initializeFirestore(app, settings, databaseId?)returnsFirestoresynchronously (previouslyPromise<Firestore>). Removeawaitand.then(); settings apply on the native bridge after return.TransactionOptionsis now exported.runTransaction(firestore, updateFunction, options?)accepts{ maxAttempts?: number }and passes the retry limit to the native iOS and Android Firestore SDKs. Whenoptionsis omitted, the native default applies (5 attempts, matching firebase-js-sdkrunTransaction). WhenmaxAttemptsis provided explicitly, values below 1 throw synchronously withMax attempts must be at least 1— the same validation as firebase-js-sdk.aggregateFieldEqual()andaggregateQuerySnapshotEqual()are now exported for aggregate query equality checks (firebase-js-sdk parity).- FieldValue
maximum(n)andminimum(n)sentinels from firebase-js-sdk 12.15.0 are not exported yet. Android Firebase Firestore SDK 34.15.0 supports them, but iOS Firebase Firestore SDK 12.15.0 does not expose matchingFIRFieldValuefactories, so React Native Firebase waits for cross-platform support.
// Previously (removed)
import firebase from '@react-native-firebase/app';
import firestore from '@react-native-firebase/firestore';
firebase.firestore().collection('users').doc('alice').set({ name: 'Alice' });
firestore.FieldValue.serverTimestamp();// Now
import {
getFirestore,
collection,
doc,
setDoc,
serverTimestamp,
} from '@react-native-firebase/firestore';
const db = getFirestore();
await setDoc(doc(collection(db, 'users'), 'alice'), {
name: 'Alice',
createdAt: serverTimestamp(),
});See Firestore usage for additional examples.
Use this section when running scripted or agent-assisted upgrades to v26 for modular-only packages.
# Bump all @react-native-firebase/* packages to v26 together (monorepo versions are aligned)
yarn add @react-native-firebase/app@^26.0.0 …
cd ios && pod installFor each modular-only package you use:
| Package | Search for | Replace with |
|---|---|---|
app | default firebase import, firebase.app(), firebase.apps, firebase.initializeApp(), firebase.utils(), firebase.SDK_VERSION | getApp(), getApps(), initializeApp(), getUtils(), FilePath, SDK_VERSION, setLogLevel, etc. |
ml | firebase.ml(), default ml(), FirebaseMLTypes | getML(), root FirebaseML type |
in-app-messaging | firebase.inAppMessaging(), default inAppMessaging(), FirebaseInAppMessagingTypes | getInAppMessaging(), root modular helpers (setMessagesDisplaySuppressed, etc.) |
installations | firebase.installations(), default installations(), .getId(), .getToken(), .delete(), FirebaseInstallationsTypes | getInstallations(), getId(), getToken(), deleteInstallations() |
messaging | firebase.messaging(), default messaging(), FirebaseMessagingTypes, instance methods | getMessaging(), root helpers (getToken, onMessage, etc.), SDK_VERSION, experimentalSetDeliveryMetricsExportedToBigQueryEnabled |
app-distribution | firebase.appDistribution(), default appDistribution(), FirebaseAppDistributionTypes, instance methods | getAppDistribution(), isTesterSignedIn, signInTester, checkForUpdate, signOutTester, SDK_VERSION |
functions | firebase.functions(), default functions(), FirebaseFunctionsTypes, instance methods | getFunctions(), httpsCallable, httpsCallableFromUrl, connectFunctionsEmulator, HttpsErrorCode |
perf | firebase.perf(), default perf(), FirebasePerformanceTypes, instance methods | getPerformance(), trace, httpMetric, newScreenTrace, startScreenTrace, initializePerformance |
app-check | firebase.appCheck(), default appCheck(), FirebaseAppCheckTypes, instance methods | getAppCheck(), initializeAppCheck, getToken, getLimitedUseToken, setTokenAutoRefreshEnabled, onTokenChanged, CustomProvider |
analytics | firebase.analytics(), default analytics(), FirebaseAnalyticsTypes, instance methods | getAnalytics(), logEvent, setUserId, setConsent, getAppInstanceId, getSessionId, etc. |
remote-config | firebase.remoteConfig(), default remoteConfig(), FirebaseRemoteConfigTypes, instance methods | getRemoteConfig(), activate, fetchConfig, fetchAndActivate, getValue, getAll, onConfigUpdate, LastFetchStatus, ValueSource |
crashlytics | firebase.crashlytics(), default crashlytics(), FirebaseCrashlyticsTypes, instance methods | getCrashlytics(), log, recordError, setUserId, setAttribute, setAttributes, setCrashlyticsCollectionEnabled, etc. |
database | firebase.database(), default database(), FirebaseDatabaseTypes, instance methods | getDatabase(), ref, refFromURL, onValue, runTransaction, connectDatabaseEmulator, etc. |
storage | firebase.storage(), default storage(), FirebaseStorageTypes, instance/reference methods | getStorage(), ref, uploadBytesResumable, getDownloadURL, connectStorageEmulator, StringFormat, TaskEvent, TaskState |
firestore | firebase.firestore(), default firestore(), FirebaseFirestoreTypes, instance methods | getFirestore(), doc, collection, setDoc, writeBatch, runTransaction, connectFirestoreEmulator, FieldValue, Timestamp, Bytes, SDK_VERSION |
Also remove await, .then(), and .catch() from UploadTask.pause(), UploadTask.resume(), and UploadTask.cancel(). For Firestore transactions, import TransactionOptions when you pass { maxAttempts } (omit options for the default 5 retries; do not pass 0 or negative values). Import aggregateFieldEqual() / aggregateQuerySnapshotEqual() for aggregate equality checks.
yarn compile
yarn tests:jest packages/<pkg>/__tests__
Core / App