Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 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
4cb8cf1
Merge branch 'main' into auth-typescript
russellwheatley May 12, 2026
6018035
chore: move auth config to latest implementation
russellwheatley May 12, 2026
1c265d6
yarn.lock
russellwheatley May 12, 2026
ecb6b65
chore: auth remove baseUrl from tsconfig.json
russellwheatley May 12, 2026
4e0a8b3
chore: fix path in config/auth.ts
russellwheatley May 13, 2026
0d04ae8
fix: use requiredFirebaseTypes to get JS auth types
russellwheatley May 13, 2026
34db482
refactor(auth): align ParsedToken type with Firebase JS SDK
russellwheatley May 13, 2026
938d59f
refactor(auth)!: align auth enum value types with Firebase JS SDK
russellwheatley May 13, 2026
b4bba4a
refactor(auth)!: align connectAuthEmulator options with Firebase JS SDK
russellwheatley May 13, 2026
914723e
refactor(auth)!: align OAuthProvider credential options
russellwheatley May 13, 2026
ee7f27f
refactor(auth)!: align email auth credentials
russellwheatley May 13, 2026
8e33664
refactor(auth)!: align phone auth credentials
russellwheatley May 13, 2026
d656631
refactor(auth)!: align github auth credentials
russellwheatley May 13, 2026
45d52e0
refactor(auth)!: align google auth credentials
russellwheatley May 13, 2026
db3a6ee
refactor(auth)!: align TwitterAuthProvider credential shape
russellwheatley May 13, 2026
6690c90
refactor(auth)!: align FacebookAuthProvider credential shape
russellwheatley May 13, 2026
90029e8
refactor(auth)!: align PhoneAuthProvider verify signature
russellwheatley May 13, 2026
655b4d5
refactor(auth)!: add OAuthProvider credentialFromJSON
russellwheatley May 13, 2026
299b8b5
refactor(auth)!: align TotpMultiFactorGenerator types
russellwheatley May 13, 2026
c3ed87b
refactor(auth)!: add GithubAuthProvider extraction helpers
russellwheatley May 13, 2026
29056da
refactor(auth)!: align Facebook auth provider helpers
russellwheatley May 14, 2026
09bc2fc
refactor(auth)!: align Google auth provider helpers
russellwheatley May 15, 2026
1ba05c9
refactor(auth)!: align Twitter auth provider helpers
russellwheatley May 15, 2026
9bf5d36
Merge branch 'main' into auth-typescript
russellwheatley May 15, 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
191 changes: 191 additions & 0 deletions .github/scripts/compare-types/configs/auth.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
/**
* 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: '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: '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: '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: 'OAuthProvider',
reason:
'RN Firebase supports the firebase-js-sdk credential(options) and credentialFromJSON APIs, but its native helper class still differs by retaining RNFB provider configuration helpers and omitting credentialFromResult/credentialFromError helpers.',
},
{
name: 'PhoneAuthProvider',
reason:
'RN Firebase now mirrors the firebase-js-sdk credential and single-factor verifyPhoneNumber signatures while retaining an RNFB multi-factor overload; it still omits credentialFromResult/credentialFromError helpers because native provider results do not expose web credential extraction.',
},
{
name: 'TotpMultiFactorGenerator',
reason:
'RN Firebase now mirrors the firebase-js-sdk assertion return types and default-app generateSecret signature while retaining an RNFB auth overload for non-default native apps.',
},
{
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.',
},
],
};

export default config;
39 changes: 37 additions & 2 deletions .github/scripts/compare-types/src/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import appCheckConfig from '../configs/app-check';
import firestoreConfig from '../configs/firestore';
import firestorePipelinesConfig from '../configs/firestore-pipelines';
import remoteConfigConfig from '../configs/remote-config';
import authConfig from '../configs/auth';
import installationsConfig from '../configs/installations';
import perfConfig from '../configs/perf-config';

const SCRIPT_DIR = path.resolve(__dirname, '..');
const REPO_ROOT = path.resolve(SCRIPT_DIR, '..', '..', '..');
const REPO_ROOT = path.resolve(__dirname, '..', '..', '..', '..');

export interface PackageEntry {
/** Short name used in reports (e.g. "remote-config"). */
Expand Down Expand Up @@ -103,6 +103,41 @@ function optionalFirebasePackage(
}

export const packages: PackageEntry[] = [
{
name: 'auth',
firebaseSdkTypesPaths: [requiredFirebaseTypes('auth')],
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'), 'constants.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: [requiredFirebaseTypes('storage')],
Expand Down
2 changes: 1 addition & 1 deletion packages/ai/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,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"]
},
"types": ["react-native", "node"]
Expand Down
Loading
Loading