Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
48fc76f
refactor(auth): convert package sources to TypeScript
russellwheatley Apr 20, 2026
f7e3edb
refactor(auth): split modular and namespaced TypeScript surfaces
russellwheatley Apr 21, 2026
0872c24
refactor(auth): type namespaced module and native bridge
russellwheatley Apr 21, 2026
229cea0
refactor(auth): align modular API with firebase-js-sdk
russellwheatley Apr 21, 2026
abf22c2
chore: port over public auth types
russellwheatley Apr 21, 2026
314545a
test(auth): add type coverage and compare-types wiring
russellwheatley Apr 21, 2026
9395382
refactor(auth): reduce compare-types drift from firebase-js-sdk
russellwheatley Apr 21, 2026
4c2efa4
chore: remove unneeded modular/index.ts
russellwheatley Apr 23, 2026
d68dadc
refactor: some runtimes moved to modular, fixed up compare script
russellwheatley Apr 23, 2026
abc3447
fix: remove duplicate type aliases
russellwheatley Apr 24, 2026
6dab56b
fix: clean up auth index.ts exports
russellwheatley Apr 24, 2026
95d2de3
fix: password policy to use TS
russellwheatley Apr 24, 2026
e861fb9
fix: update types for auth providers
russellwheatley Apr 24, 2026
a84e011
refactor: remove ts no-check and type properly
russellwheatley Apr 24, 2026
99f20f1
refactor: web TS implementation
russellwheatley Apr 24, 2026
0507718
fix(auth): phoneauthprovider, remove additional native call
russellwheatley Apr 24, 2026
c33df00
refactor: auth and internal auth type
russellwheatley Apr 27, 2026
29e95c9
Merge branch 'main' into auth-typescript
russellwheatley Apr 27, 2026
e70785c
refactor: use modular types rather than deprecated namespace types
russellwheatley Apr 27, 2026
94cbcb2
chore: remove unused function
russellwheatley Apr 27, 2026
67562b5
chore: annotate namespace types as deprecated
russellwheatley Apr 27, 2026
cf8e1d6
chore: use multifactor internal type
russellwheatley Apr 27, 2026
dad4684
fix: useEmulator type and internal logic
russellwheatley Apr 27, 2026
9598bfd
refactor: User public api should use modular api
russellwheatley Apr 27, 2026
b2c7d11
refactor: normalise namespaced types to modular for consumers
russellwheatley Apr 27, 2026
2c0afc4
fix: vertexai and ai packages tsconfig.json
russellwheatley Apr 27, 2026
d5b597e
chore: remove namespace types from auth modular public types
russellwheatley Apr 27, 2026
118f3e1
test: fix tests after TS migration
russellwheatley Apr 30, 2026
1fd7588
test: fix some test mixing modular/namespace
russellwheatley Apr 30, 2026
157657a
fix: namespace "firebase" auth type
russellwheatley Apr 30, 2026
852266d
fix: update namespace types
russellwheatley Apr 30, 2026
c8f25f2
test: fix last remaining unit tests
russellwheatley Apr 30, 2026
4ade4a8
chore: fix type-test and export runtime types from modular.ts
russellwheatley Apr 30, 2026
47a59eb
test: fix jest test coverage which inherited repo wide include causin…
russellwheatley Apr 30, 2026
01ff415
fix: deprecated modular arg breaking e2e tests
russellwheatley May 1, 2026
b4164ba
fix: auth listener logic
russellwheatley May 1, 2026
479e941
chore: update error message for e2e tests
russellwheatley May 1, 2026
1dd6f62
test: check that all user credential properties are available to cons…
russellwheatley May 1, 2026
1da56b5
Merge branch 'main' into auth-typescript
russellwheatley May 1, 2026
2cb8bfe
chore: update auth typedoc
russellwheatley May 1, 2026
8ced923
chore: extend tsdoc to stop warnings
russellwheatley May 1, 2026
25f9d3a
chore: update auth config with more API with different shape
russellwheatley May 1, 2026
43be235
fix: validatePassword modular API type
russellwheatley May 1, 2026
86bb09e
test: update error message contain
russellwheatley May 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,067 changes: 4,067 additions & 0 deletions .github/scripts/compare-types/packages/auth/auth-js-sdk.d.ts

