@firebase/auth 1.7.1-canary.e1a7764cf → 1.7.1-passkey-preview.103ead202

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/dist/auth-public.d.ts +60 -15
  2. package/dist/auth.d.ts +64 -16
  3. package/dist/browser-cjs/{index-b554a82d.js → index-763ce1de.js} +261 -17
  4. package/dist/browser-cjs/index-763ce1de.js.map +1 -0
  5. package/dist/browser-cjs/index.js +4 -1
  6. package/dist/browser-cjs/index.js.map +1 -1
  7. package/dist/browser-cjs/internal.js +4 -1
  8. package/dist/browser-cjs/internal.js.map +1 -1
  9. package/dist/browser-cjs/src/api/account_management/account.d.ts +2 -0
  10. package/dist/browser-cjs/src/api/account_management/passkey.d.ts +83 -0
  11. package/dist/browser-cjs/src/api/account_management/passkey.test.d.ts +17 -0
  12. package/dist/browser-cjs/src/api/index.d.ts +5 -1
  13. package/dist/browser-cjs/src/core/index.d.ts +1 -0
  14. package/dist/browser-cjs/src/core/strategies/email.d.ts +3 -5
  15. package/dist/browser-cjs/src/core/strategies/email_and_password.d.ts +4 -6
  16. package/dist/browser-cjs/src/core/strategies/passkey.d.ts +41 -0
  17. package/dist/browser-cjs/src/core/strategies/passkey.test.d.ts +17 -0
  18. package/dist/browser-cjs/src/core/user/account_info.d.ts +1 -3
  19. package/dist/browser-cjs/src/core/user/user_impl.d.ts +2 -1
  20. package/dist/browser-cjs/src/model/enums.d.ts +6 -2
  21. package/dist/browser-cjs/src/model/public_types.d.ts +18 -1
  22. package/dist/browser-cjs/src/model/user.d.ts +3 -0
  23. package/dist/cordova/index.js +2 -2
  24. package/dist/cordova/internal.js +2 -2
  25. package/dist/cordova/{popup_redirect-89a4178c.js → popup_redirect-619ee864.js} +331 -18
  26. package/dist/cordova/popup_redirect-619ee864.js.map +1 -0
  27. package/dist/cordova/src/api/account_management/account.d.ts +2 -0
  28. package/dist/cordova/src/api/account_management/passkey.d.ts +83 -0
  29. package/dist/cordova/src/api/account_management/passkey.test.d.ts +17 -0
  30. package/dist/cordova/src/api/index.d.ts +5 -1
  31. package/dist/cordova/src/core/index.d.ts +1 -0
  32. package/dist/cordova/src/core/strategies/email.d.ts +3 -5
  33. package/dist/cordova/src/core/strategies/email_and_password.d.ts +4 -6
  34. package/dist/cordova/src/core/strategies/passkey.d.ts +41 -0
  35. package/dist/cordova/src/core/strategies/passkey.test.d.ts +17 -0
  36. package/dist/cordova/src/core/user/account_info.d.ts +1 -3
  37. package/dist/cordova/src/core/user/user_impl.d.ts +2 -1
  38. package/dist/cordova/src/model/enums.d.ts +6 -2
  39. package/dist/cordova/src/model/public_types.d.ts +18 -1
  40. package/dist/cordova/src/model/user.d.ts +3 -0
  41. package/dist/esm2017/{index-456eaf5d.js → index-e517538d.js} +259 -18
  42. package/dist/esm2017/index-e517538d.js.map +1 -0
  43. package/dist/esm2017/index.js +1 -1
  44. package/dist/esm2017/internal.js +2 -2
  45. package/dist/esm2017/src/api/account_management/account.d.ts +2 -0
  46. package/dist/esm2017/src/api/account_management/passkey.d.ts +83 -0
  47. package/dist/esm2017/src/api/account_management/passkey.test.d.ts +17 -0
  48. package/dist/esm2017/src/api/index.d.ts +5 -1
  49. package/dist/esm2017/src/core/index.d.ts +1 -0
  50. package/dist/esm2017/src/core/strategies/email.d.ts +3 -5
  51. package/dist/esm2017/src/core/strategies/email_and_password.d.ts +4 -6
  52. package/dist/esm2017/src/core/strategies/passkey.d.ts +41 -0
  53. package/dist/esm2017/src/core/strategies/passkey.test.d.ts +17 -0
  54. package/dist/esm2017/src/core/user/account_info.d.ts +1 -3
  55. package/dist/esm2017/src/core/user/user_impl.d.ts +2 -1
  56. package/dist/esm2017/src/model/enums.d.ts +6 -2
  57. package/dist/esm2017/src/model/public_types.d.ts +18 -1
  58. package/dist/esm2017/src/model/user.d.ts +3 -0
  59. package/dist/esm5/{index-7c43a070.js → index-5377e4d7.js} +331 -18
  60. package/dist/esm5/index-5377e4d7.js.map +1 -0
  61. package/dist/esm5/index.js +1 -1
  62. package/dist/esm5/internal.js +2 -2
  63. package/dist/esm5/src/api/account_management/account.d.ts +2 -0
  64. package/dist/esm5/src/api/account_management/passkey.d.ts +83 -0
  65. package/dist/esm5/src/api/account_management/passkey.test.d.ts +17 -0
  66. package/dist/esm5/src/api/index.d.ts +5 -1
  67. package/dist/esm5/src/core/index.d.ts +1 -0
  68. package/dist/esm5/src/core/strategies/email.d.ts +3 -5
  69. package/dist/esm5/src/core/strategies/email_and_password.d.ts +4 -6
  70. package/dist/esm5/src/core/strategies/passkey.d.ts +41 -0
  71. package/dist/esm5/src/core/strategies/passkey.test.d.ts +17 -0
  72. package/dist/esm5/src/core/user/account_info.d.ts +1 -3
  73. package/dist/esm5/src/core/user/user_impl.d.ts +2 -1
  74. package/dist/esm5/src/model/enums.d.ts +6 -2
  75. package/dist/esm5/src/model/public_types.d.ts +18 -1
  76. package/dist/esm5/src/model/user.d.ts +3 -0
  77. package/dist/index.webworker.esm5.js +330 -17
  78. package/dist/index.webworker.esm5.js.map +1 -1
  79. package/dist/node/index.js +4 -1
  80. package/dist/node/index.js.map +1 -1
  81. package/dist/node/internal.js +4 -1
  82. package/dist/node/internal.js.map +1 -1
  83. package/dist/node/src/api/account_management/account.d.ts +2 -0
  84. package/dist/node/src/api/account_management/passkey.d.ts +83 -0
  85. package/dist/node/src/api/account_management/passkey.test.d.ts +17 -0
  86. package/dist/node/src/api/index.d.ts +5 -1
  87. package/dist/node/src/core/index.d.ts +1 -0
  88. package/dist/node/src/core/strategies/email.d.ts +3 -5
  89. package/dist/node/src/core/strategies/email_and_password.d.ts +4 -6
  90. package/dist/node/src/core/strategies/passkey.d.ts +41 -0
  91. package/dist/node/src/core/strategies/passkey.test.d.ts +17 -0
  92. package/dist/node/src/core/user/account_info.d.ts +1 -3
  93. package/dist/node/src/core/user/user_impl.d.ts +2 -1
  94. package/dist/node/src/model/enums.d.ts +6 -2
  95. package/dist/node/src/model/public_types.d.ts +18 -1
  96. package/dist/node/src/model/user.d.ts +3 -0
  97. package/dist/node/{totp-38aba8fd.js → totp-e59979fc.js} +333 -17
  98. package/dist/node/totp-e59979fc.js.map +1 -0
  99. package/dist/node-esm/index.js +1 -1
  100. package/dist/node-esm/internal.js +2 -2
  101. package/dist/node-esm/src/api/account_management/account.d.ts +2 -0
  102. package/dist/node-esm/src/api/account_management/passkey.d.ts +83 -0
  103. package/dist/node-esm/src/api/account_management/passkey.test.d.ts +17 -0
  104. package/dist/node-esm/src/api/index.d.ts +5 -1
  105. package/dist/node-esm/src/core/index.d.ts +1 -0
  106. package/dist/node-esm/src/core/strategies/email.d.ts +3 -5
  107. package/dist/node-esm/src/core/strategies/email_and_password.d.ts +4 -6
  108. package/dist/node-esm/src/core/strategies/passkey.d.ts +41 -0
  109. package/dist/node-esm/src/core/strategies/passkey.test.d.ts +17 -0
  110. package/dist/node-esm/src/core/user/account_info.d.ts +1 -3
  111. package/dist/node-esm/src/core/user/user_impl.d.ts +2 -1
  112. package/dist/node-esm/src/model/enums.d.ts +6 -2
  113. package/dist/node-esm/src/model/public_types.d.ts +18 -1
  114. package/dist/node-esm/src/model/user.d.ts +3 -0
  115. package/dist/node-esm/{totp-e448e7fe.js → totp-86acc588.js} +259 -18
  116. package/dist/node-esm/totp-86acc588.js.map +1 -0
  117. package/dist/rn/{index-985afdb4.js → index-551e6aca.js} +333 -17
  118. package/dist/rn/index-551e6aca.js.map +1 -0
  119. package/dist/rn/index.js +4 -1
  120. package/dist/rn/index.js.map +1 -1
  121. package/dist/rn/internal.js +4 -1
  122. package/dist/rn/internal.js.map +1 -1
  123. package/dist/rn/src/api/account_management/account.d.ts +2 -0
  124. package/dist/rn/src/api/account_management/passkey.d.ts +83 -0
  125. package/dist/rn/src/api/account_management/passkey.test.d.ts +17 -0
  126. package/dist/rn/src/api/index.d.ts +5 -1
  127. package/dist/rn/src/core/index.d.ts +1 -0
  128. package/dist/rn/src/core/strategies/email.d.ts +3 -5
  129. package/dist/rn/src/core/strategies/email_and_password.d.ts +4 -6
  130. package/dist/rn/src/core/strategies/passkey.d.ts +41 -0
  131. package/dist/rn/src/core/strategies/passkey.test.d.ts +17 -0
  132. package/dist/rn/src/core/user/account_info.d.ts +1 -3
  133. package/dist/rn/src/core/user/user_impl.d.ts +2 -1
  134. package/dist/rn/src/model/enums.d.ts +6 -2
  135. package/dist/rn/src/model/public_types.d.ts +18 -1
  136. package/dist/rn/src/model/user.d.ts +3 -0
  137. package/dist/src/api/account_management/account.d.ts +2 -0
  138. package/dist/src/api/account_management/passkey.d.ts +83 -0
  139. package/dist/src/api/account_management/passkey.test.d.ts +17 -0
  140. package/dist/src/api/index.d.ts +5 -1
  141. package/dist/src/core/index.d.ts +1 -0
  142. package/dist/src/core/strategies/email.d.ts +3 -5
  143. package/dist/src/core/strategies/email_and_password.d.ts +4 -6
  144. package/dist/src/core/strategies/passkey.d.ts +41 -0
  145. package/dist/src/core/strategies/passkey.test.d.ts +17 -0
  146. package/dist/src/core/user/account_info.d.ts +1 -3
  147. package/dist/src/core/user/user_impl.d.ts +2 -1
  148. package/dist/src/model/enums.d.ts +6 -2
  149. package/dist/src/model/public_types.d.ts +18 -1
  150. package/dist/src/model/user.d.ts +3 -0
  151. package/dist/web-extension-cjs/index.js +4 -1
  152. package/dist/web-extension-cjs/index.js.map +1 -1
  153. package/dist/web-extension-cjs/internal.js +4 -1
  154. package/dist/web-extension-cjs/internal.js.map +1 -1
  155. package/dist/web-extension-cjs/{register-e3ac7adf.js → register-84d046a5.js} +261 -17
  156. package/dist/web-extension-cjs/register-84d046a5.js.map +1 -0
  157. package/dist/web-extension-cjs/src/api/account_management/account.d.ts +2 -0
  158. package/dist/web-extension-cjs/src/api/account_management/passkey.d.ts +83 -0
  159. package/dist/web-extension-cjs/src/api/account_management/passkey.test.d.ts +17 -0
  160. package/dist/web-extension-cjs/src/api/index.d.ts +5 -1
  161. package/dist/web-extension-cjs/src/core/index.d.ts +1 -0
  162. package/dist/web-extension-cjs/src/core/strategies/email.d.ts +3 -5
  163. package/dist/web-extension-cjs/src/core/strategies/email_and_password.d.ts +4 -6
  164. package/dist/web-extension-cjs/src/core/strategies/passkey.d.ts +41 -0
  165. package/dist/web-extension-cjs/src/core/strategies/passkey.test.d.ts +17 -0
  166. package/dist/web-extension-cjs/src/core/user/account_info.d.ts +1 -3
  167. package/dist/web-extension-cjs/src/core/user/user_impl.d.ts +2 -1
  168. package/dist/web-extension-cjs/src/model/enums.d.ts +6 -2
  169. package/dist/web-extension-cjs/src/model/public_types.d.ts +18 -1
  170. package/dist/web-extension-cjs/src/model/user.d.ts +3 -0
  171. package/dist/web-extension-esm2017/index.js +2 -2
  172. package/dist/web-extension-esm2017/internal.js +2 -2
  173. package/dist/web-extension-esm2017/{register-ffa8f4d2.js → register-49f5fb7d.js} +259 -18
  174. package/dist/web-extension-esm2017/register-49f5fb7d.js.map +1 -0
  175. package/dist/web-extension-esm2017/src/api/account_management/account.d.ts +2 -0
  176. package/dist/web-extension-esm2017/src/api/account_management/passkey.d.ts +83 -0
  177. package/dist/web-extension-esm2017/src/api/account_management/passkey.test.d.ts +17 -0
  178. package/dist/web-extension-esm2017/src/api/index.d.ts +5 -1
  179. package/dist/web-extension-esm2017/src/core/index.d.ts +1 -0
  180. package/dist/web-extension-esm2017/src/core/strategies/email.d.ts +3 -5
  181. package/dist/web-extension-esm2017/src/core/strategies/email_and_password.d.ts +4 -6
  182. package/dist/web-extension-esm2017/src/core/strategies/passkey.d.ts +41 -0
  183. package/dist/web-extension-esm2017/src/core/strategies/passkey.test.d.ts +17 -0
  184. package/dist/web-extension-esm2017/src/core/user/account_info.d.ts +1 -3
  185. package/dist/web-extension-esm2017/src/core/user/user_impl.d.ts +2 -1
  186. package/dist/web-extension-esm2017/src/model/enums.d.ts +6 -2
  187. package/dist/web-extension-esm2017/src/model/public_types.d.ts +18 -1
  188. package/dist/web-extension-esm2017/src/model/user.d.ts +3 -0
  189. package/package.json +6 -6
  190. package/dist/browser-cjs/index-b554a82d.js.map +0 -1
  191. package/dist/cordova/popup_redirect-89a4178c.js.map +0 -1
  192. package/dist/esm2017/index-456eaf5d.js.map +0 -1
  193. package/dist/esm5/index-7c43a070.js.map +0 -1
  194. package/dist/node/totp-38aba8fd.js.map +0 -1
  195. package/dist/node-esm/totp-e448e7fe.js.map +0 -1
  196. package/dist/rn/index-985afdb4.js.map +0 -1
  197. package/dist/web-extension-cjs/register-e3ac7adf.js.map +0 -1
  198. package/dist/web-extension-esm2017/package.json +0 -1
  199. package/dist/web-extension-esm2017/register-ffa8f4d2.js.map +0 -1
