@clerk/expo 4.8.0-snapshot.v20260930211104 → 4.8.0

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 (28) hide show
  1. package/biometrics/package.json +4 -0
  2. package/dist/biometric-credentials/createBiometricCredentials.d.ts.map +1 -1
  3. package/dist/biometric-credentials/createBiometricCredentials.js +36 -51
  4. package/dist/biometric-credentials/createBiometricCredentials.js.map +1 -1
  5. package/dist/biometric-credentials/deprecatedRootExport.d.ts +6 -0
  6. package/dist/biometric-credentials/deprecatedRootExport.d.ts.map +1 -0
  7. package/dist/biometric-credentials/deprecatedRootExport.js +16 -0
  8. package/dist/biometric-credentials/deprecatedRootExport.js.map +1 -0
  9. package/dist/biometric-credentials/loadExpoBiometrics.d.ts +2 -7
  10. package/dist/biometric-credentials/loadExpoBiometrics.d.ts.map +1 -1
  11. package/dist/biometric-credentials/loadExpoBiometrics.js.map +1 -1
  12. package/dist/biometric-credentials/types.d.ts +2 -2
  13. package/dist/biometric-credentials/types.d.ts.map +1 -1
  14. package/dist/biometric-credentials/useBiometricCredentials.d.ts +2 -1
  15. package/dist/biometric-credentials/useBiometricCredentials.d.ts.map +1 -1
  16. package/dist/biometric-credentials/useBiometricCredentials.js +2 -1
  17. package/dist/biometric-credentials/useBiometricCredentials.js.map +1 -1
  18. package/dist/biometrics/index.d.ts +2 -0
  19. package/dist/biometrics/index.d.ts.map +1 -0
  20. package/dist/biometrics/index.js +9 -0
  21. package/dist/index.d.ts +3 -1
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +18 -3
  24. package/dist/index.js.map +1 -1
  25. package/dist/provider/ClerkProvider.js +1 -1
  26. package/dist/trusted-devices/useTrustedDevices.js +1 -1
  27. package/dist/trusted-devices/useTrustedDevices.shared.js +1 -1
  28. package/package.json +15 -10