Large diffs are not rendered by default.

281 changes: 281 additions & 0 deletions .github/scripts/compare-types/packages/auth/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@
/**
* Known differences between the firebase-js-sdk @firebase/auth public
* API and the @react-native-firebase/auth modular API.
*
* Each entry must have a `name` and a `reason`. Any undocumented
* difference or stale entry will fail `yarn compare:types`.
*/

import type { PackageConfig } from '../../src/types';

const config: PackageConfig = {
nameMapping: {},

missingInRN: [
{
name: 'initializeRecaptchaConfig',
reason:
'Web-only reCAPTCHA bootstrap helper from the firebase-js-sdk. RN Firebase does not expose browser reCAPTCHA initialization because native SDKs own the phone-auth verification flow.',
},
{
name: 'AuthErrorCodes',
reason:
'RN Firebase still relies on native auth error code strings and does not export the firebase-js-sdk AuthErrorCodes constant map.',
},
{
name: 'browserCookiePersistence',
reason:
'Browser-only persistence implementation from the firebase-js-sdk. Not applicable to React Native native-auth persistence.',
},
{
name: 'browserLocalPersistence',
reason:
'Browser-only localStorage persistence implementation from the firebase-js-sdk. Not applicable to React Native native-auth persistence.',
},
{
name: 'browserPopupRedirectResolver',
reason:
'Browser-only popup/redirect resolver from the firebase-js-sdk. Native provider flows do not use the browser popup resolver stack.',
},
{
name: 'browserSessionPersistence',
reason:
'Browser-only sessionStorage persistence implementation from the firebase-js-sdk. Not applicable to React Native native-auth persistence.',
},
{
name: 'debugErrorMap',
reason:
'firebase-js-sdk web error-map helper. RN Firebase does not expose the SDK error-map selection API.',
},
{
name: 'EmailAuthCredential',
reason:
'RN Firebase does not yet expose the firebase-js-sdk EmailAuthCredential class as part of the modular public surface.',
},
{
name: 'indexedDBLocalPersistence',
reason:
'IndexedDB persistence is web-only and not applicable to React Native native-auth persistence.',
},
{
name: 'inMemoryPersistence',
reason:
'The firebase-js-sdk persistence object is not exported by RN Firebase because auth state is managed by the underlying native SDKs.',
},
{
name: 'OAuthCredential',
reason:
'RN Firebase does not yet expose the firebase-js-sdk OAuthCredential class as part of the modular public surface.',
},
{
name: 'OAuthCredentialOptions',
reason:
'RN Firebase does not yet export the firebase-js-sdk OAuthCredentialOptions interface.',
},
{
name: 'PhoneAuthCredential',
reason:
'RN Firebase does not yet expose the firebase-js-sdk PhoneAuthCredential class as part of the modular public surface.',
},
{
name: 'prodErrorMap',
reason:
'firebase-js-sdk web error-map helper. RN Firebase does not expose the SDK error-map selection API.',
},
{
name: 'ReactNativeAsyncStorage',
reason:
'The firebase-js-sdk React Native persistence helper type is not exported by RN Firebase because persistence is delegated to the native iOS/Android SDKs rather than configured through initializeAuth().',
},
{
name: 'RecaptchaParameters',
reason: 'Browser reCAPTCHA configuration is not part of the RN Firebase native auth surface.',
},
{
name: 'RecaptchaVerifier',
reason:
'Browser reCAPTCHA verifier implementation is not available in RN Firebase because native SDKs own application verification.',
},
{
name: 'SAMLAuthProvider',
reason:
'SAMLAuthProvider is not yet surfaced on the RN Firebase modular/public auth surface.',
},
],

extraInRN: [
{
name: 'AppleAuthProvider',
reason:
'RN Firebase-specific Apple auth provider helper exposed for native Sign in with Apple flows; the firebase-js-sdk does not export a separate AppleAuthProvider class.',
},
{
name: 'NativeFirebaseAuthError',
reason:
'RN Firebase-specific native bridge auth error type used in place of the firebase-js-sdk AuthError export.',
},
{
name: 'OIDCAuthProvider',
reason:
'RN Firebase-specific OIDC auth provider class retained for compatibility with the existing public package surface; the firebase-js-sdk exposes OAuthProvider instead of a separate OIDCAuthProvider class.',
},
{
name: 'OIDCProvider',
reason:
'RN Firebase-specific OIDC provider class export retained for compatibility with the existing package surface.',
},
{
name: 'PhoneAuthState',
reason: 'RN Firebase-specific enum-like object describing native phone-auth listener states.',
},
{
name: 'PhoneAuthListener',
reason: 'RN Firebase-specific listener object returned by verifyPhoneNumber().',
},
{
name: 'PhoneAuthError',
reason:
'RN Firebase-specific phone verification error snapshot type used by native phone-auth listeners.',
},
{
name: 'PhoneAuthSnapshot',
reason:
'RN Firebase-specific phone verification snapshot type used by native phone-auth listeners.',
},
{
name: 'verifyPhoneNumber',
reason:
'RN Firebase-specific helper exposing the native phone verification listener flow; the firebase-js-sdk does not export this helper.',
},
{
name: 'setLanguageCode',
reason:
'RN Firebase keeps a modular helper for setting auth.languageCode, while the firebase-js-sdk only exposes the writable property.',
},
{
name: 'useUserAccessGroup',
reason:
'RN Firebase-specific iOS keychain sharing helper with no firebase-js-sdk equivalent.',
},
{
name: 'getCustomAuthDomain',
reason:
'RN Firebase-specific helper that exposes the configured native auth domain; no firebase-js-sdk equivalent exists.',
},
],

differentShape: [
{
name: 'connectAuthEmulator',
reason:
'RN Firebase models disableWarnings as an optional property, while the firebase-js-sdk emitted type text shows a required boolean property.',
},
{
name: 'ActionCodeInfo',
reason:
'Semantically the same action-code operation string union; RN Firebase types spell `operation` as `ActionCodeOperationValue`, while the firebase-js-sdk snapshot uses `(typeof ActionCodeOperation)[keyof typeof ActionCodeOperation]`, which compare-types treats as a different shape string.',
},
{
name: 'MultiFactorAssertion',
reason:
'Same factor-id string union as the SDK; RN Firebase exposes `FactorIdValue` on `factorId`, while the firebase-js-sdk snapshot uses `(typeof FactorId)[keyof typeof FactorId]`, which differs only in emitted type text.',
},
{
name: 'MultiFactorError',
reason:
'Same operation-type string union as the SDK; RN Firebase narrows `customData.operationType` to `OperationTypeValue`, while the firebase-js-sdk snapshot uses `(typeof OperationType)[keyof typeof OperationType]`, which compare-types compares textually.',
},
{
name: 'MultiFactorInfo',
reason:
'Same factor-id string union as the SDK; RN Firebase exposes `FactorIdValue` on `factorId`, while the firebase-js-sdk snapshot uses `(typeof FactorId)[keyof typeof FactorId]`, which differs only in emitted type text.',
},
{
name: 'EmailAuthProvider',
reason:
'RN Firebase now exports EmailAuthProvider from the modular surface, but its native helper class still exposes a reduced static API and RNFB credential objects rather than mirroring the firebase-js-sdk EmailAuthProvider class shape.',
},
{
name: 'isSignInWithEmailLink',
reason:
'RN Firebase resolves this check asynchronously through the native bridge and returns Promise<boolean>, whereas the firebase-js-sdk returns a synchronous boolean.',
},
{
name: 'linkWithRedirect',
reason:
'Native provider flows resolve immediately with a UserCredential instead of following the browser redirect contract used by the firebase-js-sdk.',
},
{
name: 'reauthenticateWithRedirect',
reason:
'Native provider flows do not follow the browser redirect contract. RN Firebase models this as Promise<void> rather than the firebase-js-sdk Promise<never> signature.',
},
{
name: 'signInWithRedirect',
reason:
'Native provider flows resolve immediately with a UserCredential instead of following the browser redirect contract used by the firebase-js-sdk.',
},
{
name: 'updatePhoneNumber',
reason:
'RN Firebase accepts the broader AuthCredential surface, while the firebase-js-sdk narrows this parameter to PhoneAuthCredential.',
},
{
name: 'FacebookAuthProvider',
reason:
'RN Firebase now exports FacebookAuthProvider from the modular surface, but its native helper class only exposes the credential factory used by RNFB and does not yet mirror the firebase-js-sdk static fields and credentialFromResult/credentialFromError helpers.',
},
{
name: 'GithubAuthProvider',
reason:
'RN Firebase now exports GithubAuthProvider from the modular surface, but its native helper class only exposes the credential factory used by RNFB and does not yet mirror the firebase-js-sdk static fields and credentialFromResult/credentialFromError helpers.',
},
{
name: 'GoogleAuthProvider',
reason:
'RN Firebase now exports GoogleAuthProvider from the modular surface, but its native helper class only exposes the credential factory used by RNFB and does not yet mirror the firebase-js-sdk static fields and credentialFromResult/credentialFromError helpers.',
},
{
name: 'OAuthProvider',
reason:
'RN Firebase now exports OAuthProvider from the modular surface, but its native helper class still differs from the firebase-js-sdk class by exposing RNFB-specific credential construction and omitting credentialFromJSON/credentialFromResult/credentialFromError helpers.',
},
{
name: 'ParsedToken',
reason:
'TypeScript emits the parsed-token property keys without quotes in the generated declaration file, so compare-types reports a text-only difference even though the property set matches the firebase-js-sdk surface.',
},
{
name: 'PhoneAuthProvider',
reason:
'RN Firebase now exports PhoneAuthProvider from the modular surface, but the native helper class still exposes a reduced static API and looser signatures than the firebase-js-sdk PhoneAuthProvider class.',
},
{
name: 'PhoneMultiFactorGenerator',
reason:
'RN Firebase now exports PhoneMultiFactorGenerator from the modular surface, but its helper class still returns RNFB credential/assertion shapes rather than the firebase-js-sdk PhoneMultiFactorGenerator static API exactly.',
},
{
name: 'TotpMultiFactorGenerator',
reason:
'RN Firebase now exports TotpMultiFactorGenerator from the modular surface, but its helper class still differs from the firebase-js-sdk static API in signatures and returned assertion/secret shapes.',
},
{
name: 'TotpSecret',
reason:
'RN Firebase now exports TotpSecret from the modular surface, but the native-backed helper class exposes a reduced field set plus async/native helper methods that do not match the firebase-js-sdk TotpSecret class shape.',
},
{
name: 'TwitterAuthProvider',
reason:
'RN Firebase now exports TwitterAuthProvider from the modular surface, but its native helper class only exposes the credential factory used by RNFB and does not yet mirror the firebase-js-sdk static fields and credentialFromResult/credentialFromError helpers.',
},
{
name: 'UserCredential',
reason:
'Same operation-type string union as the SDK; RN Firebase exposes `operationType` as `OperationTypeValue`, while the firebase-js-sdk snapshot uses `(typeof OperationType)[keyof typeof OperationType]`, which compare-types treats as a different shape string.',
},
],
};

