|
| 1 | +/** |
| 2 | + * Known differences between the firebase-js-sdk @firebase/auth public |
| 3 | + * API and the @react-native-firebase/auth modular API. |
| 4 | + * |
| 5 | + * Each entry must have a `name` and a `reason`. Any undocumented |
| 6 | + * difference or stale entry will fail `yarn compare:types`. |
| 7 | + * |
| 8 | + * Platform shorthand used in reasons: |
| 9 | + * - iOS/Android: native Firebase Auth SDK |
| 10 | + * - Other/All: Other/Hermes + Other/Web (firebase-js-sdk JS bridge) |
| 11 | + * - Other/Hermes: react-native-macos, Windows RN, etc. (no DOM) |
| 12 | + * - Other/Web: true browser/DOM context |
| 13 | + */ |
| 14 | + |
| 15 | +import type { PackageConfig } from '../src/types'; |
| 16 | + |
| 17 | +const config: PackageConfig = { |
| 18 | + nameMapping: {}, |
| 19 | + |
| 20 | + missingInRN: [ |
| 21 | + { |
| 22 | + name: 'initializeRecaptchaConfig', |
| 23 | + reason: |
| 24 | + 'iOS/Android: native SDKs own phone verification. Other/Hermes: not applicable (no DOM). Other/Web: not implemented yet; firebase-js-sdk support is possible.', |
| 25 | + }, |
| 26 | + { |
| 27 | + name: 'AuthErrorCodes', |
| 28 | + reason: |
| 29 | + 'iOS/Android: native auth error code strings. Other/All: not exported yet; firebase-js-sdk re-export is possible.', |
| 30 | + }, |
| 31 | + { |
| 32 | + name: 'browserCookiePersistence', |
| 33 | + reason: |
| 34 | + 'iOS/Android: not applicable. Other/Hermes: not applicable. Other/Web: not exported yet; firebase-js-sdk browser persistence is possible.', |
| 35 | + }, |
| 36 | + { |
| 37 | + name: 'browserLocalPersistence', |
| 38 | + reason: |
| 39 | + 'iOS/Android: not applicable. Other/Hermes: not applicable. Other/Web: not exported yet; firebase-js-sdk browser persistence is possible.', |
| 40 | + }, |
| 41 | + { |
| 42 | + name: 'browserPopupRedirectResolver', |
| 43 | + reason: |
| 44 | + 'iOS/Android: native provider flows. Other/Hermes: not applicable. Other/Web: not exported yet; firebase-js-sdk popup/redirect resolver is possible.', |
| 45 | + }, |
| 46 | + { |
| 47 | + name: 'browserSessionPersistence', |
| 48 | + reason: |
| 49 | + 'iOS/Android: not applicable. Other/Hermes: not applicable. Other/Web: not exported yet; firebase-js-sdk browser persistence is possible.', |
| 50 | + }, |
| 51 | + { |
| 52 | + name: 'debugErrorMap', |
| 53 | + reason: |
| 54 | + 'iOS/Android: not exported. Other/All: not implemented yet; firebase-js-sdk error-map selection via initializeAuth is possible.', |
| 55 | + }, |
| 56 | + { |
| 57 | + name: 'indexedDBLocalPersistence', |
| 58 | + reason: |
| 59 | + 'iOS/Android: not applicable. Other/Hermes: not applicable. Other/Web: not exported yet; firebase-js-sdk IndexedDB persistence is possible.', |
| 60 | + }, |
| 61 | + { |
| 62 | + name: 'inMemoryPersistence', |
| 63 | + reason: |
| 64 | + 'iOS/Android: native SDKs manage persistence. Other/All: not exported yet; firebase-js-sdk inMemoryPersistence via initializeAuth is possible.', |
| 65 | + }, |
| 66 | + { |
| 67 | + name: 'prodErrorMap', |
| 68 | + reason: |
| 69 | + 'iOS/Android: not exported. Other/All: not implemented yet; firebase-js-sdk error-map selection via initializeAuth is possible.', |
| 70 | + }, |
| 71 | + { |
| 72 | + name: 'ReactNativeAsyncStorage', |
| 73 | + reason: |
| 74 | + 'iOS/Android: persistence delegated to native SDKs. Other/Hermes: not exported yet; firebase-js-sdk React Native persistence via initializeAuth is possible.', |
| 75 | + }, |
| 76 | + { |
| 77 | + name: 'RecaptchaParameters', |
| 78 | + reason: |
| 79 | + 'iOS/Android: not applicable. Other/Hermes: not applicable. Other/Web: not exported; browser reCAPTCHA configuration only.', |
| 80 | + }, |
| 81 | + { |
| 82 | + name: 'RecaptchaVerifier', |
| 83 | + reason: |
| 84 | + 'iOS/Android: native verification. Other/Hermes: not applicable (no DOM). Other/Web: not implemented yet; firebase-js-sdk RecaptchaVerifier is possible.', |
| 85 | + }, |
| 86 | + { |
| 87 | + name: 'SAMLAuthProvider', |
| 88 | + reason: |
| 89 | + 'iOS/Android: not exported. Other/Hermes: not applicable. Other/Web: not exported yet; firebase-js-sdk SAML provider is possible.', |
| 90 | + }, |
| 91 | + ], |
| 92 | + |
| 93 | + extraInRN: [ |
| 94 | + { |
| 95 | + name: 'AppleAuthProvider', |
| 96 | + reason: |
| 97 | + 'Deprecated RN Firebase helper for Sign in with Apple. Prefer OAuthProvider("apple.com"). Retained for compatibility; firebase-js-sdk uses OAuthProvider only.', |
| 98 | + }, |
| 99 | + { |
| 100 | + name: 'NativeFirebaseAuthError', |
| 101 | + reason: |
| 102 | + 'RN Firebase-specific native bridge auth error type used in place of the firebase-js-sdk AuthError export.', |
| 103 | + }, |
| 104 | + { |
| 105 | + name: 'OIDCAuthProvider', |
| 106 | + reason: |
| 107 | + 'Deprecated RN Firebase OIDC helper. Prefer OAuthProvider("oidc.<suffix>"). Retained for compatibility; firebase-js-sdk uses OAuthProvider only.', |
| 108 | + }, |
| 109 | + { |
| 110 | + name: 'OIDCProvider', |
| 111 | + reason: |
| 112 | + 'Deprecated with OIDCAuthProvider. Prefer OAuthProvider for OIDC flows.', |
| 113 | + }, |
| 114 | + { |
| 115 | + name: 'PhoneAuthState', |
| 116 | + reason: |
| 117 | + 'RN Firebase-specific enum-like object describing native phone-auth listener states. iOS/Android only; Other uses js-sdk phone flows instead of verifyPhoneNumber().', |
| 118 | + }, |
| 119 | + { |
| 120 | + name: 'PhoneAuthListener', |
| 121 | + reason: |
| 122 | + 'RN Firebase-specific listener object returned by verifyPhoneNumber(). iOS/Android only.', |
| 123 | + }, |
| 124 | + { |
| 125 | + name: 'PhoneAuthError', |
| 126 | + reason: |
| 127 | + 'RN Firebase-specific phone verification error snapshot type used by native phone-auth listeners. iOS/Android only.', |
| 128 | + }, |
| 129 | + { |
| 130 | + name: 'PhoneAuthSnapshot', |
| 131 | + reason: |
| 132 | + 'RN Firebase-specific phone verification snapshot type used by native phone-auth listeners. iOS/Android only.', |
| 133 | + }, |
| 134 | + { |
| 135 | + name: 'verifyPhoneNumber', |
| 136 | + reason: |
| 137 | + 'RN Firebase-specific native phone verification listener flow. iOS/Android only; Other/All: use signInWithPhoneNumber / PhoneAuthProvider via js-sdk instead.', |
| 138 | + }, |
| 139 | + { |
| 140 | + name: 'setLanguageCode', |
| 141 | + reason: |
| 142 | + 'RN Firebase modular helper for auth.languageCode. iOS/Android: native. Other/All: not delegated yet; firebase-js-sdk languageCode / useDeviceLanguage is possible.', |
| 143 | + }, |
| 144 | + { |
| 145 | + name: 'useUserAccessGroup', |
| 146 | + reason: |
| 147 | + 'RN Firebase-specific iOS keychain sharing helper. iOS native only.', |
| 148 | + }, |
| 149 | + { |
| 150 | + name: 'getCustomAuthDomain', |
| 151 | + reason: |
| 152 | + 'RN Firebase-specific native auth domain helper on iOS/Android. Other/All: auth.config from firebase-js-sdk may cover this instead (see auth.config in migration guide).', |
| 153 | + }, |
| 154 | + { |
| 155 | + name: 'AdditionalUserInfoNative', |
| 156 | + reason: |
| 157 | + 'RN Firebase extension type: firebase-js-sdk AdditionalUserInfo core fields plus index signature for extra native bridge keys. Use when typing values from getAdditionalUserInfo or UserCredential.additionalUserInfo that may include provider-specific native fields.', |
| 158 | + }, |
| 159 | + ], |
| 160 | + |
| 161 | + differentShape: [ |
| 162 | + { |
| 163 | + name: 'OAuthCredential', |
| 164 | + reason: |
| 165 | + 'RN Firebase OAuthCredential exposes rawNonce for Apple / limited-login flows. OAuth 1.0 token secrets use the inherited AuthCredential.secret field (firebase-js-sdk optional secret on OAuthCredential).', |
| 166 | + }, |
| 167 | + { |
| 168 | + name: 'FacebookAuthProvider', |
| 169 | + reason: |
| 170 | + 'RN Firebase exports an extra credential(token, secret) overload for Facebook limited-login nonce behaviour. firebase-js-sdk public types only declare credential(accessToken). credentialFromResult / credentialFromError always return null at runtime today (types match js-sdk). Same runtime applies to GoogleAuthProvider, GithubAuthProvider, TwitterAuthProvider, OAuthProvider, and PhoneAuthProvider — see those entries. iOS/Android: no native extraction planned. Other/Hermes: not delegated. Other/Web: future implementation should delegate to firebase-js-sdk in RNFBAuthModule — do not invest in native iOS/Android extraction.', |
| 171 | + }, |
| 172 | + { |
| 173 | + name: 'UserCredential', |
| 174 | + reason: |
| 175 | + 'RN Firebase modular UserCredential includes optional enumerable additionalUserInfo (firebase-js-sdk core fields plus preserved native bridge keys). firebase-js-sdk keeps additionalUserInfo off the public UserCredential interface — use getAdditionalUserInfo there.', |
| 176 | + }, |
| 177 | + { |
| 178 | + name: 'isSignInWithEmailLink', |
| 179 | + reason: |
| 180 | + 'iOS/Android: Promise<boolean> via native bridge. Other/All: not aligned yet; firebase-js-sdk synchronous boolean is possible on Other/Hermes and Other/Web.', |
| 181 | + }, |
| 182 | + { |
| 183 | + name: 'linkWithRedirect', |
| 184 | + reason: |
| 185 | + 'iOS/Android: resolves immediately with UserCredential. Other/Hermes: not applicable (no DOM). Other/Web: not delegated yet; firebase-js-sdk redirect flow is possible.', |
| 186 | + }, |
| 187 | + { |
| 188 | + name: 'reauthenticateWithRedirect', |
| 189 | + reason: |
| 190 | + 'iOS/Android: Promise<void> after native in-app provider flow. Other/Hermes: not applicable. Other/Web: not delegated yet; firebase-js-sdk redirect semantics are possible.', |
| 191 | + }, |
| 192 | + { |
| 193 | + name: 'signInWithRedirect', |
| 194 | + reason: |
| 195 | + 'iOS/Android: resolves immediately with UserCredential. Other/Hermes: not applicable. Other/Web: not delegated yet; firebase-js-sdk redirect flow is possible.', |
| 196 | + }, |
| 197 | + { |
| 198 | + name: 'OAuthProvider', |
| 199 | + reason: |
| 200 | + 'iOS/Android: retains toObject() and native bridge configuration helpers. Other/Hermes: scopes/custom parameters via js-sdk are possible. Other/Web: full js-sdk OAuthProvider surface is possible; toObject() remains iOS/Android bridge-only. credentialFromResult / credentialFromError always return null at runtime today (types match js-sdk). Same runtime applies to GoogleAuthProvider, GithubAuthProvider, TwitterAuthProvider, FacebookAuthProvider, and PhoneAuthProvider. Other/Web is the future delegation path via firebase-js-sdk; iOS/Android native extraction is not planned.', |
| 201 | + }, |
| 202 | + { |
| 203 | + name: 'PhoneAuthProvider', |
| 204 | + reason: |
| 205 | + 'RN Firebase retains native multi-factor verifyPhoneNumber overloads for iOS/Android native bridge methods. MFA also works on Other via firebase-js-sdk through the web bridge (see tests/local-tests); this overload is an intentional RN extension, not a missing Other implementation. credentialFromResult / credentialFromError always return null at runtime today (types match js-sdk). Same runtime applies to GoogleAuthProvider, GithubAuthProvider, TwitterAuthProvider, FacebookAuthProvider, and OAuthProvider. Other/Web js-sdk delegation is the future path for non-null extraction.', |
| 206 | + }, |
| 207 | + { |
| 208 | + name: 'TotpMultiFactorGenerator', |
| 209 | + reason: |
| 210 | + 'RN Firebase extension: optional Auth overload for non-default native Firebase apps. firebase-js-sdk uses the default app only.', |
| 211 | + }, |
| 212 | + { |
| 213 | + name: 'TotpSecret', |
| 214 | + reason: |
| 215 | + 'iOS/Android: generateQrCodeUrl is Promise<string> via native bridge; openInOtpApp is an RN-only helper. Other/All: js-sdk synchronous generateQrCodeUrl is possible when MFA is supported on Other.', |
| 216 | + }, |
| 217 | + ], |
| 218 | +}; |
| 219 | + |
| 220 | +export default config; |
0 commit comments