@@ -0,0 +1,4 @@
1
+ {
2
+ "main": "../dist/biometrics/index.js",
3
+ "types": "../dist/biometrics/index.d.ts"
4
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"createBiometricCredentials.d.ts","sourceRoot":"","sources":["../../src/biometric-credentials/createBiometricCredentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAkB7C,OAAO,KAAK,EAMV,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AAEjB,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AA2LzC,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,KAAK,GAAG,6BAA6B,CAwctF"}
1
+ {"version":3,"file":"createBiometricCredentials.d.ts","sourceRoot":"","sources":["../../src/biometric-credentials/createBiometricCredentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAmB7C,OAAO,KAAK,EAMV,6BAA6B,EAC9B,MAAM,SAAS,CAAC;AAEjB,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAuLzC,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,KAAK,GAAG,6BAA6B,CAyctF"}
@@ -6,6 +6,11 @@ let src_biometric_credentials_loadExpoBiometrics = require("./loadExpoBiometrics
6
6
 
7
7
  //#region src/biometric-credentials/createBiometricCredentials.ts
8
8
  const DEFAULT_POLICY = "biometry_current_set";
9
+ const POLICIES = new Set([
10
+ "biometry_current_set",
11
+ "biometry_any",
12
+ "biometry_or_device_passcode"
13
+ ]);
9
14
  const DEFAULT_ENROLLMENT_REASON = "Use biometrics to enroll this device.";
10
15
  const DEFAULT_SIGN_IN_REASON = "Use biometrics to sign in.";
11
16
  const DEFAULT_REVERIFICATION_REASON = "Use biometrics to verify your identity.";
@@ -30,8 +35,7 @@ const MODULE_ERROR_CODES = {
30
35
  key_not_found: "key_not_found",
31
36
  key_invalidated: "key_invalidated",
32
37
  key_generation_failed: "key_generation_failed",
33
- signing_failed: "signing_failed",
34
- not_implemented: "unsupported_platform"
38
+ signing_failed: "signing_failed"
35
39
  };
36
40
  function biometricCredentialError(code, message, cause) {
37
41
  return Object.assign(new Error(message), { code }, cause === void 0 ? {} : { cause });
@@ -73,11 +77,8 @@ function normalizeIdentifierHint(identifierHint) {
73
77
  async function identifierHintMatcher(biometrics, identifierHint) {
74
78
  const normalizedHint = normalizeIdentifierHint(identifierHint);
75
79
  if (!normalizedHint) return () => true;
76
- const hash = typeof biometrics.module.hashIdentifierHint === "function" ? await callModule(biometrics, (module) => module.hashIdentifierHint?.(normalizedHint) ?? null) : null;
77
- return (record) => {
78
- if (hash && typeof record.identifierHintSha256 === "string") return record.identifierHintSha256 === hash;
79
- return normalizeIdentifierHint(record.identifierHint) === normalizedHint;
80
- };
80
+ const hash = await callModule(biometrics, (module) => module.hashIdentifierHint(normalizedHint));
81
+ return (record) => record.identifierHintSha256 === hash;
81
82
  }
82
83
  function newestFirst(a, b) {
83
84
  if (a.createdAt !== b.createdAt) return b.createdAt - a.createdAt;
@@ -144,24 +145,29 @@ function createBiometricCredentials(clerk) {
144
145
  await operation();
145
146
  } catch {}
146
147
  }
147
- async function hasKey(biometrics, record) {
148
+ async function forgetLocalCredentialIfMissing(biometrics, record, error) {
149
+ if (isMissingCredentialError(error)) await ignoreErrors(() => deleteLocalCredential(biometrics, record));
150
+ return toApiBiometricCredentialError(error, biometrics.fallbackCode);
151
+ }
152
+ async function signChallenge(biometrics, record, clientData, reason) {
148
153
  try {
149
- return await biometrics.module.hasKey(record.localKeyId);
154
+ return await biometrics.module.sign(record.localKeyId, clientData, reason);
150
155
  } catch (error) {
151
- if (moduleErrorCode(error) === "key_not_found") return false;
152
- throw toBiometricCredentialError(error, biometrics.fallbackCode);
156
+ const biometricError = toBiometricCredentialError(error, biometrics.fallbackCode);
157
+ if (biometricError.code === "key_invalidated" || biometricError.code === "key_not_found") await ignoreErrors(() => deleteLocalCredential(biometrics, record));
158
+ throw biometricError;
153
159
  }
154
160
  }
155
161
  async function localCredentialCandidates(biometrics, id, identifierHint) {
156
162
  const unavailableReason = featureUnavailableReason();
157
163
  if (unavailableReason) return unavailableReason;
158
164
  const device = await callModule(biometrics, (module) => module.getAvailability());
159
- if (device.secureKeyStorageAvailable === false) return "biometric_authentication_unavailable";
165
+ if (!device.secureKeyStorageAvailable) return "biometric_authentication_unavailable";
160
166
  const matchesIdentifierHint = await identifierHintMatcher(biometrics, identifierHint);
161
167
  const records = (await callModule(biometrics, (module) => module.listRecords())).filter((record) => record.appIdentifier === biometrics.appIdentifier && (id === void 0 || record.id === id) && matchesIdentifierHint(record)).sort(newestFirst);
162
168
  if (records.length === 0) return "no_local_credential";
163
169
  const recordsWithKeys = [];
164
- for (const record of records) if (await hasKey(biometrics, record)) recordsWithKeys.push(record);
170
+ for (const record of records) if (await callModule(biometrics, (module) => module.hasKey(record.localKeyId))) recordsWithKeys.push(record);
165
171
  else await deleteLocalCredential(biometrics, record);
166
172
  if (recordsWithKeys.length === 0) return "local_key_missing";
167
173
  const supportedRecords = recordsWithKeys.filter((record) => record.policy === "biometry_or_device_passcode" ? device.canEvaluateDeviceOwner : device.canEvaluateBiometrics);
@@ -203,11 +209,12 @@ function createBiometricCredentials(clerk) {
203
209
  if (!record) throw biometricCredentialError("biometric_credential_policy_incompatible", "This biometric credential cannot be used for reverification. Verify your identity using another method.");
204
210
  return record;
205
211
  }
212
+ function usableChallenge(biometrics, record, challenge, flow) {
213
+ if (!challenge || challenge.trustedDeviceId && challenge.trustedDeviceId !== record.id) throw biometricCredentialError(biometrics.fallbackCode, `${flow} did not return a matching challenge.`);
214
+ if (challenge.expiresAt && challenge.expiresAt.getTime() <= Date.now()) throw biometricCredentialError(biometrics.fallbackCode, `${flow} challenge has expired.`);
215
+ return challenge;
216
+ }
206
217
  async function verifySessionFactor(biometrics, session, record, factor, reason) {
207
- const forgetLocalCredentialIfMissing = async (error) => {
208
- if (isMissingCredentialError(error)) await ignoreErrors(() => deleteLocalCredential(biometrics, record));
209
- return toApiBiometricCredentialError(error, biometrics.fallbackCode);
210
- };
211
218
  let prepared;
212
219
  try {
213
220
  const config = {
@@ -216,20 +223,11 @@ function createBiometricCredentials(clerk) {
216
223
  };
217
224
  prepared = factor === "first" ? await session.prepareFirstFactorVerification(config) : await session.prepareSecondFactorVerification(config);
218
225
  } catch (error) {
219
- throw await forgetLocalCredentialIfMissing(error);
226
+ throw await forgetLocalCredentialIfMissing(biometrics, record, error);
220
227
  }
221
228
  const verification = factor === "first" ? prepared.firstFactorVerification : prepared.secondFactorVerification;
222
- const challenge = verification?.strategy === "trusted_device" ? verification.trustedDeviceChallenge : null;
223
- if (!challenge || challenge.trustedDeviceId && challenge.trustedDeviceId !== record.id) throw biometricCredentialError(biometrics.fallbackCode, "Biometric reverification did not return a matching challenge.");
224
- if (challenge.expiresAt && challenge.expiresAt.getTime() <= Date.now()) throw biometricCredentialError(biometrics.fallbackCode, "Biometric reverification challenge has expired.");
225
- let signature;
226
- try {
227
- signature = await biometrics.module.sign(record.localKeyId, challenge.clientData, reason);
228
- } catch (error) {
229
- const biometricError = toBiometricCredentialError(error, biometrics.fallbackCode);
230
- if (biometricError.code === "key_invalidated" || biometricError.code === "key_not_found") await ignoreErrors(() => deleteLocalCredential(biometrics, record));
231
- throw biometricError;
232
- }
229
+ const challenge = usableChallenge(biometrics, record, verification?.strategy === "trusted_device" ? verification.trustedDeviceChallenge : null, "Biometric reverification");
230
+ const signature = await signChallenge(biometrics, record, challenge.clientData, reason);
233
231
  try {
234
232
  const attempt = {
235
233
  strategy: "trusted_device",
@@ -240,7 +238,7 @@ function createBiometricCredentials(clerk) {
240
238
  };
241
239
  return factor === "first" ? await session.attemptFirstFactorVerification(attempt) : await session.attemptSecondFactorVerification(attempt);
242
240
  } catch (error) {
243
- throw await forgetLocalCredentialIfMissing(error);
241
+ throw await forgetLocalCredentialIfMissing(biometrics, record, error);
244
242
  }
245
243
  }
246
244
  return {
@@ -267,6 +265,7 @@ function createBiometricCredentials(clerk) {
267
265
  const unavailableReason = featureUnavailableReason();
268
266
  if (unavailableReason) throw biometricCredentialError(unavailableReason === "environment_unavailable" ? unavailableReason : biometrics.fallbackCode, `Unable to enroll a biometric credential: ${unavailableReason}.`);
269
267
  const policy = params?.policy ?? DEFAULT_POLICY;
268
+ if (!POLICIES.has(policy)) throw biometricCredentialError("invalid_trusted_device_policy", `Invalid biometric-credential policy: ${policy}.`);
270
269
  const key = await callModule(biometrics, (module) => module.createKey(policy));
271
270
  const enrollment = {
272
271
  platform: react_native.Platform.OS === "android" ? "android" : "ios",
@@ -325,10 +324,6 @@ function createBiometricCredentials(clerk) {
325
324
  const selection = await selectLocalCredential(biometrics, params?.id, params?.identifierHint);
326
325
  if (!selection.record) throw biometricCredentialError(biometrics.fallbackCode, `Biometric sign-in is unavailable: ${selection.unavailableReason}.`);
327
326
  const record = selection.record;
328
- const forgetLocalCredentialIfMissing = async (error) => {
329
- if (isMissingCredentialError(error)) await ignoreErrors(() => deleteLocalCredential(biometrics, record));
330
- return toApiBiometricCredentialError(error, biometrics.fallbackCode);
331
- };
332
327
  let signIn;
333
328
  try {
334
329
  signIn = await clientSignIn.create({
@@ -336,18 +331,10 @@ function createBiometricCredentials(clerk) {
336
331
  trustedDeviceId: record.id
337
332
  });
338
333
  } catch (error) {
339
- throw await forgetLocalCredentialIfMissing(error);
340
- }
341
- const challenge = signIn.firstFactorVerification?.trustedDeviceChallenge;
342
- if (!challenge) throw biometricCredentialError(biometrics.fallbackCode, "Biometric sign-in did not return a challenge.");
343
- let signature;
344
- try {
345
- signature = await biometrics.module.sign(record.localKeyId, challenge.clientData, params?.reason ?? DEFAULT_SIGN_IN_REASON);
346
- } catch (error) {
347
- const biometricError = toBiometricCredentialError(error, biometrics.fallbackCode);
348
- if (biometricError.code === "key_invalidated" || biometricError.code === "key_not_found") await ignoreErrors(() => deleteLocalCredential(biometrics, record));
349
- throw biometricError;
334
+ throw await forgetLocalCredentialIfMissing(biometrics, record, error);
350
335
  }
336
+ const challenge = usableChallenge(biometrics, record, signIn.firstFactorVerification?.trustedDeviceChallenge, "Biometric sign-in");
337
+ const signature = await signChallenge(biometrics, record, challenge.clientData, params?.reason ?? DEFAULT_SIGN_IN_REASON);
351
338
  try {
352
339
  signIn = await signIn.attemptFirstFactor({
353
340
  strategy: "trusted_device",
@@ -357,7 +344,7 @@ function createBiometricCredentials(clerk) {
357
344
  algorithm: "ES256"
358
345
  });
359
346
  } catch (error) {
360
- throw await forgetLocalCredentialIfMissing(error);
347
+ throw await forgetLocalCredentialIfMissing(biometrics, record, error);
361
348
  }
362
349
  if (!signIn.status) throw biometricCredentialError(biometrics.fallbackCode, "Biometric sign-in did not return a status.");
363
350
  return {
@@ -376,14 +363,12 @@ function createBiometricCredentials(clerk) {
376
363
  const record = await reverificationCredential(biometrics, session.user.id);
377
364
  const reason = params?.reason ?? DEFAULT_REVERIFICATION_REASON;
378
365
  let verification = await callApi(biometrics.fallbackCode, () => session.startVerification({ level }));
379
- if (verification.status === "needs_first_factor") {
380
- verification = await verifySessionFactor(biometrics, session, record, "first", reason);
381
- if (verification.status === "needs_second_factor") verification = await verifySessionFactor(biometrics, session, record, "second", reason);
382
- } else if (verification.status === "needs_second_factor") verification = await verifySessionFactor(biometrics, session, record, "second", reason);
366
+ if (verification.status === "needs_first_factor") verification = await verifySessionFactor(biometrics, session, record, "first", reason);
367
+ else if (verification.status === "needs_second_factor") verification = await verifySessionFactor(biometrics, session, record, "second", reason);
383
368
  else if (verification.status !== "complete") throw biometricCredentialError(biometrics.fallbackCode, "The server returned an unsupported reverification status.");
384
369
  if (verification.status === "complete") {
385
370
  session.clearCache();
386
- if (!await session.getToken({ skipCache: true })) throw biometricCredentialError(biometrics.fallbackCode, "Unable to refresh the session token after biometric reverification.");
371
+ if (!await callApi(biometrics.fallbackCode, () => session.getToken({ skipCache: true }))) throw biometricCredentialError(biometrics.fallbackCode, "Unable to refresh the session token after biometric reverification.");
387
372
  }
388
373
  return {
389
374
  id: verification.id ?? null,
@@ -1 +1 @@
1
- {"version":3,"file":"createBiometricCredentials.js","names":["errorThrower","Platform"],"sources":["../../src/biometric-credentials/createBiometricCredentials.ts"],"sourcesContent":["import type { useClerk } from '@clerk/react';\nimport { isClerkAPIResponseError } from '@clerk/shared/error';\nimport type {\n BiometricCredentialResource,\n EnvironmentResource,\n PrepareBiometricCredentialParams,\n SessionResource,\n SessionVerificationLevel,\n SessionVerificationResource,\n SignInResource,\n UserResource,\n} from '@clerk/shared/types';\nimport { Platform } from 'react-native';\n\nimport { errorThrower } from '../utils/errors';\nimport type { BiometricCredentialError, BiometricCredentialErrorCode } from './errors';\nimport type { ExpoBiometricsModule, ExpoBiometricsRecord } from './loadExpoBiometrics';\nimport { loadExpoBiometrics } from './loadExpoBiometrics';\nimport type {\n BiometricCredential,\n BiometricCredentialPlatform,\n BiometricCredentialPolicy,\n BiometricCredentialStatus,\n BiometricCredentialUnavailableReason,\n UseBiometricCredentialsReturn,\n} from './types';\n\ntype Clerk = ReturnType<typeof useClerk>;\n\ntype OperationErrorCode =\n | 'E_TRUSTED_DEVICE_AVAILABILITY_FAILED'\n | 'E_TRUSTED_DEVICE_LIST_FAILED'\n | 'E_TRUSTED_DEVICE_ENROLLMENT_FAILED'\n | 'E_TRUSTED_DEVICE_REVOCATION_FAILED'\n | 'E_TRUSTED_DEVICE_SIGN_IN_FAILED'\n | 'E_BIOMETRIC_REVERIFICATION_FAILED';\n\ntype Biometrics = {\n module: ExpoBiometricsModule;\n appIdentifier: string;\n fallbackCode: OperationErrorCode;\n};\n\ntype LocalCredentialSelection =\n | { record: ExpoBiometricsRecord; unavailableReason?: never }\n | { record?: never; unavailableReason: BiometricCredentialUnavailableReason };\n\nconst DEFAULT_POLICY: BiometricCredentialPolicy = 'biometry_current_set';\nconst DEFAULT_ENROLLMENT_REASON = 'Use biometrics to enroll this device.';\nconst DEFAULT_SIGN_IN_REASON = 'Use biometrics to sign in.';\nconst DEFAULT_REVERIFICATION_REASON = 'Use biometrics to verify your identity.';\nconst REVERIFICATION_LEVELS = new Set<SessionVerificationLevel>(['first_factor', 'second_factor', 'multi_factor']);\n\nconst EXPO_BIOMETRICS_INSTALL_INSTRUCTIONS =\n 'Install it with `npx expo install @clerk/expo-biometrics`, then rebuild your development build.';\n\nconst MISSING_CREDENTIAL_ERROR_CODES = new Set(['form_resource_not_found', 'trusted_device_not_registered']);\nconst TRUSTED_DEVICE_ID_PARAM = 'trusted_device_id';\n\nconst MODULE_ERROR_CODES: Record<string, BiometricCredentialErrorCode | undefined> = {\n user_canceled: 'biometric_authentication_canceled',\n system_canceled: 'biometric_authentication_canceled',\n user_fallback: 'biometric_authentication_canceled',\n authentication_failed: 'biometric_authentication_failed',\n biometry_not_available: 'biometric_authentication_unavailable',\n biometry_not_enrolled: 'biometric_authentication_unavailable',\n biometry_lockout: 'biometric_authentication_unavailable',\n passcode_not_set: 'biometric_authentication_unavailable',\n secure_key_storage_unavailable: 'biometric_authentication_unavailable',\n key_not_found: 'key_not_found',\n key_invalidated: 'key_invalidated',\n key_generation_failed: 'key_generation_failed',\n signing_failed: 'signing_failed',\n not_implemented: 'unsupported_platform',\n};\n\nfunction biometricCredentialError(\n code: BiometricCredentialErrorCode,\n message: string,\n cause?: unknown,\n): BiometricCredentialError {\n return Object.assign(new Error(message), { code }, cause === undefined ? {} : { cause });\n}\n\nfunction moduleErrorCode(error: unknown): string | undefined {\n const code = (error as { code?: unknown } | null)?.code;\n return typeof code === 'string' ? code : undefined;\n}\n\nfunction toBiometricCredentialError(error: unknown, fallbackCode: OperationErrorCode): BiometricCredentialError {\n const code = moduleErrorCode(error);\n const message = error instanceof Error ? error.message : String(error);\n return biometricCredentialError((code && MODULE_ERROR_CODES[code]) || fallbackCode, message, error);\n}\n\nasync function callModule<T>(biometrics: Biometrics, operation: (module: ExpoBiometricsModule) => T | Promise<T>) {\n try {\n return await operation(biometrics.module);\n } catch (error) {\n throw toBiometricCredentialError(error, biometrics.fallbackCode);\n }\n}\n\nfunction requireBiometrics(fallbackCode: OperationErrorCode): Biometrics {\n const module = loadExpoBiometrics();\n if (!module) {\n return errorThrower.throw(\n `Biometric credentials require the @clerk/expo-biometrics package. ${EXPO_BIOMETRICS_INSTALL_INSTRUCTIONS}`,\n );\n }\n try {\n return { module, appIdentifier: module.getAppIdentifier(), fallbackCode };\n } catch (error) {\n if (moduleErrorCode(error) === 'native_module_unavailable') {\n return errorThrower.throw(\n `Biometric credentials require a development build that includes @clerk/expo-biometrics, and are not available in Expo Go. ${EXPO_BIOMETRICS_INSTALL_INSTRUCTIONS}`,\n );\n }\n throw toBiometricCredentialError(error, fallbackCode);\n }\n}\n\nfunction normalizeIdentifierHint(identifierHint: string | null | undefined): string | null {\n const normalized = identifierHint?.trim().toLowerCase();\n return normalized ? normalized : null;\n}\n\nasync function identifierHintMatcher(\n biometrics: Biometrics,\n identifierHint: string | undefined,\n): Promise<(record: ExpoBiometricsRecord) => boolean> {\n const normalizedHint = normalizeIdentifierHint(identifierHint);\n if (!normalizedHint) {\n return () => true;\n }\n const hash =\n typeof biometrics.module.hashIdentifierHint === 'function'\n ? await callModule(biometrics, module => module.hashIdentifierHint?.(normalizedHint) ?? null)\n : null;\n return record => {\n if (hash && typeof record.identifierHintSha256 === 'string') {\n return record.identifierHintSha256 === hash;\n }\n return normalizeIdentifierHint(record.identifierHint) === normalizedHint;\n };\n}\n\nfunction newestFirst(a: ExpoBiometricsRecord, b: ExpoBiometricsRecord): number {\n if (a.createdAt !== b.createdAt) {\n return b.createdAt - a.createdAt;\n }\n if (a.updatedAt !== b.updatedAt) {\n return b.updatedAt - a.updatedAt;\n }\n return a.id < b.id ? 1 : a.id > b.id ? -1 : 0;\n}\n\nfunction toBiometricCredentialPlatform(platform: string): BiometricCredentialPlatform {\n return platform === 'ios' || platform === 'android' ? platform : 'unknown';\n}\n\nfunction toBiometricCredentialStatus(status: string): BiometricCredentialStatus {\n return status === 'active' || status === 'revoked' ? status : 'unknown';\n}\n\nfunction toBiometricCredential(credential: BiometricCredentialResource): BiometricCredential {\n return {\n id: credential.id,\n object: 'trusted_device',\n platform: toBiometricCredentialPlatform(credential.platform),\n appIdentifier: credential.appIdentifier,\n name: credential.name ?? null,\n algorithm: credential.algorithm,\n status: toBiometricCredentialStatus(credential.status),\n createdAt: credential.createdAt,\n updatedAt: credential.updatedAt,\n lastUsedAt: credential.lastUsedAt ?? null,\n revokedAt: credential.revokedAt ?? null,\n };\n}\n\nfunction toApiBiometricCredentialError(error: unknown, fallbackCode: OperationErrorCode): unknown {\n if (isClerkAPIResponseError(error)) {\n const apiError = error.errors[0];\n return biometricCredentialError(\n apiError?.code ?? fallbackCode,\n apiError?.longMessage ?? apiError?.message ?? error.message,\n error,\n );\n }\n if (error instanceof Error && typeof (error as { code?: unknown }).code === 'string') {\n return error;\n }\n return biometricCredentialError(fallbackCode, error instanceof Error ? error.message : String(error), error);\n}\n\nasync function callApi<T>(fallbackCode: OperationErrorCode, request: () => Promise<T>): Promise<T> {\n try {\n return await request();\n } catch (error) {\n throw toApiBiometricCredentialError(error, fallbackCode);\n }\n}\n\nfunction isMissingCredentialError(error: unknown): boolean {\n return (\n isClerkAPIResponseError(error) &&\n error.errors.some(\n apiError =>\n MISSING_CREDENTIAL_ERROR_CODES.has(apiError.code) && apiError.meta?.paramName === TRUSTED_DEVICE_ID_PARAM,\n )\n );\n}\n\nexport function createBiometricCredentials(clerk: Clerk): UseBiometricCredentialsReturn {\n function featureUnavailableReason(): BiometricCredentialUnavailableReason | null {\n const environment = (clerk as { __internal_environment?: EnvironmentResource | null }).__internal_environment;\n const nativeSettings = environment?.authConfig?.nativeSettings;\n if (!nativeSettings) {\n return 'environment_unavailable';\n }\n if (!nativeSettings.apiEnabled) {\n return 'native_api_disabled';\n }\n if (!nativeSettings.trustedDeviceSignInEnabled) {\n return 'feature_disabled';\n }\n return null;\n }\n\n function requireUser(fallbackCode: OperationErrorCode): UserResource {\n const user = clerk.user;\n if (!user) {\n throw biometricCredentialError(fallbackCode, 'Biometric credential management requires a signed-in user.');\n }\n return user;\n }\n\n async function deleteLocalCredential(biometrics: Biometrics, record: ExpoBiometricsRecord): Promise<void> {\n await callModule(biometrics, module => module.deleteRecord(record.localKeyId));\n }\n\n async function ignoreErrors(operation: () => Promise<unknown>): Promise<void> {\n try {\n await operation();\n } catch {\n // Cleanup must not mask the error that triggered it.\n }\n }\n\n async function hasKey(biometrics: Biometrics, record: ExpoBiometricsRecord): Promise<boolean> {\n try {\n return await biometrics.module.hasKey(record.localKeyId);\n } catch (error) {\n if (moduleErrorCode(error) === 'key_not_found') {\n return false;\n }\n throw toBiometricCredentialError(error, biometrics.fallbackCode);\n }\n }\n\n async function localCredentialCandidates(\n biometrics: Biometrics,\n id: string | undefined,\n identifierHint: string | undefined,\n ): Promise<ExpoBiometricsRecord[] | BiometricCredentialUnavailableReason> {\n const unavailableReason = featureUnavailableReason();\n if (unavailableReason) {\n return unavailableReason;\n }\n\n const device = await callModule(biometrics, module => module.getAvailability());\n // Older @clerk/expo-biometrics versions do not report secureKeyStorageAvailable.\n if (device.secureKeyStorageAvailable === false) {\n return 'biometric_authentication_unavailable';\n }\n\n const matchesIdentifierHint = await identifierHintMatcher(biometrics, identifierHint);\n const records = (await callModule(biometrics, module => module.listRecords()))\n .filter(\n record =>\n record.appIdentifier === biometrics.appIdentifier &&\n (id === undefined || record.id === id) &&\n matchesIdentifierHint(record),\n )\n .sort(newestFirst);\n if (records.length === 0) {\n return 'no_local_credential';\n }\n\n const recordsWithKeys: ExpoBiometricsRecord[] = [];\n for (const record of records) {\n if (await hasKey(biometrics, record)) {\n recordsWithKeys.push(record);\n } else {\n await deleteLocalCredential(biometrics, record);\n }\n }\n if (recordsWithKeys.length === 0) {\n return 'local_key_missing';\n }\n\n const supportedRecords = recordsWithKeys.filter(record =>\n record.policy === 'biometry_or_device_passcode' ? device.canEvaluateDeviceOwner : device.canEvaluateBiometrics,\n );\n if (supportedRecords.length === 0) {\n return 'biometric_authentication_unavailable';\n }\n return supportedRecords;\n }\n\n async function selectLocalCredential(\n biometrics: Biometrics,\n id: string | undefined,\n identifierHint: string | undefined,\n ): Promise<LocalCredentialSelection> {\n const candidates = await localCredentialCandidates(biometrics, id, identifierHint);\n if (typeof candidates === 'string') {\n return { unavailableReason: candidates };\n }\n\n const session = clerk.session;\n const activeUser = session?.status === 'active' ? session.user : null;\n if (!activeUser?.id) {\n return { record: candidates[0] };\n }\n\n const activeUserRecords = candidates.filter(record => record.userId === activeUser.id);\n if (activeUserRecords.length === 0) {\n return { unavailableReason: 'no_local_credential' };\n }\n\n const serverCredentials = await callApi(biometrics.fallbackCode, () =>\n activeUser.__experimental_getBiometricCredentials(),\n );\n let firstUnavailableReason: BiometricCredentialUnavailableReason | null = null;\n for (const record of activeUserRecords) {\n const serverCredential = serverCredentials.find(credential => credential.id === record.id);\n if (!serverCredential) {\n await deleteLocalCredential(biometrics, record);\n firstUnavailableReason ??= 'server_credential_missing';\n continue;\n }\n if (serverCredential.status !== 'active') {\n await deleteLocalCredential(biometrics, record);\n firstUnavailableReason ??= 'server_credential_revoked';\n continue;\n }\n return { record };\n }\n return { unavailableReason: firstUnavailableReason ?? 'server_credential_missing' };\n }\n\n async function reverificationCredential(biometrics: Biometrics, userId: string): Promise<ExpoBiometricsRecord> {\n const candidates = await localCredentialCandidates(biometrics, undefined, undefined);\n if (typeof candidates === 'string') {\n throw biometricCredentialError(\n biometrics.fallbackCode,\n `Biometric reverification is unavailable: ${candidates}.`,\n );\n }\n const userRecords = candidates.filter(record => record.userId === userId);\n if (userRecords.length === 0) {\n throw biometricCredentialError(\n biometrics.fallbackCode,\n 'Biometric reverification is unavailable: no_local_credential.',\n );\n }\n const record = userRecords.find(candidate => candidate.policy === 'biometry_current_set');\n if (!record) {\n throw biometricCredentialError(\n 'biometric_credential_policy_incompatible',\n 'This biometric credential cannot be used for reverification. Verify your identity using another method.',\n );\n }\n return record;\n }\n\n async function verifySessionFactor(\n biometrics: Biometrics,\n session: SessionResource,\n record: ExpoBiometricsRecord,\n factor: 'first' | 'second',\n reason: string,\n ): Promise<SessionVerificationResource> {\n const forgetLocalCredentialIfMissing = async (error: unknown) => {\n if (isMissingCredentialError(error)) {\n await ignoreErrors(() => deleteLocalCredential(biometrics, record));\n }\n return toApiBiometricCredentialError(error, biometrics.fallbackCode);\n };\n\n let prepared: SessionVerificationResource;\n try {\n const config = { strategy: 'trusted_device', trustedDeviceId: record.id } as const;\n prepared =\n factor === 'first'\n ? await session.prepareFirstFactorVerification(config)\n : await session.prepareSecondFactorVerification(config);\n } catch (error) {\n throw await forgetLocalCredentialIfMissing(error);\n }\n\n const verification = factor === 'first' ? prepared.firstFactorVerification : prepared.secondFactorVerification;\n const challenge = verification?.strategy === 'trusted_device' ? verification.trustedDeviceChallenge : null;\n if (!challenge || (challenge.trustedDeviceId && challenge.trustedDeviceId !== record.id)) {\n throw biometricCredentialError(\n biometrics.fallbackCode,\n 'Biometric reverification did not return a matching challenge.',\n );\n }\n if (challenge.expiresAt && challenge.expiresAt.getTime() <= Date.now()) {\n throw biometricCredentialError(biometrics.fallbackCode, 'Biometric reverification challenge has expired.');\n }\n\n let signature: string;\n try {\n signature = await biometrics.module.sign(record.localKeyId, challenge.clientData, reason);\n } catch (error) {\n const biometricError = toBiometricCredentialError(error, biometrics.fallbackCode);\n if (biometricError.code === 'key_invalidated' || biometricError.code === 'key_not_found') {\n await ignoreErrors(() => deleteLocalCredential(biometrics, record));\n }\n throw biometricError;\n }\n\n try {\n const attempt = {\n strategy: 'trusted_device',\n trustedDeviceId: record.id,\n clientData: challenge.clientData,\n signature,\n algorithm: 'ES256',\n } as const;\n return factor === 'first'\n ? await session.attemptFirstFactorVerification(attempt)\n : await session.attemptSecondFactorVerification(attempt);\n } catch (error) {\n throw await forgetLocalCredentialIfMissing(error);\n }\n }\n\n return {\n getAvailability: async params => {\n const biometrics = requireBiometrics('E_TRUSTED_DEVICE_AVAILABILITY_FAILED');\n const selection = await selectLocalCredential(biometrics, params?.id, params?.identifierHint);\n return selection.record\n ? { isAvailable: true, unavailableReason: null }\n : { isAvailable: false, unavailableReason: selection.unavailableReason };\n },\n\n list: async () => {\n const biometrics = requireBiometrics('E_TRUSTED_DEVICE_LIST_FAILED');\n const user = requireUser(biometrics.fallbackCode);\n const credentials = await callApi(biometrics.fallbackCode, () => user.__experimental_getBiometricCredentials());\n return credentials.map(toBiometricCredential);\n },\n\n enroll: async params => {\n const biometrics = requireBiometrics('E_TRUSTED_DEVICE_ENROLLMENT_FAILED');\n const session = clerk.session;\n if (!session || (session.status !== 'active' && session.status !== 'pending') || !session.user) {\n throw biometricCredentialError(\n biometrics.fallbackCode,\n 'Unable to enroll a biometric credential without an active or pending Clerk session.',\n );\n }\n const user = session.user;\n const unavailableReason = featureUnavailableReason();\n if (unavailableReason) {\n throw biometricCredentialError(\n unavailableReason === 'environment_unavailable' ? unavailableReason : biometrics.fallbackCode,\n `Unable to enroll a biometric credential: ${unavailableReason}.`,\n );\n }\n\n const policy = params?.policy ?? DEFAULT_POLICY;\n const key = await callModule(biometrics, module => module.createKey(policy));\n const enrollment: PrepareBiometricCredentialParams = {\n platform: Platform.OS === 'android' ? 'android' : 'ios',\n appIdentifier: biometrics.appIdentifier,\n algorithm: 'ES256',\n publicKeyJwk: key.publicKeyJwk,\n ...(params?.name === undefined ? {} : { name: params.name }),\n };\n\n let credential: BiometricCredentialResource;\n try {\n const challenge = await callApi(biometrics.fallbackCode, () =>\n user.__experimental_prepareBiometricCredential(enrollment),\n );\n const signature = await callModule(biometrics, module =>\n module.sign(key.localKeyId, challenge.clientData, params?.reason ?? DEFAULT_ENROLLMENT_REASON),\n );\n credential = await callApi(biometrics.fallbackCode, () =>\n user.__experimental_attemptBiometricCredential({\n ...enrollment,\n clientData: challenge.clientData,\n signature,\n }),\n );\n } catch (error) {\n await ignoreErrors(() => biometrics.module.deleteKey(key.localKeyId));\n throw error;\n }\n\n const identifierHint = normalizeIdentifierHint(params?.identifierHint);\n try {\n await callModule(biometrics, module =>\n module.saveRecord(\n {\n id: credential.id,\n localKeyId: key.localKeyId,\n userId: user.id,\n appIdentifier: biometrics.appIdentifier,\n ...(identifierHint ? { identifierHint } : {}),\n policy,\n createdAt: credential.createdAt.getTime(),\n updatedAt: credential.updatedAt.getTime(),\n },\n { removeOtherRecordsForApp: true },\n ),\n );\n } catch (error) {\n await ignoreErrors(() => user.__experimental_revokeBiometricCredential(credential.id));\n await ignoreErrors(() => biometrics.module.deleteKey(key.localKeyId));\n throw error;\n }\n return toBiometricCredential(credential);\n },\n\n revoke: async id => {\n const biometrics = requireBiometrics('E_TRUSTED_DEVICE_REVOCATION_FAILED');\n const user = requireUser(biometrics.fallbackCode);\n const credential = await callApi(biometrics.fallbackCode, () =>\n user.__experimental_revokeBiometricCredential(id),\n );\n await ignoreErrors(async () => {\n const records = await biometrics.module.listRecords();\n const localKeyIds = new Set(records.filter(record => record.id === id).map(record => record.localKeyId));\n for (const localKeyId of localKeyIds) {\n await biometrics.module.deleteRecord(localKeyId);\n }\n });\n return toBiometricCredential(credential);\n },\n\n signIn: async params => {\n const biometrics = requireBiometrics('E_TRUSTED_DEVICE_SIGN_IN_FAILED');\n const clientSignIn = clerk.client?.signIn;\n if (!clientSignIn) {\n throw biometricCredentialError(\n biometrics.fallbackCode,\n 'Biometric sign-in requires a loaded Clerk client: the client sign-in resource is unavailable.',\n );\n }\n\n const selection = await selectLocalCredential(biometrics, params?.id, params?.identifierHint);\n if (!selection.record) {\n throw biometricCredentialError(\n biometrics.fallbackCode,\n `Biometric sign-in is unavailable: ${selection.unavailableReason}.`,\n );\n }\n const record = selection.record;\n\n const forgetLocalCredentialIfMissing = async (error: unknown) => {\n if (isMissingCredentialError(error)) {\n await ignoreErrors(() => deleteLocalCredential(biometrics, record));\n }\n return toApiBiometricCredentialError(error, biometrics.fallbackCode);\n };\n\n let signIn: SignInResource;\n try {\n signIn = await clientSignIn.create({ strategy: 'trusted_device', trustedDeviceId: record.id });\n } catch (error) {\n throw await forgetLocalCredentialIfMissing(error);\n }\n\n const challenge = signIn.firstFactorVerification?.trustedDeviceChallenge;\n if (!challenge) {\n throw biometricCredentialError(biometrics.fallbackCode, 'Biometric sign-in did not return a challenge.');\n }\n\n let signature: string;\n try {\n signature = await biometrics.module.sign(\n record.localKeyId,\n challenge.clientData,\n params?.reason ?? DEFAULT_SIGN_IN_REASON,\n );\n } catch (error) {\n const biometricError = toBiometricCredentialError(error, biometrics.fallbackCode);\n if (biometricError.code === 'key_invalidated' || biometricError.code === 'key_not_found') {\n await ignoreErrors(() => deleteLocalCredential(biometrics, record));\n }\n throw biometricError;\n }\n\n try {\n signIn = await signIn.attemptFirstFactor({\n strategy: 'trusted_device',\n trustedDeviceId: record.id,\n clientData: challenge.clientData,\n signature,\n algorithm: 'ES256',\n });\n } catch (error) {\n throw await forgetLocalCredentialIfMissing(error);\n }\n\n if (!signIn.status) {\n throw biometricCredentialError(biometrics.fallbackCode, 'Biometric sign-in did not return a status.');\n }\n return {\n status: signIn.status,\n createdSessionId: signIn.createdSessionId,\n signIn,\n setActive: clerk.setActive,\n };\n },\n\n reverify: async params => {\n const biometrics = requireBiometrics('E_BIOMETRIC_REVERIFICATION_FAILED');\n const level = params?.level ?? 'first_factor';\n if (!REVERIFICATION_LEVELS.has(level)) {\n throw biometricCredentialError(\n 'invalid_reverification_level',\n 'Biometric reverification level must be first_factor, second_factor, or multi_factor.',\n );\n }\n const session = clerk.session;\n if (!session || (session.status !== 'active' && session.status !== 'pending') || !session.user) {\n throw biometricCredentialError(\n 'biometric_reverification_session_unavailable',\n 'Biometric reverification requires an active or pending session with a user.',\n );\n }\n const record = await reverificationCredential(biometrics, session.user.id);\n const reason = params?.reason ?? DEFAULT_REVERIFICATION_REASON;\n\n let verification = await callApi(biometrics.fallbackCode, () => session.startVerification({ level }));\n if (verification.status === 'needs_first_factor') {\n verification = await verifySessionFactor(biometrics, session, record, 'first', reason);\n if (verification.status === 'needs_second_factor') {\n verification = await verifySessionFactor(biometrics, session, record, 'second', reason);\n }\n } else if (verification.status === 'needs_second_factor') {\n verification = await verifySessionFactor(biometrics, session, record, 'second', reason);\n } else if (verification.status !== 'complete') {\n throw biometricCredentialError(\n biometrics.fallbackCode,\n 'The server returned an unsupported reverification status.',\n );\n }\n\n if (verification.status === 'complete') {\n session.clearCache();\n const token = await session.getToken({ skipCache: true });\n if (!token) {\n throw biometricCredentialError(\n biometrics.fallbackCode,\n 'Unable to refresh the session token after biometric reverification.',\n );\n }\n }\n return { id: verification.id ?? null, status: verification.status, level: verification.level, session };\n },\n };\n}\n"],"mappings":";;;;;;;AA+CA,MAAM,iBAA4C;AAClD,MAAM,4BAA4B;AAClC,MAAM,yBAAyB;AAC/B,MAAM,gCAAgC;AACtC,MAAM,wBAAwB,IAAI,IAA8B;CAAC;CAAgB;CAAiB;AAAc,CAAC;AAEjH,MAAM,uCACJ;AAEF,MAAM,iCAAiC,IAAI,IAAI,CAAC,2BAA2B,+BAA+B,CAAC;AAC3G,MAAM,0BAA0B;AAEhC,MAAM,qBAA+E;CACnF,eAAe;CACf,iBAAiB;CACjB,eAAe;CACf,uBAAuB;CACvB,wBAAwB;CACxB,uBAAuB;CACvB,kBAAkB;CAClB,kBAAkB;CAClB,gCAAgC;CAChC,eAAe;CACf,iBAAiB;CACjB,uBAAuB;CACvB,gBAAgB;CAChB,iBAAiB;AACnB;AAEA,SAAS,yBACP,MACA,SACA,OAC0B;CAC1B,OAAO,OAAO,OAAO,IAAI,MAAM,OAAO,GAAG,EAAE,KAAK,GAAG,UAAU,SAAY,CAAC,IAAI,EAAE,MAAM,CAAC;AACzF;AAEA,SAAS,gBAAgB,OAAoC;CAC3D,MAAM,OAAQ,OAAqC;CACnD,OAAO,OAAO,SAAS,WAAW,OAAO;AAC3C;AAEA,SAAS,2BAA2B,OAAgB,cAA4D;CAC9G,MAAM,OAAO,gBAAgB,KAAK;CAClC,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;CACrE,OAAO,yBAA0B,QAAQ,mBAAmB,SAAU,cAAc,SAAS,KAAK;AACpG;AAEA,eAAe,WAAc,YAAwB,WAA6D;CA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BAAkB,mCAAmC;GACxE,MAAM,QAAQ,QAAQ,SAAS;GAC/B,IAAI,CAAC,sBAAsB,IAAI,KAAK,GAClC,MAAM,yBACJ,gCACA,sFACF;GAEF,MAAM,UAAU,MAAM;GACtB,IAAI,CAAC,WAAY,QAAQ,WAAW,YAAY,QAAQ,WAAW,aAAc,CAAC,QAAQ,MACxF,MAAM,yBACJ,gDACA,6EACF;GAEF,MAAM,SAAS,MAAM,yBAAyB,YAAY,QAAQ,KAAK,EAAE;GACzE,MAAM,SAAS,QAAQ,UAAU;GAEjC,IAAI,eAAe,MAAM,QAAQ,WAAW,oBAAoB,QAAQ,kBAAkB,EAAE,MAAM,CAAC,CAAC;GACpG,IAAI,aAAa,WAAW,sBAAsB;IAChD,eAAe,MAAM,oBAAoB,YAAY,SAAS,QAAQ,SAAS,MAAM;IACrF,IAAI,aAAa,WAAW,uBAC1B,eAAe,MAAM,oBAAoB,YAAY,SAAS,QAAQ,UAAU,MAAM;GAE1F,OAAO,IAAI,aAAa,WAAW,uBACjC,eAAe,MAAM,oBAAoB,YAAY,SAAS,QAAQ,UAAU,MAAM;QACjF,IAAI,aAAa,WAAW,YACjC,MAAM,yBACJ,WAAW,cACX,2DACF;GAGF,IAAI,aAAa,WAAW,YAAY;IACtC,QAAQ,WAAW;IAEnB,IAAI,CAAC,MADe,QAAQ,SAAS,EAAE,WAAW,KAAK,CAAC,GAEtD,MAAM,yBACJ,WAAW,cACX,qEACF;GAEJ;GACA,OAAO;IAAE,IAAI,aAAa,MAAM;IAAM,QAAQ,aAAa;IAAQ,OAAO,aAAa;IAAO;GAAQ;EACxG;CACF;AACF"}
1
+ {"version":3,"file":"createBiometricCredentials.js","names":["errorThrower","Platform"],"sources":["../../src/biometric-credentials/createBiometricCredentials.ts"],"sourcesContent":["import type { useClerk } from '@clerk/react';\nimport { isClerkAPIResponseError } from '@clerk/shared/error';\nimport type {\n BiometricCredentialResource,\n EnvironmentResource,\n PrepareBiometricCredentialParams,\n SessionResource,\n SessionVerificationLevel,\n SessionVerificationResource,\n SignInResource,\n TrustedDeviceChallengeResource,\n UserResource,\n} from '@clerk/shared/types';\nimport { Platform } from 'react-native';\n\nimport { errorThrower } from '../utils/errors';\nimport type { BiometricCredentialError, BiometricCredentialErrorCode } from './errors';\nimport type { ExpoBiometricsModule, ExpoBiometricsRecord } from './loadExpoBiometrics';\nimport { loadExpoBiometrics } from './loadExpoBiometrics';\nimport type {\n BiometricCredential,\n BiometricCredentialPlatform,\n BiometricCredentialPolicy,\n BiometricCredentialStatus,\n BiometricCredentialUnavailableReason,\n UseBiometricCredentialsReturn,\n} from './types';\n\ntype Clerk = ReturnType<typeof useClerk>;\n\ntype OperationErrorCode =\n | 'E_TRUSTED_DEVICE_AVAILABILITY_FAILED'\n | 'E_TRUSTED_DEVICE_LIST_FAILED'\n | 'E_TRUSTED_DEVICE_ENROLLMENT_FAILED'\n | 'E_TRUSTED_DEVICE_REVOCATION_FAILED'\n | 'E_TRUSTED_DEVICE_SIGN_IN_FAILED'\n | 'E_BIOMETRIC_REVERIFICATION_FAILED';\n\ntype Biometrics = {\n module: ExpoBiometricsModule;\n appIdentifier: string;\n fallbackCode: OperationErrorCode;\n};\n\ntype LocalCredentialSelection =\n | { record: ExpoBiometricsRecord; unavailableReason?: never }\n | { record?: never; unavailableReason: BiometricCredentialUnavailableReason };\n\nconst DEFAULT_POLICY: BiometricCredentialPolicy = 'biometry_current_set';\nconst POLICIES: ReadonlySet<string> = new Set<BiometricCredentialPolicy>([\n 'biometry_current_set',\n 'biometry_any',\n 'biometry_or_device_passcode',\n]);\nconst DEFAULT_ENROLLMENT_REASON = 'Use biometrics to enroll this device.';\nconst DEFAULT_SIGN_IN_REASON = 'Use biometrics to sign in.';\nconst DEFAULT_REVERIFICATION_REASON = 'Use biometrics to verify your identity.';\nconst REVERIFICATION_LEVELS = new Set<SessionVerificationLevel>(['first_factor', 'second_factor', 'multi_factor']);\n\nconst EXPO_BIOMETRICS_INSTALL_INSTRUCTIONS =\n 'Install it with `npx expo install @clerk/expo-biometrics`, then rebuild your development build.';\n\nconst MISSING_CREDENTIAL_ERROR_CODES = new Set(['form_resource_not_found', 'trusted_device_not_registered']);\nconst TRUSTED_DEVICE_ID_PARAM = 'trusted_device_id';\n\nconst MODULE_ERROR_CODES: Record<string, BiometricCredentialErrorCode | undefined> = {\n user_canceled: 'biometric_authentication_canceled',\n system_canceled: 'biometric_authentication_canceled',\n user_fallback: 'biometric_authentication_canceled',\n authentication_failed: 'biometric_authentication_failed',\n biometry_not_available: 'biometric_authentication_unavailable',\n biometry_not_enrolled: 'biometric_authentication_unavailable',\n biometry_lockout: 'biometric_authentication_unavailable',\n passcode_not_set: 'biometric_authentication_unavailable',\n secure_key_storage_unavailable: 'biometric_authentication_unavailable',\n key_not_found: 'key_not_found',\n key_invalidated: 'key_invalidated',\n key_generation_failed: 'key_generation_failed',\n signing_failed: 'signing_failed',\n};\n\nfunction biometricCredentialError(\n code: BiometricCredentialErrorCode,\n message: string,\n cause?: unknown,\n): BiometricCredentialError {\n return Object.assign(new Error(message), { code }, cause === undefined ? {} : { cause });\n}\n\nfunction moduleErrorCode(error: unknown): string | undefined {\n const code = (error as { code?: unknown } | null)?.code;\n return typeof code === 'string' ? code : undefined;\n}\n\nfunction toBiometricCredentialError(error: unknown, fallbackCode: OperationErrorCode): BiometricCredentialError {\n const code = moduleErrorCode(error);\n const message = error instanceof Error ? error.message : String(error);\n return biometricCredentialError((code && MODULE_ERROR_CODES[code]) || fallbackCode, message, error);\n}\n\nasync function callModule<T>(biometrics: Biometrics, operation: (module: ExpoBiometricsModule) => T | Promise<T>) {\n try {\n return await operation(biometrics.module);\n } catch (error) {\n throw toBiometricCredentialError(error, biometrics.fallbackCode);\n }\n}\n\nfunction requireBiometrics(fallbackCode: OperationErrorCode): Biometrics {\n const module = loadExpoBiometrics();\n if (!module) {\n return errorThrower.throw(\n `Biometric credentials require the @clerk/expo-biometrics package. ${EXPO_BIOMETRICS_INSTALL_INSTRUCTIONS}`,\n );\n }\n try {\n return { module, appIdentifier: module.getAppIdentifier(), fallbackCode };\n } catch (error) {\n if (moduleErrorCode(error) === 'native_module_unavailable') {\n return errorThrower.throw(\n `Biometric credentials require a development build that includes @clerk/expo-biometrics, and are not available in Expo Go. ${EXPO_BIOMETRICS_INSTALL_INSTRUCTIONS}`,\n );\n }\n throw toBiometricCredentialError(error, fallbackCode);\n }\n}\n\nfunction normalizeIdentifierHint(identifierHint: string | null | undefined): string | null {\n const normalized = identifierHint?.trim().toLowerCase();\n return normalized ? normalized : null;\n}\n\nasync function identifierHintMatcher(\n biometrics: Biometrics,\n identifierHint: string | undefined,\n): Promise<(record: ExpoBiometricsRecord) => boolean> {\n const normalizedHint = normalizeIdentifierHint(identifierHint);\n if (!normalizedHint) {\n return () => true;\n }\n const hash = await callModule(biometrics, module => module.hashIdentifierHint(normalizedHint));\n return record => record.identifierHintSha256 === hash;\n}\n\nfunction newestFirst(a: ExpoBiometricsRecord, b: ExpoBiometricsRecord): number {\n if (a.createdAt !== b.createdAt) {\n return b.createdAt - a.createdAt;\n }\n if (a.updatedAt !== b.updatedAt) {\n return b.updatedAt - a.updatedAt;\n }\n return a.id < b.id ? 1 : a.id > b.id ? -1 : 0;\n}\n\nfunction toBiometricCredentialPlatform(platform: string): BiometricCredentialPlatform {\n return platform === 'ios' || platform === 'android' ? platform : 'unknown';\n}\n\nfunction toBiometricCredentialStatus(status: string): BiometricCredentialStatus {\n return status === 'active' || status === 'revoked' ? status : 'unknown';\n}\n\nfunction toBiometricCredential(credential: BiometricCredentialResource): BiometricCredential {\n return {\n id: credential.id,\n object: 'trusted_device',\n platform: toBiometricCredentialPlatform(credential.platform),\n appIdentifier: credential.appIdentifier,\n name: credential.name ?? null,\n algorithm: credential.algorithm,\n status: toBiometricCredentialStatus(credential.status),\n createdAt: credential.createdAt,\n updatedAt: credential.updatedAt,\n lastUsedAt: credential.lastUsedAt ?? null,\n revokedAt: credential.revokedAt ?? null,\n };\n}\n\nfunction toApiBiometricCredentialError(error: unknown, fallbackCode: OperationErrorCode): unknown {\n if (isClerkAPIResponseError(error)) {\n const apiError = error.errors[0];\n return biometricCredentialError(\n apiError?.code ?? fallbackCode,\n apiError?.longMessage ?? apiError?.message ?? error.message,\n error,\n );\n }\n if (error instanceof Error && typeof (error as { code?: unknown }).code === 'string') {\n return error;\n }\n return biometricCredentialError(fallbackCode, error instanceof Error ? error.message : String(error), error);\n}\n\nasync function callApi<T>(fallbackCode: OperationErrorCode, request: () => Promise<T>): Promise<T> {\n try {\n return await request();\n } catch (error) {\n throw toApiBiometricCredentialError(error, fallbackCode);\n }\n}\n\nfunction isMissingCredentialError(error: unknown): boolean {\n return (\n isClerkAPIResponseError(error) &&\n error.errors.some(\n apiError =>\n MISSING_CREDENTIAL_ERROR_CODES.has(apiError.code) && apiError.meta?.paramName === TRUSTED_DEVICE_ID_PARAM,\n )\n );\n}\n\nexport function createBiometricCredentials(clerk: Clerk): UseBiometricCredentialsReturn {\n function featureUnavailableReason(): BiometricCredentialUnavailableReason | null {\n const environment = (clerk as { __internal_environment?: EnvironmentResource | null }).__internal_environment;\n const nativeSettings = environment?.authConfig?.nativeSettings;\n if (!nativeSettings) {\n return 'environment_unavailable';\n }\n if (!nativeSettings.apiEnabled) {\n return 'native_api_disabled';\n }\n if (!nativeSettings.trustedDeviceSignInEnabled) {\n return 'feature_disabled';\n }\n return null;\n }\n\n function requireUser(fallbackCode: OperationErrorCode): UserResource {\n const user = clerk.user;\n if (!user) {\n throw biometricCredentialError(fallbackCode, 'Biometric credential management requires a signed-in user.');\n }\n return user;\n }\n\n async function deleteLocalCredential(biometrics: Biometrics, record: ExpoBiometricsRecord): Promise<void> {\n await callModule(biometrics, module => module.deleteRecord(record.localKeyId));\n }\n\n async function ignoreErrors(operation: () => Promise<unknown>): Promise<void> {\n try {\n await operation();\n } catch {\n // Cleanup must not mask the error that triggered it.\n }\n }\n\n async function forgetLocalCredentialIfMissing(\n biometrics: Biometrics,\n record: ExpoBiometricsRecord,\n error: unknown,\n ): Promise<unknown> {\n if (isMissingCredentialError(error)) {\n await ignoreErrors(() => deleteLocalCredential(biometrics, record));\n }\n return toApiBiometricCredentialError(error, biometrics.fallbackCode);\n }\n\n async function signChallenge(\n biometrics: Biometrics,\n record: ExpoBiometricsRecord,\n clientData: string,\n reason: string,\n ): Promise<string> {\n try {\n return await biometrics.module.sign(record.localKeyId, clientData, reason);\n } catch (error) {\n const biometricError = toBiometricCredentialError(error, biometrics.fallbackCode);\n if (biometricError.code === 'key_invalidated' || biometricError.code === 'key_not_found') {\n await ignoreErrors(() => deleteLocalCredential(biometrics, record));\n }\n throw biometricError;\n }\n }\n\n async function localCredentialCandidates(\n biometrics: Biometrics,\n id: string | undefined,\n identifierHint: string | undefined,\n ): Promise<ExpoBiometricsRecord[] | BiometricCredentialUnavailableReason> {\n const unavailableReason = featureUnavailableReason();\n if (unavailableReason) {\n return unavailableReason;\n }\n\n const device = await callModule(biometrics, module => module.getAvailability());\n if (!device.secureKeyStorageAvailable) {\n return 'biometric_authentication_unavailable';\n }\n\n const matchesIdentifierHint = await identifierHintMatcher(biometrics, identifierHint);\n const records = (await callModule(biometrics, module => module.listRecords()))\n .filter(\n record =>\n record.appIdentifier === biometrics.appIdentifier &&\n (id === undefined || record.id === id) &&\n matchesIdentifierHint(record),\n )\n .sort(newestFirst);\n if (records.length === 0) {\n return 'no_local_credential';\n }\n\n const recordsWithKeys: ExpoBiometricsRecord[] = [];\n for (const record of records) {\n if (await callModule(biometrics, module => module.hasKey(record.localKeyId))) {\n recordsWithKeys.push(record);\n } else {\n await deleteLocalCredential(biometrics, record);\n }\n }\n if (recordsWithKeys.length === 0) {\n return 'local_key_missing';\n }\n\n const supportedRecords = recordsWithKeys.filter(record =>\n record.policy === 'biometry_or_device_passcode' ? device.canEvaluateDeviceOwner : device.canEvaluateBiometrics,\n );\n if (supportedRecords.length === 0) {\n return 'biometric_authentication_unavailable';\n }\n return supportedRecords;\n }\n\n async function selectLocalCredential(\n biometrics: Biometrics,\n id: string | undefined,\n identifierHint: string | undefined,\n ): Promise<LocalCredentialSelection> {\n const candidates = await localCredentialCandidates(biometrics, id, identifierHint);\n if (typeof candidates === 'string') {\n return { unavailableReason: candidates };\n }\n\n const session = clerk.session;\n const activeUser = session?.status === 'active' ? session.user : null;\n if (!activeUser?.id) {\n return { record: candidates[0] };\n }\n\n const activeUserRecords = candidates.filter(record => record.userId === activeUser.id);\n if (activeUserRecords.length === 0) {\n return { unavailableReason: 'no_local_credential' };\n }\n\n const serverCredentials = await callApi(biometrics.fallbackCode, () =>\n activeUser.__experimental_getBiometricCredentials(),\n );\n let firstUnavailableReason: BiometricCredentialUnavailableReason | null = null;\n for (const record of activeUserRecords) {\n const serverCredential = serverCredentials.find(credential => credential.id === record.id);\n if (!serverCredential) {\n await deleteLocalCredential(biometrics, record);\n firstUnavailableReason ??= 'server_credential_missing';\n continue;\n }\n if (serverCredential.status !== 'active') {\n await deleteLocalCredential(biometrics, record);\n firstUnavailableReason ??= 'server_credential_revoked';\n continue;\n }\n return { record };\n }\n return { unavailableReason: firstUnavailableReason ?? 'server_credential_missing' };\n }\n\n async function reverificationCredential(biometrics: Biometrics, userId: string): Promise<ExpoBiometricsRecord> {\n const candidates = await localCredentialCandidates(biometrics, undefined, undefined);\n if (typeof candidates === 'string') {\n throw biometricCredentialError(\n biometrics.fallbackCode,\n `Biometric reverification is unavailable: ${candidates}.`,\n );\n }\n const userRecords = candidates.filter(record => record.userId === userId);\n if (userRecords.length === 0) {\n throw biometricCredentialError(\n biometrics.fallbackCode,\n 'Biometric reverification is unavailable: no_local_credential.',\n );\n }\n const record = userRecords.find(candidate => candidate.policy === 'biometry_current_set');\n if (!record) {\n throw biometricCredentialError(\n 'biometric_credential_policy_incompatible',\n 'This biometric credential cannot be used for reverification. Verify your identity using another method.',\n );\n }\n return record;\n }\n\n function usableChallenge(\n biometrics: Biometrics,\n record: ExpoBiometricsRecord,\n challenge: TrustedDeviceChallengeResource | null | undefined,\n flow: string,\n ): TrustedDeviceChallengeResource {\n if (!challenge || (challenge.trustedDeviceId && challenge.trustedDeviceId !== record.id)) {\n throw biometricCredentialError(biometrics.fallbackCode, `${flow} did not return a matching challenge.`);\n }\n if (challenge.expiresAt && challenge.expiresAt.getTime() <= Date.now()) {\n throw biometricCredentialError(biometrics.fallbackCode, `${flow} challenge has expired.`);\n }\n return challenge;\n }\n\n async function verifySessionFactor(\n biometrics: Biometrics,\n session: SessionResource,\n record: ExpoBiometricsRecord,\n factor: 'first' | 'second',\n reason: string,\n ): Promise<SessionVerificationResource> {\n let prepared: SessionVerificationResource;\n try {\n const config = { strategy: 'trusted_device', trustedDeviceId: record.id } as const;\n prepared =\n factor === 'first'\n ? await session.prepareFirstFactorVerification(config)\n : await session.prepareSecondFactorVerification(config);\n } catch (error) {\n throw await forgetLocalCredentialIfMissing(biometrics, record, error);\n }\n\n const verification = factor === 'first' ? prepared.firstFactorVerification : prepared.secondFactorVerification;\n const challenge = usableChallenge(\n biometrics,\n record,\n verification?.strategy === 'trusted_device' ? verification.trustedDeviceChallenge : null,\n 'Biometric reverification',\n );\n\n const signature = await signChallenge(biometrics, record, challenge.clientData, reason);\n\n try {\n const attempt = {\n strategy: 'trusted_device',\n trustedDeviceId: record.id,\n clientData: challenge.clientData,\n signature,\n algorithm: 'ES256',\n } as const;\n return factor === 'first'\n ? await session.attemptFirstFactorVerification(attempt)\n : await session.attemptSecondFactorVerification(attempt);\n } catch (error) {\n throw await forgetLocalCredentialIfMissing(biometrics, record, error);\n }\n }\n\n return {\n getAvailability: async params => {\n const biometrics = requireBiometrics('E_TRUSTED_DEVICE_AVAILABILITY_FAILED');\n const selection = await selectLocalCredential(biometrics, params?.id, params?.identifierHint);\n return selection.record\n ? { isAvailable: true, unavailableReason: null }\n : { isAvailable: false, unavailableReason: selection.unavailableReason };\n },\n\n list: async () => {\n const biometrics = requireBiometrics('E_TRUSTED_DEVICE_LIST_FAILED');\n const user = requireUser(biometrics.fallbackCode);\n const credentials = await callApi(biometrics.fallbackCode, () => user.__experimental_getBiometricCredentials());\n return credentials.map(toBiometricCredential);\n },\n\n enroll: async params => {\n const biometrics = requireBiometrics('E_TRUSTED_DEVICE_ENROLLMENT_FAILED');\n const session = clerk.session;\n if (!session || (session.status !== 'active' && session.status !== 'pending') || !session.user) {\n throw biometricCredentialError(\n biometrics.fallbackCode,\n 'Unable to enroll a biometric credential without an active or pending Clerk session.',\n );\n }\n const user = session.user;\n const unavailableReason = featureUnavailableReason();\n if (unavailableReason) {\n throw biometricCredentialError(\n unavailableReason === 'environment_unavailable' ? unavailableReason : biometrics.fallbackCode,\n `Unable to enroll a biometric credential: ${unavailableReason}.`,\n );\n }\n\n const policy = params?.policy ?? DEFAULT_POLICY;\n if (!POLICIES.has(policy)) {\n throw biometricCredentialError(\n 'invalid_trusted_device_policy',\n `Invalid biometric-credential policy: ${policy}.`,\n );\n }\n const key = await callModule(biometrics, module => module.createKey(policy));\n const enrollment: PrepareBiometricCredentialParams = {\n platform: Platform.OS === 'android' ? 'android' : 'ios',\n appIdentifier: biometrics.appIdentifier,\n algorithm: 'ES256',\n publicKeyJwk: key.publicKeyJwk,\n ...(params?.name === undefined ? {} : { name: params.name }),\n };\n\n let credential: BiometricCredentialResource;\n try {\n const challenge = await callApi(biometrics.fallbackCode, () =>\n user.__experimental_prepareBiometricCredential(enrollment),\n );\n const signature = await callModule(biometrics, module =>\n module.sign(key.localKeyId, challenge.clientData, params?.reason ?? DEFAULT_ENROLLMENT_REASON),\n );\n credential = await callApi(biometrics.fallbackCode, () =>\n user.__experimental_attemptBiometricCredential({\n ...enrollment,\n clientData: challenge.clientData,\n signature,\n }),\n );\n } catch (error) {\n await ignoreErrors(() => biometrics.module.deleteKey(key.localKeyId));\n throw error;\n }\n\n const identifierHint = normalizeIdentifierHint(params?.identifierHint);\n try {\n await callModule(biometrics, module =>\n module.saveRecord(\n {\n id: credential.id,\n localKeyId: key.localKeyId,\n userId: user.id,\n appIdentifier: biometrics.appIdentifier,\n ...(identifierHint ? { identifierHint } : {}),\n policy,\n createdAt: credential.createdAt.getTime(),\n updatedAt: credential.updatedAt.getTime(),\n },\n { removeOtherRecordsForApp: true },\n ),\n );\n } catch (error) {\n await ignoreErrors(() => user.__experimental_revokeBiometricCredential(credential.id));\n await ignoreErrors(() => biometrics.module.deleteKey(key.localKeyId));\n throw error;\n }\n return toBiometricCredential(credential);\n },\n\n revoke: async id => {\n const biometrics = requireBiometrics('E_TRUSTED_DEVICE_REVOCATION_FAILED');\n const user = requireUser(biometrics.fallbackCode);\n const credential = await callApi(biometrics.fallbackCode, () =>\n user.__experimental_revokeBiometricCredential(id),\n );\n await ignoreErrors(async () => {\n const records = await biometrics.module.listRecords();\n const localKeyIds = new Set(records.filter(record => record.id === id).map(record => record.localKeyId));\n for (const localKeyId of localKeyIds) {\n await biometrics.module.deleteRecord(localKeyId);\n }\n });\n return toBiometricCredential(credential);\n },\n\n signIn: async params => {\n const biometrics = requireBiometrics('E_TRUSTED_DEVICE_SIGN_IN_FAILED');\n const clientSignIn = clerk.client?.signIn;\n if (!clientSignIn) {\n throw biometricCredentialError(\n biometrics.fallbackCode,\n 'Biometric sign-in requires a loaded Clerk client: the client sign-in resource is unavailable.',\n );\n }\n\n const selection = await selectLocalCredential(biometrics, params?.id, params?.identifierHint);\n if (!selection.record) {\n throw biometricCredentialError(\n biometrics.fallbackCode,\n `Biometric sign-in is unavailable: ${selection.unavailableReason}.`,\n );\n }\n const record = selection.record;\n\n let signIn: SignInResource;\n try {\n signIn = await clientSignIn.create({ strategy: 'trusted_device', trustedDeviceId: record.id });\n } catch (error) {\n throw await forgetLocalCredentialIfMissing(biometrics, record, error);\n }\n\n const challenge = usableChallenge(\n biometrics,\n record,\n signIn.firstFactorVerification?.trustedDeviceChallenge,\n 'Biometric sign-in',\n );\n\n const signature = await signChallenge(\n biometrics,\n record,\n challenge.clientData,\n params?.reason ?? DEFAULT_SIGN_IN_REASON,\n );\n\n try {\n signIn = await signIn.attemptFirstFactor({\n strategy: 'trusted_device',\n trustedDeviceId: record.id,\n clientData: challenge.clientData,\n signature,\n algorithm: 'ES256',\n });\n } catch (error) {\n throw await forgetLocalCredentialIfMissing(biometrics, record, error);\n }\n\n if (!signIn.status) {\n throw biometricCredentialError(biometrics.fallbackCode, 'Biometric sign-in did not return a status.');\n }\n return {\n status: signIn.status,\n createdSessionId: signIn.createdSessionId,\n signIn,\n setActive: clerk.setActive,\n };\n },\n\n reverify: async params => {\n const biometrics = requireBiometrics('E_BIOMETRIC_REVERIFICATION_FAILED');\n const level = params?.level ?? 'first_factor';\n if (!REVERIFICATION_LEVELS.has(level)) {\n throw biometricCredentialError(\n 'invalid_reverification_level',\n 'Biometric reverification level must be first_factor, second_factor, or multi_factor.',\n );\n }\n const session = clerk.session;\n if (!session || (session.status !== 'active' && session.status !== 'pending') || !session.user) {\n throw biometricCredentialError(\n 'biometric_reverification_session_unavailable',\n 'Biometric reverification requires an active or pending session with a user.',\n );\n }\n const record = await reverificationCredential(biometrics, session.user.id);\n const reason = params?.reason ?? DEFAULT_REVERIFICATION_REASON;\n\n let verification = await callApi(biometrics.fallbackCode, () => session.startVerification({ level }));\n if (verification.status === 'needs_first_factor') {\n verification = await verifySessionFactor(biometrics, session, record, 'first', reason);\n } else if (verification.status === 'needs_second_factor') {\n verification = await verifySessionFactor(biometrics, session, record, 'second', reason);\n } else if (verification.status !== 'complete') {\n throw biometricCredentialError(\n biometrics.fallbackCode,\n 'The server returned an unsupported reverification status.',\n );\n }\n\n if (verification.status === 'complete') {\n session.clearCache();\n const token = await callApi(biometrics.fallbackCode, () => session.getToken({ skipCache: true }));\n if (!token) {\n throw biometricCredentialError(\n biometrics.fallbackCode,\n 'Unable to refresh the session token after biometric reverification.',\n );\n }\n }\n return { id: verification.id ?? null, status: verification.status, level: verification.level, session };\n },\n };\n}\n"],"mappings":";;;;;;;AAgDA,MAAM,iBAA4C;AAClD,MAAM,WAAgC,IAAI,IAA+B;CACvE;CACA;CACA;AACF,CAAC;AACD,MAAM,4B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AEnB,IAAI,CAAC,MADe,QAAQ,WAAW,oBAAoB,QAAQ,SAAS,EAAE,WAAW,KAAK,CAAC,CAAC,GAE9F,MAAM,yBACJ,WAAW,cACX,qEACF;GAEJ;GACA,OAAO;IAAE,IAAI,aAAa,MAAM;IAAM,QAAQ,aAAa;IAAQ,OAAO,aAAa;IAAO;GAAQ;EACxG;CACF;AACF"}
@@ -0,0 +1,6 @@
1
+ import type { UseBiometricCredentialsReturn } from './types';
2
+ /**
3
+ * @deprecated Import `useBiometricCredentials` from `@clerk/expo/biometrics` instead. This export will be removed in the next major version.
4
+ */
5
+ export declare function useBiometricCredentials(): UseBiometricCredentialsReturn;
6
+ //# sourceMappingURL=deprecatedRootExport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecatedRootExport.d.ts","sourceRoot":"","sources":["../../src/biometric-credentials/deprecatedRootExport.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAG7D;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,6BAA6B,CAGvE"}
@@ -0,0 +1,16 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ let _clerk_shared_deprecated = require("@clerk/shared/deprecated");
3
+ let src_biometric_credentials_useBiometricCredentials = require("./useBiometricCredentials");
4
+
5
+ //#region src/biometric-credentials/deprecatedRootExport.ts
6
+ /**
7
+ * @deprecated Import `useBiometricCredentials` from `@clerk/expo/biometrics` instead. This export will be removed in the next major version.
8
+ */
9
+ function useBiometricCredentials() {
10
+ (0, _clerk_shared_deprecated.deprecated)("useBiometricCredentials from `@clerk/expo`", "Import it from `@clerk/expo/biometrics` instead.");
11
+ return (0, src_biometric_credentials_useBiometricCredentials.useBiometricCredentials)();
12
+ }
13
+
14
+ //#endregion
15
+ exports.useBiometricCredentials = useBiometricCredentials;
16
+ //# sourceMappingURL=deprecatedRootExport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecatedRootExport.js","names":[],"sources":["../../src/biometric-credentials/deprecatedRootExport.ts"],"sourcesContent":["import { deprecated } from '@clerk/shared/deprecated';\n\nimport type { UseBiometricCredentialsReturn } from './types';\nimport { useBiometricCredentials as useBiometricCredentialsBase } from './useBiometricCredentials';\n\n/**\n * @deprecated Import `useBiometricCredentials` from `@clerk/expo/biometrics` instead. This export will be removed in the next major version.\n */\nexport function useBiometricCredentials(): UseBiometricCredentialsReturn {\n deprecated('useBiometricCredentials from `@clerk/expo`', 'Import it from `@clerk/expo/biometrics` instead.');\n return useBiometricCredentialsBase();\n}\n"],"mappings":";;;;;;;;AAQA,SAAgB,0BAAyD;CACvE,yCAAW,8CAA8C,kDAAkD;CAC3G,sFAAmC;AACrC"}
@@ -1,10 +1,5 @@
1
1
  import type * as ExpoBiometrics from '@clerk/expo-biometrics';
2
- export type ExpoBiometricsRecord = ExpoBiometrics.StoredBiometricCredentialRecord & {
3
- identifierHintSha256?: string | null;
4
- };
5
- export type ExpoBiometricsModule = Omit<typeof ExpoBiometrics, 'listRecords'> & {
6
- listRecords(): Promise<ExpoBiometricsRecord[]>;
7
- hashIdentifierHint?: (identifierHint: string) => string | null;
8
- };
2
+ export type ExpoBiometricsRecord = ExpoBiometrics.StoredBiometricCredentialRecord;
3
+ export type ExpoBiometricsModule = typeof ExpoBiometrics;
9
4
  export declare function loadExpoBiometrics(): ExpoBiometricsModule | null;
10
5
  //# sourceMappingURL=loadExpoBiometrics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"loadExpoBiometrics.d.ts","sourceRoot":"","sources":["../../src/biometric-credentials/loadExpoBiometrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,cAAc,MAAM,wBAAwB,CAAC;AAE9D,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,+BAA+B,GAAG;IAClF,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,OAAO,cAAc,EAAE,aAAa,CAAC,GAAG;IAC9E,WAAW,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAAC;IAC/C,kBAAkB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CAChE,CAAC;AAEF,wBAAgB,kBAAkB,IAAI,oBAAoB,GAAG,IAAI,CAQhE"}
1
+ {"version":3,"file":"loadExpoBiometrics.d.ts","sourceRoot":"","sources":["../../src/biometric-credentials/loadExpoBiometrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,cAAc,MAAM,wBAAwB,CAAC;AAE9D,MAAM,MAAM,oBAAoB,GAAG,cAAc,CAAC,+BAA+B,CAAC;AAElF,MAAM,MAAM,oBAAoB,GAAG,OAAO,cAAc,CAAC;AAEzD,wBAAgB,kBAAkB,IAAI,oBAAoB,GAAG,IAAI,CAQhE"}
@@ -1 +1 @@
1
- {"version":3,"file":"loadExpoBiometrics.js","names":[],"sources":["../../src/biometric-credentials/loadExpoBiometrics.ts"],"sourcesContent":["import type * as ExpoBiometrics from '@clerk/expo-biometrics';\n\nexport type ExpoBiometricsRecord = ExpoBiometrics.StoredBiometricCredentialRecord & {\n identifierHintSha256?: string | null;\n};\n\nexport type ExpoBiometricsModule = Omit<typeof ExpoBiometrics, 'listRecords'> & {\n listRecords(): Promise<ExpoBiometricsRecord[]>;\n hashIdentifierHint?: (identifierHint: string) => string | null;\n};\n\nexport function loadExpoBiometrics(): ExpoBiometricsModule | null {\n try {\n // Synchronous require() in try/catch so Metro treats @clerk/expo-biometrics as an optional dependency.\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n return require('@clerk/expo-biometrics') as ExpoBiometricsModule;\n } catch {\n return null;\n }\n}\n"],"mappings":";;;AAWA,SAAgB,qBAAkD;CAChE,IAAI;EAGF,OAAO,QAAQ,wBAAwB;CACzC,QAAQ;EACN,OAAO;CACT;AACF"}
1
+ {"version":3,"file":"loadExpoBiometrics.js","names":[],"sources":["../../src/biometric-credentials/loadExpoBiometrics.ts"],"sourcesContent":["import type * as ExpoBiometrics from '@clerk/expo-biometrics';\n\nexport type ExpoBiometricsRecord = ExpoBiometrics.StoredBiometricCredentialRecord;\n\nexport type ExpoBiometricsModule = typeof ExpoBiometrics;\n\nexport function loadExpoBiometrics(): ExpoBiometricsModule | null {\n try {\n // Synchronous require() in try/catch so Metro treats @clerk/expo-biometrics as an optional dependency.\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n return require('@clerk/expo-biometrics') as ExpoBiometricsModule;\n } catch {\n return null;\n }\n}\n"],"mappings":";;;AAMA,SAAgB,qBAAkD;CAChE,IAAI;EAGF,OAAO,QAAQ,wBAAwB;CACzC,QAAQ;EACN,OAAO;CACT;AACF"}
@@ -40,7 +40,7 @@ export type ReverifyWithBiometricsParams = {
40
40
  level?: SessionVerificationLevel;
41
41
  reason?: string;
42
42
  };
43
- /** The verification outcome and synchronized session, without creating or activating a session. */
43
+ /** The verification outcome and its session, without creating or activating a session. */
44
44
  export type BiometricReverificationResult = {
45
45
  id: string | null;
46
46
  status: SessionVerificationStatus | (string & {});
@@ -50,7 +50,7 @@ export type BiometricReverificationResult = {
50
50
  export type BiometricSignInResult = {
51
51
  status: SignInStatus | (string & {});
52
52
  createdSessionId: string | null;
53
- /** The synchronized JS sign-in resource used to continue any remaining authentication steps. */
53
+ /** The sign-in resource used to continue any remaining authentication steps. */
54
54
  signIn: SignInResource;
55
55
  /** Activates a session after the sign-in reaches `complete`. */
56
56
  setActive: SetActive;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/biometric-credentials/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EACzB,SAAS,EACT,cAAc,EACd,YAAY,EACb,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,oCAAoC,GAC5C,yBAAyB,GACzB,qBAAqB,GACrB,k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,eAAe,EAAE,CAAC,MAAM,CAAC,EAAE,wCAAwC,KAAK,OAAO,CAAC,+BAA+B,CAAC,CAAC;IACjH,IAAI,EAAE,MAAM,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAC3C,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,+BAA+B,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACnF,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACrD,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,0BAA0B,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAChF,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,4BAA4B,KAAK,OAAO,CAAC,6BAA6B,CAAC,CAAC;CAC7F,CAAC"}
@@ -2,7 +2,8 @@ import type { UseBiometricCredentialsReturn } from './types';
2
2
  /**
3
3
  * Accesses biometric credential enrollment, sign-in, and session reverification.
4
4
  *
5
- * Biometric credentials are currently supported on iOS and Android.
5
+ * Biometric credentials are supported on iOS and Android. They require the `@clerk/expo-biometrics` package in a
6
+ * development build.
6
7
  */
7
8
  export declare function useBiometricCredentials(): UseBiometricCredentialsReturn;
8
9
  //# sourceMappingURL=useBiometricCredentials.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useBiometricCredentials.d.ts","sourceRoot":"","sources":["../../src/biometric-credentials/useBiometricCredentials.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAwB7D;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,6BAA6B,CAEvE"}
1
+ {"version":3,"file":"useBiometricCredentials.d.ts","sourceRoot":"","sources":["../../src/biometric-credentials/useBiometricCredentials.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AAwB7D;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAAI,6BAA6B,CAEvE"}
@@ -23,7 +23,8 @@ const biometricCredentials = Object.freeze({
23
23
  /**
24
24
  * Accesses biometric credential enrollment, sign-in, and session reverification.
25
25
  *
26
- * Biometric credentials are currently supported on iOS and Android.
26
+ * Biometric credentials are supported on iOS and Android. They require the `@clerk/expo-biometrics` package in a
27
+ * development build.
27
28
  */
28
29
  function useBiometricCredentials() {
29
30
  return biometricCredentials;
@@ -1 +1 @@
1
- {"version":3,"file":"useBiometricCredentials.js","names":["errorThrower"],"sources":["../../src/biometric-credentials/useBiometricCredentials.ts"],"sourcesContent":["import { errorThrower } from '../utils/errors';\nimport type { UseBiometricCredentialsReturn } from './types';\n\nconst unsupportedAvailability = {\n isAvailable: false,\n unavailableReason: 'unsupported_platform',\n} as const;\n\nfunction unsupported(): never {\n return errorThrower.throw('Biometric credentials are currently only available on iOS and Android.');\n}\n\nfunction rejectUnsupported(): Promise<never> {\n return Promise.resolve().then(unsupported);\n}\n\nconst biometricCredentials: UseBiometricCredentialsReturn = Object.freeze({\n getAvailability: () => Promise.resolve(unsupportedAvailability),\n list: rejectUnsupported,\n enroll: rejectUnsupported,\n revoke: rejectUnsupported,\n signIn: rejectUnsupported,\n reverify: rejectUnsupported,\n});\n\n/**\n * Accesses biometric credential enrollment, sign-in, and session reverification.\n *\n * Biometric credentials are currently supported on iOS and Android.\n */\nexport function useBiometricCredentials(): UseBiometricCredentialsReturn {\n return biometricCredentials;\n}\n"],"mappings":";;;;AAGA,MAAM,0BAA0B;CAC9B,aAAa;CACb,mBAAmB;AACrB;AAEA,SAAS,cAAqB;CAC5B,OAAOA,8BAAa,MAAM,wEAAwE;AACpG;AAEA,SAAS,oBAAoC;CAC3C,OAAO,QAAQ,QAAQ,CAAC,CAAC,KAAK,WAAW;AAC3C;AAEA,MAAM,uBAAsD,OAAO,OAAO;CACxE,uBAAuB,QAAQ,QAAQ,uBAAuB;CAC9D,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,UAAU;AACZ,CAAC;;;;;;AAOD,SAAgB,0BAAyD;CACvE,OAAO;AACT"}
1
+ {"version":3,"file":"useBiometricCredentials.js","names":["errorThrower"],"sources":["../../src/biometric-credentials/useBiometricCredentials.ts"],"sourcesContent":["import { errorThrower } from '../utils/errors';\nimport type { UseBiometricCredentialsReturn } from './types';\n\nconst unsupportedAvailability = {\n isAvailable: false,\n unavailableReason: 'unsupported_platform',\n} as const;\n\nfunction unsupported(): never {\n return errorThrower.throw('Biometric credentials are currently only available on iOS and Android.');\n}\n\nfunction rejectUnsupported(): Promise<never> {\n return Promise.resolve().then(unsupported);\n}\n\nconst biometricCredentials: UseBiometricCredentialsReturn = Object.freeze({\n getAvailability: () => Promise.resolve(unsupportedAvailability),\n list: rejectUnsupported,\n enroll: rejectUnsupported,\n revoke: rejectUnsupported,\n signIn: rejectUnsupported,\n reverify: rejectUnsupported,\n});\n\n/**\n * Accesses biometric credential enrollment, sign-in, and session reverification.\n *\n * Biometric credentials are supported on iOS and Android. They require the `@clerk/expo-biometrics` package in a\n * development build.\n */\nexport function useBiometricCredentials(): UseBiometricCredentialsReturn {\n return biometricCredentials;\n}\n"],"mappings":";;;;AAGA,MAAM,0BAA0B;CAC9B,aAAa;CACb,mBAAmB;AACrB;AAEA,SAAS,cAAqB;CAC5B,OAAOA,8BAAa,MAAM,wEAAwE;AACpG;AAEA,SAAS,oBAAoC;CAC3C,OAAO,QAAQ,QAAQ,CAAC,CAAC,KAAK,WAAW;AAC3C;AAEA,MAAM,uBAAsD,OAAO,OAAO;CACxE,uBAAuB,QAAQ,QAAQ,uBAAuB;CAC9D,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,UAAU;AACZ,CAAC;;;;;;;AAQD,SAAgB,0BAAyD;CACvE,OAAO;AACT"}
@@ -0,0 +1,2 @@
1
+ export * from '../biometric-credentials';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/biometrics/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,9 @@
1
+
2
+
3
+ var src_biometric_credentials = require("../biometric-credentials");
4
+ Object.keys(src_biometric_credentials).forEach(function (k) {
5
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
6
+ enumerable: true,
7
+ get: function () { return src_biometric_credentials[k]; }
8
+ });
9
+ });
package/dist/index.d.ts CHANGED
@@ -3,7 +3,9 @@ export { getClerkInstance } from './provider/singleton';
3
3
  export * from './provider/ClerkProvider';
4
4
  export * from './hooks';
5
5
  export * from './components';
6
- export * from './biometric-credentials';
6
+ export * from './biometric-credentials/errors';
7
+ export * from './biometric-credentials/types';
8
+ export { useBiometricCredentials } from './biometric-credentials/deprecatedRootExport';
7
9
  export * from './trusted-devices';
8
10
  export type { TokenCache } from './cache/types';
9
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,cAAc,0BAA0B,CAAC;AACzC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAKlC,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,cAAc,0BAA0B,CAAC;AACzC,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AACvF,cAAc,mBAAmB,CAAC;AAKlC,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  let _clerk_react_internal = require("@clerk/react/internal");
3
3
  let _clerk_react_errors = require("@clerk/react/errors");
4
4
  let src_provider_singleton = require("./provider/singleton");
5
+ let src_biometric_credentials_deprecatedRootExport = require("./biometric-credentials/deprecatedRootExport");
5
6
 
6
7
  //#region src/index.ts
7
8
  (0, _clerk_react_internal.setErrorThrowerOptions)({ packageName: "@clerk/expo" });
@@ -43,6 +44,12 @@ Object.defineProperty(exports, 'isMetamaskError', {
43
44
  return _clerk_react_errors.isMetamaskError;
44
45
  }
45
46
  });
47
+ Object.defineProperty(exports, 'useBiometricCredentials', {
48
+ enumerable: true,
49
+ get: function () {
50
+ return src_biometric_credentials_deprecatedRootExport.useBiometricCredentials;
51
+ }
52
+ });
46
53
  var src_provider_ClerkProvider = require("./provider/ClerkProvider");
47
54
  Object.keys(src_provider_ClerkProvider).forEach(function (k) {
48
55
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
@@ -67,11 +74,19 @@ Object.keys(src_components).forEach(function (k) {
67
74
  });
68
75
  });
69
76
 
70
- var src_biometric_credentials = require("./biometric-credentials");
71
- Object.keys(src_biometric_credentials).forEach(function (k) {
77
+ var src_biometric_credentials_errors = require("./biometric-credentials/errors");
78
+ Object.keys(src_biometric_credentials_errors).forEach(function (k) {
79
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
80
+ enumerable: true,
81
+ get: function () { return src_biometric_credentials_errors[k]; }
82
+ });
83
+ });
84
+
85
+ var src_biometric_credentials_types = require("./biometric-credentials/types");
86
+ Object.keys(src_biometric_credentials_types).forEach(function (k) {
72
87
  if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
73
88
  enumerable: true,
74
- get: function () { return src_biometric_credentials[k]; }
89
+ get: function () { return src_biometric_credentials_types[k]; }
75
90
  });
76
91
  });
77
92
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { setErrorThrowerOptions } from '@clerk/react/internal';\n\nexport {\n isClerkAPIResponseError,\n isEmailLinkError,\n isKnownError,\n isMetamaskError,\n isClerkRuntimeError,\n} from '@clerk/react/errors';\n\nexport { getClerkInstance } from './provider/singleton';\n\nexport * from './provider/ClerkProvider';\nexport * from './hooks';\nexport * from './components';\nexport * from './biometric-credentials';\nexport * from './trusted-devices';\n\n// Override Clerk React error thrower to show that errors come from @clerk/expo\nsetErrorThrowerOptions({ packageName: PACKAGE_NAME });\n\nexport type { TokenCache } from './cache/types';\n"],"mappings":";;;;;;kDAmBuB,EAAE,2BAA0B,CAAC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { setErrorThrowerOptions } from '@clerk/react/internal';\n\nexport {\n isClerkAPIResponseError,\n isEmailLinkError,\n isKnownError,\n isMetamaskError,\n isClerkRuntimeError,\n} from '@clerk/react/errors';\n\nexport { getClerkInstance } from './provider/singleton';\n\nexport * from './provider/ClerkProvider';\nexport * from './hooks';\nexport * from './components';\nexport * from './biometric-credentials/errors';\nexport * from './biometric-credentials/types';\nexport { useBiometricCredentials } from './biometric-credentials/deprecatedRootExport';\nexport * from './trusted-devices';\n\n// Override Clerk React error thrower to show that errors come from @clerk/expo\nsetErrorThrowerOptions({ packageName: PACKAGE_NAME });\n\nexport type { TokenCache } from './cache/types';\n"],"mappings":";;;;;;;kDAqBuB,EAAE,2BAA0B,CAAC"}
@@ -11,7 +11,7 @@ let src_provider_nativeClientSync = require("./nativeClientSync");
11
11
  //#region src/provider/ClerkProvider.tsx
12
12
  const SDK_METADATA = {
13
13
  name: "@clerk/expo",
14
- version: "4.8.0-snapshot.v20260930211104"
14
+ version: "4.8.0"
15
15
  };
16
16
  function ClerkProvider(props) {
17
17
  const { children, tokenCache, publishableKey, proxyUrl, domain, __experimental_passkeys, experimental, __experimental_resourceCache, __experimental_disableNativeClientSync = false, ...rest } = props;
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ let _clerk_shared_deprecated = require("@clerk/shared/deprecated");
2
3
  let src_biometric_credentials_useBiometricCredentials = require("../biometric-credentials/useBiometricCredentials");
3
4
  let react = require("react");
4
- let _clerk_shared_deprecated = require("@clerk/shared/deprecated");
5
5
  let src_trusted_devices_compatibility = require("./compatibility");
6
6
 
7
7
  //#region src/trusted-devices/useTrustedDevices.ts
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ let _clerk_shared_deprecated = require("@clerk/shared/deprecated");
2
3
  let src_biometric_credentials_useBiometricCredentials_shared = require("../biometric-credentials/useBiometricCredentials.shared");
3
4
  let react = require("react");
4
- let _clerk_shared_deprecated = require("@clerk/shared/deprecated");
5
5
  let src_trusted_devices_compatibility = require("./compatibility");
6
6
 
7
7
  //#region src/trusted-devices/useTrustedDevices.shared.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clerk/expo",
3
- "version": "4.8.0-snapshot.v20260930211104",
3
+ "version": "4.8.0",
4
4
  "description": "Clerk React Native/Expo library",
5
5
  "keywords": [
6
6
  "react",
@@ -61,6 +61,10 @@
61
61
  "types": "./dist/apple/index.d.ts",
62
62
  "default": "./dist/apple/index.js"
63
63
  },
64
+ "./biometrics": {
65
+ "types": "./dist/biometrics/index.d.ts",
66
+ "default": "./dist/biometrics/index.js"
67
+ },
64
68
  "./hosted-auth": {
65
69
  "types": "./dist/hosted-auth/index.d.ts",
66
70
  "default": "./dist/hosted-auth/index.js"
@@ -96,6 +100,7 @@
96
100
  "token-cache",
97
101
  "google",
98
102
  "apple",
103
+ "biometrics",
99
104
  "hosted-auth",
100
105
  "experimental",
101
106
  "legacy",
@@ -109,9 +114,9 @@
109
114
  "base-64": "^1.0.0",
110
115
  "react-native-url-polyfill": "4.0.0",
111
116
  "tslib": "2.8.1",
112
- "@clerk/clerk-js": "6.36.0-snapshot.v20260930211104",
113
- "@clerk/react": "6.17.4-snapshot.v20260930211104",
114
- "@clerk/shared": "4.38.0-snapshot.v20260930211104"
117
+ "@clerk/clerk-js": "^6.37.0",
118
+ "@clerk/react": "^6.17.5",
119
+ "@clerk/shared": "^4.38.0"
115
120
  },
116
121
  "devDependencies": {
117
122
  "@expo/config-plugins": "^54.0.4",
@@ -125,14 +130,14 @@
125
130
  "expo-secure-store": "^15.0.8",
126
131
  "expo-web-browser": "^15.0.11",
127
132
  "react-native": "^0.86.0",
128
- "@clerk/expo-google-signin": "1.0.5-snapshot.v20260930211104",
129
- "@clerk/expo-biometrics": "0.1.0-snapshot.v20260930211104",
130
- "@clerk/expo-passkeys": "2.0.25-snapshot.v20260930211104"
133
+ "@clerk/expo-biometrics": "1.0.0",
134
+ "@clerk/expo-google-signin": "1.0.4",
135
+ "@clerk/expo-passkeys": "2.0.26"
131
136
  },
132
137
  "peerDependencies": {
133
- "@clerk/expo-biometrics": "0.1.0-snapshot.v20260930211104",
134
- "@clerk/expo-google-signin": "1.0.5-snapshot.v20260930211104",
135
- "@clerk/expo-passkeys": "2.0.25-snapshot.v20260930211104",
138
+ "@clerk/expo-biometrics": ">=0.1.0",
139
+ "@clerk/expo-google-signin": ">=0.1.0",
140
+ "@clerk/expo-passkeys": ">=0.0.6",
136
141
  "expo": ">=54 <58",
137
142
  "expo-apple-authentication": ">=7.0.0",
138
143
  "expo-auth-session": ">=5",