export default config;
44 changes: 36 additions & 8 deletions .github/scripts/compare-types/src/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type { PackageConfig } from './types';

import storageConfig from '../packages/storage/config';
import aiConfig from '../packages/ai/config';
import authConfig from '../packages/auth/config';
import databaseConfig from '../packages/database/config';
import appCheckConfig from '../packages/app-check/config';
import firestoreConfig from '../packages/firestore/config';
Expand Down Expand Up @@ -52,14 +53,43 @@ function rnDist(packageName: string): string {
}

export const packages: PackageEntry[] = [
{
name: 'auth',
firebaseSdkTypesPaths: [path.join(SCRIPT_DIR, 'packages', 'auth', 'auth-js-sdk.d.ts')],
rnFirebaseModularFiles: [
path.join(rnDist('auth'), 'types', 'auth.d.ts'),
path.join(rnDist('auth'), 'modular.d.ts'),
],
rnFirebaseSupportFiles: [
path.join(rnDist('auth'), 'index.d.ts'),
path.join(rnDist('auth'), 'namespaced.d.ts'),
path.join(rnDist('auth'), 'types', 'namespaced.d.ts'),
path.join(rnDist('auth'), 'types', 'internal.d.ts'),
path.join(rnDist('auth'), 'ConfirmationResult.d.ts'),
path.join(rnDist('auth'), 'MultiFactorResolver.d.ts'),
path.join(rnDist('auth'), 'PhoneAuthListener.d.ts'),
path.join(rnDist('auth'), 'PhoneMultiFactorGenerator.d.ts'),
path.join(rnDist('auth'), 'Settings.d.ts'),
path.join(rnDist('auth'), 'TotpMultiFactorGenerator.d.ts'),
path.join(rnDist('auth'), 'TotpSecret.d.ts'),
path.join(rnDist('auth'), 'User.d.ts'),
path.join(rnDist('auth'), 'getMultiFactorResolver.d.ts'),
path.join(rnDist('auth'), 'multiFactor.d.ts'),
path.join(rnDist('auth'), 'providers', 'AppleAuthProvider.d.ts'),
path.join(rnDist('auth'), 'providers', 'EmailAuthProvider.d.ts'),
path.join(rnDist('auth'), 'providers', 'FacebookAuthProvider.d.ts'),
path.join(rnDist('auth'), 'providers', 'GithubAuthProvider.d.ts'),
path.join(rnDist('auth'), 'providers', 'GoogleAuthProvider.d.ts'),
path.join(rnDist('auth'), 'providers', 'OAuthProvider.d.ts'),
path.join(rnDist('auth'), 'providers', 'OIDCAuthProvider.d.ts'),
path.join(rnDist('auth'), 'providers', 'PhoneAuthProvider.d.ts'),
path.join(rnDist('auth'), 'providers', 'TwitterAuthProvider.d.ts'),
],
config: authConfig,
},
{
name: 'storage',
firebaseSdkTypesPaths: [path.join(
SCRIPT_DIR,
'packages',
'storage',
'storage-js-sdk.d.ts',
)],
firebaseSdkTypesPaths: [path.join(SCRIPT_DIR, 'packages', 'storage', 'storage-js-sdk.d.ts')],
rnFirebaseModularFiles: [
path.join(rnDist('storage'), 'types', 'storage.d.ts'),
path.join(rnDist('storage'), 'modular.d.ts'),
Expand Down Expand Up @@ -212,5 +242,3 @@ export const packages: PackageEntry[] = [
config: firestorePipelinesConfig,
},
];


2 changes: 1 addition & 1 deletion packages/ai/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
],
"@react-native-firebase/app/lib/internal": ["../app/dist/typescript/lib/internal"],
"@react-native-firebase/app": ["../app/dist/typescript/lib"],
"@react-native-firebase/auth": ["../auth/lib"],
"@react-native-firebase/auth": ["../auth/dist/typescript/lib"],
"@react-native-firebase/app-check": ["../app-check/dist/typescript/lib"]
}
},
Expand Down
Loading
Loading