@@ -237,6 +237,7 @@ declare interface APIUserInfo {
237
237
  passwordHash?: string;
238
238
  providerUserInfo?: ProviderUserInfo[];
239
239
  mfaInfo?: MfaEnrollment[];
240
+ passkeyInfo?: PasskeyInfo_2[];
240
241
  }
241
242
 
242
243
  /**
@@ -1102,6 +1103,15 @@ declare const enum EnforcementState {
1102
1103
  OFF = "OFF",
1103
1104
  ENFORCEMENT_STATE_UNSPECIFIED = "ENFORCEMENT_STATE_UNSPECIFIED"
1104
1105
  }
1106
+
1107
+ /**
1108
+ * Enrolls a passkey for the user account.
1109
+ * @param user - The user to enroll the passkey for.
1110
+ * @param name - The name associated with the passkey.
1111
+ * @returns A promise that resolves with a `UserCredential` object.
1112
+ * @public
1113
+ */
1114
+ export declare function enrollPasskey(user: User, name: string): Promise<UserCredential>;
1105
1115
  export { ErrorFn }
1106
1116
 
1107
1117
  /* Excluded from this release type: EventManager */
@@ -1233,9 +1243,8 @@ declare abstract class FederatedAuthProvider implements AuthProvider {
1233
1243
 
1234
1244
  /**
1235
1245
  * Gets the list of possible sign in methods for the given email address. This method returns an
1236
- * empty list when
1237
- * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}
1238
- * is enabled, irrespective of the number of authentication methods available for the given email.
1246
+ * empty list when [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled, irrespective of the number of
1247
+ * authentication methods available for the given email.
1239
1248
  *
1240
1249
  * @remarks
1241
1250
  * This is useful to differentiate methods of sign-in for the same provider, eg.
@@ -1247,8 +1256,7 @@ declare abstract class FederatedAuthProvider implements AuthProvider {
1247
1256
  * @param email - The user's email address.
1248
1257
  *
1249
1258
  * Deprecated. Migrating off of this method is recommended as a security best-practice.
1250
- * Learn more in the Identity Platform documentation for
1251
- * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}.
1259
+ * Learn more in the Identity Platform documentation for [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection).
1252
1260
  * @public
1253
1261
  */
1254
1262
  export declare function fetchSignInMethodsForEmail(auth: Auth, email: string): Promise<string[]>;
@@ -2277,6 +2285,25 @@ export declare interface ParsedToken {
2277
2285
  [key: string]: unknown;
2278
2286
  }
2279
2287
 
2288
+ /**
2289
+ * Represents information about a passkey.
2290
+ */
2291
+ export declare interface PasskeyInfo {
2292
+ /**
2293
+ * The credential ID of the passkey.
2294
+ */
2295
+ readonly credentialId: string;
2296
+ /**
2297
+ * The name associated with the passkey.
2298
+ */
2299
+ readonly name?: string;
2300
+ }
2301
+
2302
+ declare interface PasskeyInfo_2 {
2303
+ credentialId: string;
2304
+ name?: string;
2305
+ }
2306
+
2280
2307
  /**
2281
2308
  * A structure specifying password policy requirements.
2282
2309
  *
@@ -2871,7 +2898,7 @@ declare interface RecaptchaEnforcementProviderState {
2871
2898
  /**
2872
2899
  * Interface representing reCAPTCHA parameters.
2873
2900
  *
2874
- * See the {@link https://developers.google.com/recaptcha/docs/display#render_param | reCAPTCHA docs}
2901
+ * See the [reCAPTCHA docs](https://developers.google.com/recaptcha/docs/display#render_param)
2875
2902
  * for the list of accepted parameters. All parameters are accepted except for `sitekey`: Firebase Auth
2876
2903
  * provisions a reCAPTCHA for each project and will configure the site key upon rendering.
2877
2904
  *
@@ -3051,8 +3078,7 @@ export declare function sendEmailVerification(user: User, actionCodeSettings?: A
3051
3078
  /**
3052
3079
  * Sends a password reset email to the given email address. This method does not throw an error when
3053
3080
  * there's no user account with the given email address and
3054
- * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}
3055
- * is enabled.
3081
+ * [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled.
3056
3082
  *
3057
3083
  * @remarks
3058
3084
  * To complete the password reset, call {@link confirmPasswordReset} with the code supplied in
@@ -3230,10 +3256,9 @@ export declare function signInWithCustomToken(auth: Auth, customToken: string):
3230
3256
  * Asynchronously signs in using an email and password.
3231
3257
  *
3232
3258
  * @remarks
3233
- * Fails with an error if the email address and password do not match. When
3234
- * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}
3235
- * is enabled, this method fails with "auth/invalid-credential" in case of an invalid
3236
- * email/password.
3259
+ * Fails with an error if the email address and password do not match.
3260
+ * When [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled,
3261
+ * this method fails with "auth/invalid-credential" in case of an invalid email/password.
3237
3262
  *
3238
3263
  * This method is not supported on {@link Auth} instances created with a
3239
3264
  * {@link @firebase/app#FirebaseServerApp}.
@@ -3296,6 +3321,15 @@ export declare function signInWithEmailLink(auth: Auth, email: string, emailLink
3296
3321
 
3297
3322
  /* Excluded from this release type: SignInWithIdpResponse */
3298
3323
 
3324
+ /**
3325
+ * Signs in a user with a passkey. Use enrollPasskey to enroll a passkey credential for the current user.
3326
+ * @param auth - The Firebase Auth instance.
3327
+ * @param name - The user's name for passkey.
3328
+ * @param manualSignUp - When false, automatically creates an anonymous user if a passkey credential does not exist. Defaults to false.
3329
+ * @returns A promise that resolves with a `UserCredential` object.
3330
+ */
3331
+ export declare function signInWithPasskey(auth: Auth, name: string, manualSignUp?: boolean): Promise<UserCredential>;
3332
+
3299
3333
  /**
3300
3334
  * Asynchronously signs in using a phone number.
3301
3335
  *
@@ -3628,6 +3662,15 @@ export declare class TwitterAuthProvider extends BaseOAuthProvider {
3628
3662
  private static credentialFromTaggedObject;
3629
3663
  }
3630
3664
 
3665
+ /**
3666
+ * Unenrolls the passkey corresponding to the specified credentialId.
3667
+ * @param user - The user to unenroll the passkey for.
3668
+ * @param credentialId - The ID of the passkey to unenroll.
3669
+ * @returns A promise that resolves when the passkey is successfully unenrolled.
3670
+ * @public
3671
+ */
3672
+ export declare function unenrollPasskey(user: User, credentialId: string): Promise<void>;
3673
+
3631
3674
  /**
3632
3675
  * Unlinks a provider from a user account.
3633
3676
  *
@@ -3679,9 +3722,7 @@ export declare function updateCurrentUser(auth: Auth, user: User | null): Promis
3679
3722
  * @param user - The user.
3680
3723
  * @param newEmail - The new email address.
3681
3724
  *
3682
- * Throws "auth/operation-not-allowed" error when
3683
- * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}
3684
- * is enabled.
3725
+ * Throws "auth/operation-not-allowed" error when [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled.
3685
3726
  * Deprecated - Use {@link verifyBeforeUpdateEmail} instead.
3686
3727
  *
3687
3728
  * @public
@@ -3773,6 +3814,10 @@ export declare interface User extends UserInfo {
3773
3814
  * Additional per provider such as displayName and profile information.
3774
3815
  */
3775
3816
  readonly providerData: UserInfo[];
3817
+ /**
3818
+ * An array of PasskeyInfo objects representing the passkeys that the user has enrolled.
3819
+ */
3820
+ readonly enrolledPasskeys: PasskeyInfo[];
3776
3821
  /**
3777
3822
  * Refresh token used to reauthenticate the user. Avoid using this directly and prefer
3778
3823
  * {@link User.getIdToken} to refresh the ID token instead.
package/dist/auth.d.ts CHANGED
@@ -243,6 +243,7 @@ declare interface APIUserInfo {
243
243
  passwordHash?: string;
244
244
  providerUserInfo?: ProviderUserInfo[];
245
245
  mfaInfo?: MfaEnrollment[];
246
+ passkeyInfo?: PasskeyInfo_2[];
246
247
  }
247
248
 
248
249
  /**
@@ -1384,6 +1385,15 @@ declare const enum EnforcementState {
1384
1385
  OFF = "OFF",
1385
1386
  ENFORCEMENT_STATE_UNSPECIFIED = "ENFORCEMENT_STATE_UNSPECIFIED"
1386
1387
  }
1388
+
1389
+ /**
1390
+ * Enrolls a passkey for the user account.
1391
+ * @param user - The user to enroll the passkey for.
1392
+ * @param name - The name associated with the passkey.
1393
+ * @returns A promise that resolves with a `UserCredential` object.
1394
+ * @public
1395
+ */
1396
+ export declare function enrollPasskey(user: User, name: string): Promise<UserCredential>;
1387
1397
  export { ErrorFn }
1388
1398
 
1389
1399
  /**
@@ -1523,9 +1533,8 @@ declare abstract class FederatedAuthProvider implements AuthProvider {
1523
1533
 
1524
1534
  /**
1525
1535
  * Gets the list of possible sign in methods for the given email address. This method returns an
1526
- * empty list when
1527
- * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}
1528
- * is enabled, irrespective of the number of authentication methods available for the given email.
1536
+ * empty list when [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled, irrespective of the number of
1537
+ * authentication methods available for the given email.
1529
1538
  *
1530
1539
  * @remarks
1531
1540
  * This is useful to differentiate methods of sign-in for the same provider, eg.
@@ -1537,8 +1546,7 @@ declare abstract class FederatedAuthProvider implements AuthProvider {
1537
1546
  * @param email - The user's email address.
1538
1547
  *
1539
1548
  * Deprecated. Migrating off of this method is recommended as a security best-practice.
1540
- * Learn more in the Identity Platform documentation for
1541
- * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}.
1549
+ * Learn more in the Identity Platform documentation for [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection).
1542
1550
  * @public
1543
1551
  */
1544
1552
  export declare function fetchSignInMethodsForEmail(auth: Auth, email: string): Promise<string[]>;
@@ -2624,6 +2632,25 @@ export declare interface ParsedToken {
2624
2632
  [key: string]: unknown;
2625
2633
  }
2626
2634
 
2635
+ /**
2636
+ * Represents information about a passkey.
2637
+ */
2638
+ export declare interface PasskeyInfo {
2639
+ /**
2640
+ * The credential ID of the passkey.
2641
+ */
2642
+ readonly credentialId: string;
2643
+ /**
2644
+ * The name associated with the passkey.
2645
+ */
2646
+ readonly name?: string;
2647
+ }
2648
+
2649
+ declare interface PasskeyInfo_2 {
2650
+ credentialId: string;
2651
+ name?: string;
2652
+ }
2653
+
2627
2654
  /**
2628
2655
  * A structure specifying password policy requirements.
2629
2656
  *
@@ -3150,7 +3177,9 @@ declare const enum ProviderId_2 {
3150
3177
  /** Phone provider */
3151
3178
  PHONE = "phone",
3152
3179
  /** Twitter provider ID */
3153
- TWITTER = "twitter.com"
3180
+ TWITTER = "twitter.com",
3181
+ /** Passkey provider */
3182
+ PASSKEY = "passkey"
3154
3183
  }
