Skip to content
Draft
Show file tree
Hide file tree
Changes from 7 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
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.

226 changes: 226 additions & 0 deletions .github/scripts/compare-types/packages/auth/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
/**
* 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: 'FacebookAuthProvider',
reason:
'This provider class is still only reachable through the legacy namespaced export path, not the modular compare-types surface.',
},
{
name: 'GithubAuthProvider',
reason:
'This provider class is still only reachable through the legacy namespaced export path, not the modular compare-types surface.',
},
{
name: 'GoogleAuthProvider',
reason:
'This provider class is still only reachable through the legacy namespaced export path, not the modular compare-types 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: 'PhoneAuthProvider',
reason:
'This provider class is still only reachable through the legacy namespaced export path, not the modular compare-types 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.',
},
{
name: 'TwitterAuthProvider',
reason:
'This provider class is still only reachable through the legacy namespaced export path, not the modular compare-types surface.',
},
],

extraInRN: [
{
name: 'NativeFirebaseAuthError',
reason:
'RN Firebase-specific native bridge auth error type used in place of the firebase-js-sdk AuthError export.',
},
{
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: '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: 'Auth',
reason:
'The public Auth surface now matches structurally, but the emitted declaration text still differs from the firebase-js-sdk because RN Firebase uses its local FirebaseApp and NextOrObserver<User> spellings in the generated interface.',
},
{
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.',
},
],
};

export default config;
79 changes: 42 additions & 37 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 firestoreConfig from '../packages/firestore/config';
import firestorePipelinesConfig from '../packages/firestore-pipelines/config';

Expand Down Expand Up @@ -45,17 +46,44 @@ export interface PackageEntry {
}

function rnDist(packageName: string): string {
return path.join(
REPO_ROOT,
'packages',
packageName,
'dist',
'typescript',
'lib',
);
return path.join(REPO_ROOT, 'packages', packageName, 'dist', 'typescript', 'lib');
}

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: 'remote-config',
// firebaseSdkTypesPaths: [
Expand All @@ -74,12 +102,7 @@ export const packages: PackageEntry[] = [
// },
{
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 All @@ -93,12 +116,8 @@ export const packages: PackageEntry[] = [
},
{
name: 'ai',
firebaseSdkTypesPaths: [
path.join(SCRIPT_DIR, 'packages', 'ai', 'ai-sdk.d.ts'),
],
rnFirebaseModularFiles: [
path.join(rnDist('ai'), 'index.d.ts'),
],
firebaseSdkTypesPaths: [path.join(SCRIPT_DIR, 'packages', 'ai', 'ai-sdk.d.ts')],
rnFirebaseModularFiles: [path.join(rnDist('ai'), 'index.d.ts')],
rnFirebaseSupportFiles: [
path.join(rnDist('ai'), 'backend.d.ts'),
path.join(rnDist('ai'), 'errors.d.ts'),
Expand Down Expand Up @@ -132,12 +151,7 @@ export const packages: PackageEntry[] = [
{
name: 'firestore',
firebaseSdkTypesPaths: [
path.join(
SCRIPT_DIR,
'packages',
'firestore',
'firestore-js-sdk.d.ts',
),
path.join(SCRIPT_DIR, 'packages', 'firestore', 'firestore-js-sdk.d.ts'),
],
rnFirebaseModularFiles: [
path.join(rnDist('firestore'), 'types', 'firestore.d.ts'),
Expand Down Expand Up @@ -174,16 +188,9 @@ export const packages: PackageEntry[] = [
{
name: 'firestore-pipelines',
firebaseSdkTypesPaths: [
path.join(
SCRIPT_DIR,
'packages',
'firestore-pipelines',
'pipelines.d.ts',
),
],
rnFirebaseModularFiles: [
path.join(rnDist('firestore'), 'pipelines', 'index.d.ts'),
path.join(SCRIPT_DIR, 'packages', 'firestore-pipelines', 'pipelines.d.ts'),
],
rnFirebaseModularFiles: [path.join(rnDist('firestore'), 'pipelines', 'index.d.ts')],
rnFirebaseSupportFiles: [
path.join(rnDist('firestore'), 'pipelines', 'expressions.d.ts'),
path.join(rnDist('firestore'), 'pipelines', 'pipeline.d.ts'),
Expand All @@ -197,5 +204,3 @@ export const packages: PackageEntry[] = [
config: firestorePipelinesConfig,
},
];


Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (c) 2016-present Invertase Limited & Contributors
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/**
* Base class to facilitate multi-factor authentication.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (c) 2016-present Invertase Limited & Contributors
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (c) 2016-present Invertase Limited & Contributors
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (c) 2016-present Invertase Limited & Contributors
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (c) 2016-present Invertase Limited & Contributors
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
/*
* Copyright (c) 2016-present Invertase Limited & Contributors
*
Expand Down Expand Up @@ -60,7 +61,7 @@ export class TotpSecret {
* @param qrCodeUrl the URL to open in the app, from generateQrCodeUrl
*/
openInOtpApp(qrCodeUrl) {
if (isString(qrCodeUrl) && !qrCodeUrl !== '') {
if (isString(qrCodeUrl) && qrCodeUrl !== '') {
return this.auth.native.openInOtpApp(this.secretKey, qrCodeUrl);
}
}
Expand Down
Loading
Loading