@clerk/expo 3.2.8-snapshot.v20260501171802 → 3.2.8
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.
package/dist/errorThrower.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClerkProvider.d.ts","sourceRoot":"","sources":["../../src/provider/ClerkProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,kBAAkB,IAAI,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAElF,OAAO,EAA+C,KAAK,EAAE,EAAE,MAAM,uBAAuB,CAAC;AAI7F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,MAAM,kBAAkB,CAAC,GAAG,SAAS,EAAE,GAAG,EAAE,IAAI,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,EAAE,gBAAgB,CAAC,GAAG;IAC3G;;;;;;;;;;OAUG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE,iBAAiB,CAAC,yBAAyB,CAAC,CAAC;IACvE;;;;OAIG;IACH,4BAA4B,CAAC,EAAE,iBAAiB,CAAC,8BAA8B,CAAC,CAAC;CAClF,CAAC;
|
|
1
|
+
{"version":3,"file":"ClerkProvider.d.ts","sourceRoot":"","sources":["../../src/provider/ClerkProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,kBAAkB,IAAI,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAElF,OAAO,EAA+C,KAAK,EAAE,EAAE,MAAM,uBAAuB,CAAC;AAI7F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,MAAM,kBAAkB,CAAC,GAAG,SAAS,EAAE,GAAG,EAAE,IAAI,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,EAAE,gBAAgB,CAAC,GAAG;IAC3G;;;;;;;;;;OAUG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE,iBAAiB,CAAC,yBAAyB,CAAC,CAAC;IACvE;;;;OAIG;IACH,4BAA4B,CAAC,EAAE,iBAAiB,CAAC,8BAA8B,CAAC,CAAC;CAClF,CAAC;AA8FF,wBAAgB,aAAa,CAAC,GAAG,SAAS,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,kBAAkB,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,OAAO,CAiR9F"}
|
|
@@ -45,25 +45,27 @@ var import_runtime = require("../utils/runtime");
|
|
|
45
45
|
var import_singleton = require("./singleton");
|
|
46
46
|
const SDK_METADATA = {
|
|
47
47
|
name: "@clerk/expo",
|
|
48
|
-
version: "3.2.8
|
|
48
|
+
version: "3.2.8"
|
|
49
49
|
};
|
|
50
50
|
function NativeSessionSync({
|
|
51
51
|
publishableKey,
|
|
52
52
|
tokenCache
|
|
53
53
|
}) {
|
|
54
|
-
const { isSignedIn } = (0, import_react.useAuth)();
|
|
54
|
+
const { isSignedIn, isLoaded } = (0, import_react.useAuth)();
|
|
55
55
|
const hasSyncedRef = (0, import_react2.useRef)(false);
|
|
56
56
|
const effectiveTokenCache = tokenCache != null ? tokenCache : import_token_cache.tokenCache;
|
|
57
57
|
(0, import_react2.useEffect)(() => {
|
|
58
58
|
if (!isSignedIn) {
|
|
59
59
|
hasSyncedRef.current = false;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
void ClerkExpo.signOut
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
if (isLoaded) {
|
|
61
|
+
const ClerkExpo = import_NativeClerkModule.default;
|
|
62
|
+
if (ClerkExpo == null ? void 0 : ClerkExpo.signOut) {
|
|
63
|
+
void ClerkExpo.signOut().catch((error) => {
|
|
64
|
+
if (false) {
|
|
65
|
+
console.warn("[NativeSessionSync] Failed to clear native session:", error);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
67
69
|
}
|
|
68
70
|
return;
|
|
69
71
|
}
|
|
@@ -95,7 +97,7 @@ function NativeSessionSync({
|
|
|
95
97
|
}
|
|
96
98
|
};
|
|
97
99
|
void syncToNative();
|
|
98
|
-
}, [isSignedIn, publishableKey, effectiveTokenCache]);
|
|
100
|
+
}, [isSignedIn, isLoaded, publishableKey, effectiveTokenCache]);
|
|
99
101
|
return null;
|
|
100
102
|
}
|
|
101
103
|
function ClerkProvider(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/provider/ClerkProvider.tsx"],"sourcesContent":["import '../polyfills';\n\nimport type { ClerkProviderProps as ReactClerkProviderProps } from '@clerk/react';\nimport { useAuth } from '@clerk/react';\nimport { InternalClerkProvider as ClerkReactProvider, type Ui } from '@clerk/react/internal';\nimport { useEffect, useRef } from 'react';\nimport { Platform } from 'react-native';\n\nimport type { TokenCache } from '../cache/types';\nimport { CLERK_CLIENT_JWT_KEY } from '../constants';\nimport { useNativeAuthEvents } from '../hooks/useNativeAuthEvents';\nimport NativeClerkModule from '../specs/NativeClerkModule';\nimport { tokenCache as defaultTokenCache } from '../token-cache';\nimport { isNative, isWeb } from '../utils/runtime';\nimport { getClerkInstance } from './singleton';\nimport type { BuildClerkOptions } from './singleton/types';\n\nexport type ClerkProviderProps<TUi extends Ui = Ui> = Omit<ReactClerkProviderProps<TUi>, 'publishableKey'> & {\n /**\n * Your Clerk publishable key, available in the Clerk Dashboard.\n * This is required for React Native / Expo apps. Environment variables inside node_modules\n * are not inlined during production builds, so the key must be passed explicitly.\n *\n * @example\n * ```tsx\n * const publishableKey = process.env.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY!;\n * <ClerkProvider publishableKey={publishableKey}>\n * ```\n */\n publishableKey: string;\n /**\n * The token cache is used to persist the active user's session token. Clerk stores this token in memory by default, however it is recommended to use a token cache for production applications.\n * @see https://clerk.com/docs/quickstarts/expo#configure-the-token-cache-with-expo\n */\n tokenCache?: TokenCache;\n /**\n * Note: Passkey support in Expo is currently in a limited rollout phase.\n * If you're interested in using this feature, please contact us for early access or additional details.\n *\n * @experimental This API is experimental and may change at any moment.\n */\n __experimental_passkeys?: BuildClerkOptions['__experimental_passkeys'];\n /**\n * This cache is used to store the resources that Clerk fetches from the server when the network is offline.\n *\n * @experimental This API is experimental and may change at any moment.\n */\n __experimental_resourceCache?: BuildClerkOptions['__experimental_resourceCache'];\n};\n\nconst SDK_METADATA = {\n name: PACKAGE_NAME,\n version: PACKAGE_VERSION,\n};\n\n/**\n * Syncs JS SDK auth state to the native Clerk SDK.\n *\n * When a user authenticates via the JS SDK (custom sign-in forms, useSignIn, etc.)\n * rather than through native `<AuthView />`, the native SDK doesn't know about the\n * session. This component watches for JS auth state changes and pushes the bearer\n * token to the native SDK so native components (UserButton, UserProfileView) work.\n *\n * Must be rendered inside `ClerkReactProvider` so `useAuth()` has access to context.\n */\nfunction NativeSessionSync({\n publishableKey,\n tokenCache,\n}: {\n publishableKey: string;\n tokenCache: TokenCache | undefined;\n}) {\n const { isSignedIn } = useAuth();\n const hasSyncedRef = useRef(false);\n // Use the provided tokenCache, falling back to the default SecureStore cache\n const effectiveTokenCache = tokenCache ?? defaultTokenCache;\n\n useEffect(() => {\n if (!isSignedIn) {\n hasSyncedRef.current = false;\n\n // Clear the native session so native components (UserButton, etc.)\n // don't continue showing a signed-in state after JS-side sign out.\n const ClerkExpo = NativeClerkModule;\n if (ClerkExpo?.signOut) {\n void ClerkExpo.signOut().catch((error: unknown) => {\n if (__DEV__) {\n console.warn('[NativeSessionSync] Failed to clear native session:', error);\n }\n });\n }\n\n return;\n }\n\n if (hasSyncedRef.current) {\n return;\n }\n\n const syncToNative = async () => {\n try {\n const ClerkExpo = NativeClerkModule;\n if (!ClerkExpo?.configure || !ClerkExpo?.getSession) {\n return;\n }\n\n // Check if native already has a session (e.g. auth via AuthView or initial load)\n const nativeSession = (await ClerkExpo.getSession()) as {\n sessionId?: string;\n session?: { id: string };\n } | null;\n const hasNativeSession = !!(nativeSession?.sessionId || nativeSession?.session?.id);\n\n if (hasNativeSession) {\n hasSyncedRef.current = true;\n return;\n }\n\n // Read the JS SDK's client JWT and push it to the native SDK\n const bearerToken = (await effectiveTokenCache?.getToken(CLERK_CLIENT_JWT_KEY)) ?? null;\n if (bearerToken) {\n await ClerkExpo.configure(publishableKey, bearerToken);\n hasSyncedRef.current = true;\n }\n } catch (error) {\n if (__DEV__) {\n console.warn('[NativeSessionSync] Failed to sync JS session to native:', error);\n }\n }\n };\n\n void syncToNative();\n }, [isSignedIn, publishableKey, effectiveTokenCache]);\n\n return null;\n}\n\nexport function ClerkProvider<TUi extends Ui = Ui>(props: ClerkProviderProps<TUi>): JSX.Element {\n const {\n children,\n tokenCache,\n publishableKey,\n proxyUrl,\n domain,\n __experimental_passkeys,\n experimental,\n __experimental_resourceCache,\n ...rest\n } = props;\n const pk = publishableKey;\n\n // Track pending native session to sync after clerk loads\n const pendingNativeSessionRef = useRef<string | null>(null);\n const initStartedRef = useRef(false);\n const sessionSyncedRef = useRef(false);\n // Reset refs when publishable key changes (hot-swap support)\n useEffect(() => {\n pendingNativeSessionRef.current = null;\n initStartedRef.current = false;\n sessionSyncedRef.current = false;\n }, [pk]);\n\n // Get the Clerk instance for syncing\n const clerkInstance = isNative()\n ? getClerkInstance({\n publishableKey: pk,\n tokenCache,\n proxyUrl,\n domain,\n __experimental_passkeys,\n __experimental_resourceCache,\n })\n : null;\n\n // Track whether the component is still mounted\n const isMountedRef = useRef(true);\n\n // Configure native Clerk SDK and set up session sync callback\n useEffect(() => {\n isMountedRef.current = true;\n\n if ((Platform.OS === 'ios' || Platform.OS === 'android') && pk && !initStartedRef.current) {\n initStartedRef.current = true;\n\n const configureNativeClerk = async () => {\n try {\n const ClerkExpo = NativeClerkModule;\n\n if (ClerkExpo?.configure) {\n // Read the JS SDK's client JWT to sync with the native SDK.\n // Use the user-provided tokenCache so custom caches are honored.\n const effectiveTokenCache = tokenCache ?? defaultTokenCache;\n let bearerToken: string | null = null;\n try {\n bearerToken = (await effectiveTokenCache?.getToken(CLERK_CLIENT_JWT_KEY)) ?? null;\n } catch (e) {\n if (__DEV__) {\n console.warn('[ClerkProvider] Token cache read failed:', e);\n }\n }\n\n // Always configure the native SDK on launch, even without a token.\n // The iOS SDK requires Clerk.configure() before Clerk.shared can be accessed.\n // If we have a bearer token, pass it so the native SDK picks up the JS session.\n await ClerkExpo.configure(pk, bearerToken);\n\n if (!isMountedRef.current) {\n return;\n }\n\n // Poll for native session (matching iOS's 3-second max wait)\n const MAX_WAIT_MS = 3000;\n const POLL_INTERVAL_MS = 100;\n let sessionId: string | null = null;\n\n for (let elapsed = 0; elapsed < MAX_WAIT_MS; elapsed += POLL_INTERVAL_MS) {\n if (!isMountedRef.current) {\n return;\n }\n if (ClerkExpo?.getSession) {\n const nativeSession = (await ClerkExpo.getSession()) as {\n sessionId?: string;\n session?: { id: string };\n } | null;\n // Normalize: iOS returns { sessionId }, Android returns { session: { id } }\n sessionId = nativeSession?.sessionId ?? nativeSession?.session?.id ?? null;\n if (sessionId) {\n break;\n }\n }\n await new Promise(resolve => setTimeout(resolve, POLL_INTERVAL_MS));\n }\n\n if (!isMountedRef.current) {\n return;\n }\n\n if (sessionId && clerkInstance) {\n pendingNativeSessionRef.current = sessionId;\n\n // Wait for clerk to be loaded before syncing\n const clerkAny = clerkInstance as any;\n\n const waitForLoad = (): Promise<void> => {\n return new Promise(resolve => {\n if (clerkAny.loaded) {\n resolve();\n } else if (typeof clerkAny.addOnLoaded === 'function') {\n clerkAny.addOnLoaded(() => resolve());\n } else {\n if (__DEV__) {\n console.warn('[ClerkProvider] Clerk instance has no loaded property or addOnLoaded method');\n }\n resolve();\n }\n });\n };\n\n await waitForLoad();\n\n if (!isMountedRef.current) {\n return;\n }\n\n if (!sessionSyncedRef.current && typeof clerkInstance.setActive === 'function') {\n sessionSyncedRef.current = true;\n const pendingSession = pendingNativeSessionRef.current;\n\n // If the native session is not in the client's sessions list,\n // reload the client from the API so setActive can find it.\n const sessionInClient = clerkInstance.client?.sessions?.some(\n (s: { id: string }) => s.id === pendingSession,\n );\n if (!sessionInClient && typeof clerkAny.__internal_reloadInitialResources === 'function') {\n await clerkAny.__internal_reloadInitialResources();\n }\n\n try {\n await clerkInstance.setActive({ session: pendingSession });\n } catch (err) {\n if (__DEV__) {\n console.error(`[ClerkProvider] Failed to sync native session:`, err);\n }\n }\n }\n }\n }\n } catch (error) {\n const isNativeModuleNotFound =\n error instanceof Error &&\n (error.message.includes('Cannot find native module') ||\n error.message.includes(\"TurboModuleRegistry.getEnforcing(...): 'ClerkExpo'\"));\n if (isNativeModuleNotFound) {\n if (__DEV__) {\n console.debug(\n `[ClerkProvider] Native Clerk module not available. ` +\n `To enable native features, add \"@clerk/expo\" to your app.json plugins array.`,\n );\n }\n } else if (__DEV__) {\n console.error(`[ClerkProvider] Failed to configure Clerk ${Platform.OS}:`, error);\n }\n }\n };\n void configureNativeClerk();\n }\n\n return () => {\n isMountedRef.current = false;\n };\n }, [pk, clerkInstance]);\n\n // Listen for native auth state changes and sync to JS SDK\n const { nativeAuthState } = useNativeAuthEvents();\n\n useEffect(() => {\n if (!nativeAuthState || !clerkInstance) {\n return;\n }\n\n const syncNativeAuthToJs = async () => {\n try {\n if (nativeAuthState.type === 'signedIn' && nativeAuthState.sessionId && clerkInstance.setActive) {\n // Copy the native client's bearer token to the JS SDK's token cache\n // so API requests use the native client (which has the session).\n const ClerkExpo = NativeClerkModule;\n if (ClerkExpo?.getClientToken) {\n const nativeClientToken = await ClerkExpo.getClientToken();\n if (nativeClientToken) {\n const effectiveTokenCache = tokenCache ?? defaultTokenCache;\n await effectiveTokenCache?.saveToken(CLERK_CLIENT_JWT_KEY, nativeClientToken);\n }\n }\n\n // Ensure the session exists in the client before calling setActive\n const sessionInClient = clerkInstance.client?.sessions?.some(\n (s: { id: string }) => s.id === nativeAuthState.sessionId,\n );\n if (!sessionInClient) {\n const clerkAny = clerkInstance as any;\n if (typeof clerkAny.__internal_reloadInitialResources === 'function') {\n await clerkAny.__internal_reloadInitialResources();\n }\n if (!isMountedRef.current) {\n return;\n }\n }\n\n if (!isMountedRef.current) {\n return;\n }\n await clerkInstance.setActive({ session: nativeAuthState.sessionId });\n } else if (nativeAuthState.type === 'signedOut' && clerkInstance.signOut) {\n if (!isMountedRef.current) {\n return;\n }\n await clerkInstance.signOut();\n }\n } catch (error) {\n if (__DEV__) {\n console.error(`[ClerkProvider] Failed to sync native auth state:`, error);\n }\n }\n };\n\n void syncNativeAuthToJs();\n }, [nativeAuthState, clerkInstance]);\n\n if (isWeb()) {\n // This is needed in order for useOAuth to work correctly on web.\n // Must stay synchronous during render to catch the redirect URL before children mount.\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const WebBrowser = require('expo-web-browser');\n WebBrowser.maybeCompleteAuthSession();\n } catch (e) {\n if (__DEV__) {\n console.warn('[ClerkProvider] expo-web-browser not available, OAuth/SSO on web will not work:', e);\n }\n }\n }\n\n return (\n <ClerkReactProvider\n // Force reset the state when the provided key changes, this ensures that the provider does not retain stale state.\n // See JS-598 for additional context.\n key={pk}\n {...rest}\n publishableKey={pk}\n proxyUrl={proxyUrl}\n domain={domain}\n sdkMetadata={SDK_METADATA}\n Clerk={clerkInstance}\n standardBrowser={!isNative()}\n experimental={{\n ...experimental,\n // force the rethrowOfflineNetworkErrors flag to true if the asyncStorage is provided\n rethrowOfflineNetworkErrors: !!__experimental_resourceCache || experimental?.rethrowOfflineNetworkErrors,\n ...(isNative() && { runtimeEnvironment: 'headless' as const }),\n }}\n >\n {isNative() && (\n <NativeSessionSync\n publishableKey={pk}\n tokenCache={tokenCache}\n />\n )}\n {children}\n </ClerkReactProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+XI;AA/XJ,uBAAO;AAGP,mBAAwB;AACxB,sBAAqE;AACrE,IAAAA,gBAAkC;AAClC,0BAAyB;AAGzB,uBAAqC;AACrC,iCAAoC;AACpC,+BAA8B;AAC9B,yBAAgD;AAChD,qBAAgC;AAChC,uBAAiC;AAoCjC,MAAM,eAAe;AAAA,EACnB,MAAM;AAAA,EACN,SAAS;AACX;AAYA,SAAS,kBAAkB;AAAA,EACzB;AAAA,EACA;AACF,GAGG;AACD,QAAM,EAAE,WAAW,QAAI,sBAAQ;AAC/B,QAAM,mBAAe,sBAAO,KAAK;AAEjC,QAAM,sBAAsB,kCAAc,mBAAAC;AAE1C,+BAAU,MAAM;AACd,QAAI,CAAC,YAAY;AACf,mBAAa,UAAU;AAIvB,YAAM,YAAY,yBAAAC;AAClB,UAAI,uCAAW,SAAS;AACtB,aAAK,UAAU,QAAQ,EAAE,MAAM,CAAC,UAAmB;AACjD,cAAI,OAAS;AACX,oBAAQ,KAAK,uDAAuD,KAAK;AAAA,UAC3E;AAAA,QACF,CAAC;AAAA,MACH;AAEA;AAAA,IACF;AAEA,QAAI,aAAa,SAAS;AACxB;AAAA,IACF;AAEA,UAAM,eAAe,YAAY;AAnGrC;AAoGM,UAAI;AACF,cAAM,YAAY,yBAAAA;AAClB,YAAI,EAAC,uCAAW,cAAa,EAAC,uCAAW,aAAY;AACnD;AAAA,QACF;AAGA,cAAM,gBAAiB,MAAM,UAAU,WAAW;AAIlD,cAAM,mBAAmB,CAAC,GAAE,+CAAe,gBAAa,oDAAe,YAAf,mBAAwB;AAEhF,YAAI,kBAAkB;AACpB,uBAAa,UAAU;AACvB;AAAA,QACF;AAGA,cAAM,eAAe,YA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,yBAAS,KAAK,EAAE,oBAAoB,WAAoB;AAAA,MAC9D;AAAA,MAEC;AAAA,qCAAS,KACR;AAAA,UAAC;AAAA;AAAA,YACC,gBAAgB;AAAA,YAChB;AAAA;AAAA,QACF;AAAA,QAED;AAAA;AAAA;AAAA,IArBI;AAAA,EAsBP;AAEJ;","names":["import_react","defaultTokenCache","NativeClerkModule","ClerkReactProvider"]}
|
|
1
|
+
{"version":3,"sources":["../../src/provider/ClerkProvider.tsx"],"sourcesContent":["import '../polyfills';\n\nimport type { ClerkProviderProps as ReactClerkProviderProps } from '@clerk/react';\nimport { useAuth } from '@clerk/react';\nimport { InternalClerkProvider as ClerkReactProvider, type Ui } from '@clerk/react/internal';\nimport { useEffect, useRef } from 'react';\nimport { Platform } from 'react-native';\n\nimport type { TokenCache } from '../cache/types';\nimport { CLERK_CLIENT_JWT_KEY } from '../constants';\nimport { useNativeAuthEvents } from '../hooks/useNativeAuthEvents';\nimport NativeClerkModule from '../specs/NativeClerkModule';\nimport { tokenCache as defaultTokenCache } from '../token-cache';\nimport { isNative, isWeb } from '../utils/runtime';\nimport { getClerkInstance } from './singleton';\nimport type { BuildClerkOptions } from './singleton/types';\n\nexport type ClerkProviderProps<TUi extends Ui = Ui> = Omit<ReactClerkProviderProps<TUi>, 'publishableKey'> & {\n /**\n * Your Clerk publishable key, available in the Clerk Dashboard.\n * This is required for React Native / Expo apps. Environment variables inside node_modules\n * are not inlined during production builds, so the key must be passed explicitly.\n *\n * @example\n * ```tsx\n * const publishableKey = process.env.EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY!;\n * <ClerkProvider publishableKey={publishableKey}>\n * ```\n */\n publishableKey: string;\n /**\n * The token cache is used to persist the active user's session token. Clerk stores this token in memory by default, however it is recommended to use a token cache for production applications.\n * @see https://clerk.com/docs/quickstarts/expo#configure-the-token-cache-with-expo\n */\n tokenCache?: TokenCache;\n /**\n * Note: Passkey support in Expo is currently in a limited rollout phase.\n * If you're interested in using this feature, please contact us for early access or additional details.\n *\n * @experimental This API is experimental and may change at any moment.\n */\n __experimental_passkeys?: BuildClerkOptions['__experimental_passkeys'];\n /**\n * This cache is used to store the resources that Clerk fetches from the server when the network is offline.\n *\n * @experimental This API is experimental and may change at any moment.\n */\n __experimental_resourceCache?: BuildClerkOptions['__experimental_resourceCache'];\n};\n\nconst SDK_METADATA = {\n name: PACKAGE_NAME,\n version: PACKAGE_VERSION,\n};\n\n/**\n * Syncs JS SDK auth state to the native Clerk SDK.\n *\n * When a user authenticates via the JS SDK (custom sign-in forms, useSignIn, etc.)\n * rather than through native `<AuthView />`, the native SDK doesn't know about the\n * session. This component watches for JS auth state changes and pushes the bearer\n * token to the native SDK so native components (UserButton, UserProfileView) work.\n *\n * Must be rendered inside `ClerkReactProvider` so `useAuth()` has access to context.\n */\nfunction NativeSessionSync({\n publishableKey,\n tokenCache,\n}: {\n publishableKey: string;\n tokenCache: TokenCache | undefined;\n}) {\n const { isSignedIn, isLoaded } = useAuth();\n const hasSyncedRef = useRef(false);\n // Use the provided tokenCache, falling back to the default SecureStore cache\n const effectiveTokenCache = tokenCache ?? defaultTokenCache;\n\n useEffect(() => {\n if (!isSignedIn) {\n hasSyncedRef.current = false;\n\n // Only call native signOut when Clerk has fully loaded and confirmed\n // the user is actually signed out. Without this check, a JS reload\n // (e.g. pressing R in Expo) triggers signOut during the loading phase\n // (when isSignedIn is undefined), which revokes the session server-side\n // and clears all keychain items, forcing the user to log in again.\n if (isLoaded) {\n const ClerkExpo = NativeClerkModule;\n if (ClerkExpo?.signOut) {\n void ClerkExpo.signOut().catch((error: unknown) => {\n if (__DEV__) {\n console.warn('[NativeSessionSync] Failed to clear native session:', error);\n }\n });\n }\n }\n\n return;\n }\n\n if (hasSyncedRef.current) {\n return;\n }\n\n const syncToNative = async () => {\n try {\n const ClerkExpo = NativeClerkModule;\n if (!ClerkExpo?.configure || !ClerkExpo?.getSession) {\n return;\n }\n\n // Check if native already has a session (e.g. auth via AuthView or initial load)\n const nativeSession = (await ClerkExpo.getSession()) as {\n sessionId?: string;\n session?: { id: string };\n } | null;\n const hasNativeSession = !!(nativeSession?.sessionId || nativeSession?.session?.id);\n\n if (hasNativeSession) {\n hasSyncedRef.current = true;\n return;\n }\n\n // Read the JS SDK's client JWT and push it to the native SDK\n const bearerToken = (await effectiveTokenCache?.getToken(CLERK_CLIENT_JWT_KEY)) ?? null;\n if (bearerToken) {\n await ClerkExpo.configure(publishableKey, bearerToken);\n hasSyncedRef.current = true;\n }\n } catch (error) {\n if (__DEV__) {\n console.warn('[NativeSessionSync] Failed to sync JS session to native:', error);\n }\n }\n };\n\n void syncToNative();\n }, [isSignedIn, isLoaded, publishableKey, effectiveTokenCache]);\n\n return null;\n}\n\nexport function ClerkProvider<TUi extends Ui = Ui>(props: ClerkProviderProps<TUi>): JSX.Element {\n const {\n children,\n tokenCache,\n publishableKey,\n proxyUrl,\n domain,\n __experimental_passkeys,\n experimental,\n __experimental_resourceCache,\n ...rest\n } = props;\n const pk = publishableKey;\n\n // Track pending native session to sync after clerk loads\n const pendingNativeSessionRef = useRef<string | null>(null);\n const initStartedRef = useRef(false);\n const sessionSyncedRef = useRef(false);\n // Reset refs when publishable key changes (hot-swap support)\n useEffect(() => {\n pendingNativeSessionRef.current = null;\n initStartedRef.current = false;\n sessionSyncedRef.current = false;\n }, [pk]);\n\n // Get the Clerk instance for syncing\n const clerkInstance = isNative()\n ? getClerkInstance({\n publishableKey: pk,\n tokenCache,\n proxyUrl,\n domain,\n __experimental_passkeys,\n __experimental_resourceCache,\n })\n : null;\n\n // Track whether the component is still mounted\n const isMountedRef = useRef(true);\n\n // Configure native Clerk SDK and set up session sync callback\n useEffect(() => {\n isMountedRef.current = true;\n\n if ((Platform.OS === 'ios' || Platform.OS === 'android') && pk && !initStartedRef.current) {\n initStartedRef.current = true;\n\n const configureNativeClerk = async () => {\n try {\n const ClerkExpo = NativeClerkModule;\n\n if (ClerkExpo?.configure) {\n // Read the JS SDK's client JWT to sync with the native SDK.\n // Use the user-provided tokenCache so custom caches are honored.\n const effectiveTokenCache = tokenCache ?? defaultTokenCache;\n let bearerToken: string | null = null;\n try {\n bearerToken = (await effectiveTokenCache?.getToken(CLERK_CLIENT_JWT_KEY)) ?? null;\n } catch (e) {\n if (__DEV__) {\n console.warn('[ClerkProvider] Token cache read failed:', e);\n }\n }\n\n // Always configure the native SDK on launch, even without a token.\n // The iOS SDK requires Clerk.configure() before Clerk.shared can be accessed.\n // If we have a bearer token, pass it so the native SDK picks up the JS session.\n await ClerkExpo.configure(pk, bearerToken);\n\n if (!isMountedRef.current) {\n return;\n }\n\n // Poll for native session (matching iOS's 3-second max wait)\n const MAX_WAIT_MS = 3000;\n const POLL_INTERVAL_MS = 100;\n let sessionId: string | null = null;\n\n for (let elapsed = 0; elapsed < MAX_WAIT_MS; elapsed += POLL_INTERVAL_MS) {\n if (!isMountedRef.current) {\n return;\n }\n if (ClerkExpo?.getSession) {\n const nativeSession = (await ClerkExpo.getSession()) as {\n sessionId?: string;\n session?: { id: string };\n } | null;\n // Normalize: iOS returns { sessionId }, Android returns { session: { id } }\n sessionId = nativeSession?.sessionId ?? nativeSession?.session?.id ?? null;\n if (sessionId) {\n break;\n }\n }\n await new Promise(resolve => setTimeout(resolve, POLL_INTERVAL_MS));\n }\n\n if (!isMountedRef.current) {\n return;\n }\n\n if (sessionId && clerkInstance) {\n pendingNativeSessionRef.current = sessionId;\n\n // Wait for clerk to be loaded before syncing\n const clerkAny = clerkInstance as any;\n\n const waitForLoad = (): Promise<void> => {\n return new Promise(resolve => {\n if (clerkAny.loaded) {\n resolve();\n } else if (typeof clerkAny.addOnLoaded === 'function') {\n clerkAny.addOnLoaded(() => resolve());\n } else {\n if (__DEV__) {\n console.warn('[ClerkProvider] Clerk instance has no loaded property or addOnLoaded method');\n }\n resolve();\n }\n });\n };\n\n await waitForLoad();\n\n if (!isMountedRef.current) {\n return;\n }\n\n if (!sessionSyncedRef.current && typeof clerkInstance.setActive === 'function') {\n sessionSyncedRef.current = true;\n const pendingSession = pendingNativeSessionRef.current;\n\n // If the native session is not in the client's sessions list,\n // reload the client from the API so setActive can find it.\n const sessionInClient = clerkInstance.client?.sessions?.some(\n (s: { id: string }) => s.id === pendingSession,\n );\n if (!sessionInClient && typeof clerkAny.__internal_reloadInitialResources === 'function') {\n await clerkAny.__internal_reloadInitialResources();\n }\n\n try {\n await clerkInstance.setActive({ session: pendingSession });\n } catch (err) {\n if (__DEV__) {\n console.error(`[ClerkProvider] Failed to sync native session:`, err);\n }\n }\n }\n }\n }\n } catch (error) {\n const isNativeModuleNotFound =\n error instanceof Error &&\n (error.message.includes('Cannot find native module') ||\n error.message.includes(\"TurboModuleRegistry.getEnforcing(...): 'ClerkExpo'\"));\n if (isNativeModuleNotFound) {\n if (__DEV__) {\n console.debug(\n `[ClerkProvider] Native Clerk module not available. ` +\n `To enable native features, add \"@clerk/expo\" to your app.json plugins array.`,\n );\n }\n } else if (__DEV__) {\n console.error(`[ClerkProvider] Failed to configure Clerk ${Platform.OS}:`, error);\n }\n }\n };\n void configureNativeClerk();\n }\n\n return () => {\n isMountedRef.current = false;\n };\n }, [pk, clerkInstance]);\n\n // Listen for native auth state changes and sync to JS SDK\n const { nativeAuthState } = useNativeAuthEvents();\n\n useEffect(() => {\n if (!nativeAuthState || !clerkInstance) {\n return;\n }\n\n const syncNativeAuthToJs = async () => {\n try {\n if (nativeAuthState.type === 'signedIn' && nativeAuthState.sessionId && clerkInstance.setActive) {\n // Copy the native client's bearer token to the JS SDK's token cache\n // so API requests use the native client (which has the session).\n const ClerkExpo = NativeClerkModule;\n if (ClerkExpo?.getClientToken) {\n const nativeClientToken = await ClerkExpo.getClientToken();\n if (nativeClientToken) {\n const effectiveTokenCache = tokenCache ?? defaultTokenCache;\n await effectiveTokenCache?.saveToken(CLERK_CLIENT_JWT_KEY, nativeClientToken);\n }\n }\n\n // Ensure the session exists in the client before calling setActive\n const sessionInClient = clerkInstance.client?.sessions?.some(\n (s: { id: string }) => s.id === nativeAuthState.sessionId,\n );\n if (!sessionInClient) {\n const clerkAny = clerkInstance as any;\n if (typeof clerkAny.__internal_reloadInitialResources === 'function') {\n await clerkAny.__internal_reloadInitialResources();\n }\n if (!isMountedRef.current) {\n return;\n }\n }\n\n if (!isMountedRef.current) {\n return;\n }\n await clerkInstance.setActive({ session: nativeAuthState.sessionId });\n } else if (nativeAuthState.type === 'signedOut' && clerkInstance.signOut) {\n if (!isMountedRef.current) {\n return;\n }\n await clerkInstance.signOut();\n }\n } catch (error) {\n if (__DEV__) {\n console.error(`[ClerkProvider] Failed to sync native auth state:`, error);\n }\n }\n };\n\n void syncNativeAuthToJs();\n }, [nativeAuthState, clerkInstance]);\n\n if (isWeb()) {\n // This is needed in order for useOAuth to work correctly on web.\n // Must stay synchronous during render to catch the redirect URL before children mount.\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const WebBrowser = require('expo-web-browser');\n WebBrowser.maybeCompleteAuthSession();\n } catch (e) {\n if (__DEV__) {\n console.warn('[ClerkProvider] expo-web-browser not available, OAuth/SSO on web will not work:', e);\n }\n }\n }\n\n return (\n <ClerkReactProvider\n // Force reset the state when the provided key changes, this ensures that the provider does not retain stale state.\n // See JS-598 for additional context.\n key={pk}\n {...rest}\n publishableKey={pk}\n proxyUrl={proxyUrl}\n domain={domain}\n sdkMetadata={SDK_METADATA}\n Clerk={clerkInstance}\n standardBrowser={!isNative()}\n experimental={{\n ...experimental,\n // force the rethrowOfflineNetworkErrors flag to true if the asyncStorage is provided\n rethrowOfflineNetworkErrors: !!__experimental_resourceCache || experimental?.rethrowOfflineNetworkErrors,\n ...(isNative() && { runtimeEnvironment: 'headless' as const }),\n }}\n >\n {isNative() && (\n <NativeSessionSync\n publishableKey={pk}\n tokenCache={tokenCache}\n />\n )}\n {children}\n </ClerkReactProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoYI;AApYJ,uBAAO;AAGP,mBAAwB;AACxB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AEJ;","names":["import_react","defaultTokenCache","NativeClerkModule","ClerkReactProvider"]}
|
package/dist/utils/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { DomainOrProxyUrl } from '@clerk/shared/types';
|
|
2
|
-
export declare const errorThrower: import("@clerk/shared/index-
|
|
2
|
+
export declare const errorThrower: import("@clerk/shared/index-D4413SlB").ar;
|
|
3
3
|
export declare const assertValidProxyUrl: (proxyUrl: DomainOrProxyUrl["proxyUrl"]) => void;
|
|
4
4
|
//# sourceMappingURL=errors.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clerk/expo",
|
|
3
|
-
"version": "3.2.8
|
|
3
|
+
"version": "3.2.8",
|
|
4
4
|
"description": "Clerk React Native/Expo library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -104,9 +104,9 @@
|
|
|
104
104
|
"base-64": "^1.0.0",
|
|
105
105
|
"react-native-url-polyfill": "2.0.0",
|
|
106
106
|
"tslib": "2.8.1",
|
|
107
|
-
"@clerk/clerk-js": "6.
|
|
108
|
-
"@clerk/react": "6.
|
|
109
|
-
"@clerk/shared": "4.
|
|
107
|
+
"@clerk/clerk-js": "^6.9.0",
|
|
108
|
+
"@clerk/react": "^6.6.0",
|
|
109
|
+
"@clerk/shared": "^4.10.0"
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
112
|
"@expo/config-plugins": "^54.0.4",
|
|
@@ -120,10 +120,10 @@
|
|
|
120
120
|
"expo-secure-store": "^12.8.1",
|
|
121
121
|
"expo-web-browser": "^12.8.2",
|
|
122
122
|
"react-native": "^0.81.4",
|
|
123
|
-
"@clerk/expo-passkeys": "1.0.21
|
|
123
|
+
"@clerk/expo-passkeys": "1.0.21"
|
|
124
124
|
},
|
|
125
125
|
"peerDependencies": {
|
|
126
|
-
"@clerk/expo-passkeys": "
|
|
126
|
+
"@clerk/expo-passkeys": ">=0.0.6",
|
|
127
127
|
"expo": ">=53 <56",
|
|
128
128
|
"expo-apple-authentication": ">=7.0.0",
|
|
129
129
|
"expo-auth-session": ">=5",
|