3155
3184
 
3156
3185
  declare interface ProviderUserInfo {
@@ -3343,7 +3372,7 @@ declare interface ReCaptchaLoader {
3343
3372
  /**
3344
3373
  * Interface representing reCAPTCHA parameters.
3345
3374
  *
3346
- * See the {@link https://developers.google.com/recaptcha/docs/display#render_param | reCAPTCHA docs}
3375
+ * See the [reCAPTCHA docs](https://developers.google.com/recaptcha/docs/display#render_param)
3347
3376
  * for the list of accepted parameters. All parameters are accepted except for `sitekey`: Firebase Auth
3348
3377
  * provisions a reCAPTCHA for each project and will configure the site key upon rendering.
3349
3378
  *
@@ -3525,8 +3554,7 @@ export declare function sendEmailVerification(user: User, actionCodeSettings?: A
3525
3554
  /**
3526
3555
  * Sends a password reset email to the given email address. This method does not throw an error when
3527
3556
  * there's no user account with the given email address and
3528
- * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}
3529
- * is enabled.
3557
+ * [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled.
3530
3558
  *
3531
3559
  * @remarks
3532
3560
  * To complete the password reset, call {@link confirmPasswordReset} with the code supplied in
@@ -3704,10 +3732,9 @@ export declare function signInWithCustomToken(auth: Auth, customToken: string):
3704
3732
  * Asynchronously signs in using an email and password.
3705
3733
  *
3706
3734
  * @remarks
3707
- * Fails with an error if the email address and password do not match. When
3708
- * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}
3709
- * is enabled, this method fails with "auth/invalid-credential" in case of an invalid
3710
- * email/password.
3735
+ * Fails with an error if the email address and password do not match.
3736
+ * When [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled,
3737
+ * this method fails with "auth/invalid-credential" in case of an invalid email/password.
3711
3738
  *
3712
3739
  * This method is not supported on {@link Auth} instances created with a
3713
3740
  * {@link @firebase/app#FirebaseServerApp}.
@@ -3779,6 +3806,15 @@ declare interface SignInWithIdpResponse extends IdTokenResponse {
3779
3806
  pendingToken?: string;
3780
3807
  }
3781
3808
 
3809
+ /**
3810
+ * Signs in a user with a passkey. Use enrollPasskey to enroll a passkey credential for the current user.
3811
+ * @param auth - The Firebase Auth instance.
3812
+ * @param name - The user's name for passkey.
3813
+ * @param manualSignUp - When false, automatically creates an anonymous user if a passkey credential does not exist. Defaults to false.
3814
+ * @returns A promise that resolves with a `UserCredential` object.
3815
+ */
3816
+ export declare function signInWithPasskey(auth: Auth, name: string, manualSignUp?: boolean): Promise<UserCredential>;
3817
+
3782
3818
  /**
3783
3819
  * Asynchronously signs in using a phone number.
3784
3820
  *
@@ -4155,6 +4191,15 @@ export declare class TwitterAuthProvider extends BaseOAuthProvider {
4155
4191
  private static credentialFromTaggedObject;
4156
4192
  }
4157
4193
 
4194
+ /**
4195
+ * Unenrolls the passkey corresponding to the specified credentialId.
4196
+ * @param user - The user to unenroll the passkey for.
4197
+ * @param credentialId - The ID of the passkey to unenroll.
4198
+ * @returns A promise that resolves when the passkey is successfully unenrolled.
4199
+ * @public
4200
+ */
4201
+ export declare function unenrollPasskey(user: User, credentialId: string): Promise<void>;
4202
+
4158
4203
  /**
4159
4204
  * Unlinks a provider from a user account.
4160
4205
  *
@@ -4206,9 +4251,7 @@ export declare function updateCurrentUser(auth: Auth, user: User | null): Promis
4206
4251
  * @param user - The user.
4207
4252
  * @param newEmail - The new email address.
4208
4253
  *
4209
- * Throws "auth/operation-not-allowed" error when
4210
- * {@link https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection | Email Enumeration Protection}
4211
- * is enabled.
4254
+ * Throws "auth/operation-not-allowed" error when [Email Enumeration Protection](https://cloud.google.com/identity-platform/docs/admin/email-enumeration-protection) is enabled.
4212
4255
  * Deprecated - Use {@link verifyBeforeUpdateEmail} instead.
4213
4256
  *
4214
4257
  * @public
@@ -4300,6 +4343,10 @@ export declare interface User extends UserInfo {
4300
4343
  * Additional per provider such as displayName and profile information.
4301
4344
  */
4302
4345
  readonly providerData: UserInfo[];
4346
+ /**
4347
+ * An array of PasskeyInfo objects representing the passkeys that the user has enrolled.
4348
+ */
4349
+ readonly enrolledPasskeys: PasskeyInfo[];
4303
4350
  /**
4304
4351
  * Refresh token used to reauthenticate the user. Avoid using this directly and prefer
4305
4352
  * {@link User.getIdToken} to refresh the ID token instead.
@@ -4454,6 +4501,7 @@ declare interface UserInternal extends User {
4454
4501
  tenantId: string | null;
4455
4502
  providerData: MutableUserInfo[];
4456
4503
  metadata: UserMetadata_2;
4504
+ enrolledPasskeys: PasskeyInfo_2[];
4457
4505
  stsTokenManager: StsTokenManager;
4458
4506
  _redirectEventId?: string;
4459
4507
  _updateTokensIfNecessary(response: IdTokenResponse | FinalizeMfaResponse, reload?: boolean): Promise<void>;