@clerk/expo 3.0.0-snapshot.v20251216175437 → 3.0.0-snapshot.v20251217165918
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 +1 -1
- package/dist/google-one-tap/ClerkGoogleOneTapSignIn.d.ts +4 -23
- package/dist/google-one-tap/ClerkGoogleOneTapSignIn.d.ts.map +1 -1
- package/dist/google-one-tap/ClerkGoogleOneTapSignIn.js +1 -1
- package/dist/google-one-tap/ClerkGoogleOneTapSignIn.js.map +1 -1
- package/dist/google-one-tap/types.d.ts +7 -1
- package/dist/google-one-tap/types.d.ts.map +1 -1
- package/dist/google-one-tap/types.js.map +1 -1
- package/dist/hooks/useSignInWithGoogle.android.d.ts +3 -4
- package/dist/hooks/useSignInWithGoogle.android.d.ts.map +1 -1
- package/dist/hooks/useSignInWithGoogle.android.js +1 -36
- package/dist/hooks/useSignInWithGoogle.android.js.map +1 -1
- package/dist/hooks/useSignInWithGoogle.ios.d.ts +3 -4
- package/dist/hooks/useSignInWithGoogle.ios.d.ts.map +1 -1
- package/dist/hooks/useSignInWithGoogle.ios.js +1 -41
- package/dist/hooks/useSignInWithGoogle.ios.js.map +1 -1
- package/dist/hooks/useSignInWithGoogle.shared.d.ts +12 -0
- package/dist/hooks/useSignInWithGoogle.shared.d.ts.map +1 -1
- package/dist/hooks/useSignInWithGoogle.shared.js +52 -0
- package/dist/hooks/useSignInWithGoogle.shared.js.map +1 -1
- package/dist/provider/ClerkProvider.js +1 -1
- package/dist/utils/errors.d.ts +1 -1
- package/package.json +11 -17
- package/plugin/build/withClerkExpo.js +1 -1
- package/plugin/src/withClerkExpo.ts +1 -1
package/dist/errorThrower.d.ts
CHANGED
|
@@ -12,39 +12,20 @@ export declare function isNoSavedCredentialFoundResponse(response: OneTapRespons
|
|
|
12
12
|
*/
|
|
13
13
|
export declare function isSuccessResponse(response: OneTapResponse): response is OneTapSuccessResponse;
|
|
14
14
|
/**
|
|
15
|
-
* Check if an error has
|
|
15
|
+
* Check if an error has code and message properties (Google Sign-In error).
|
|
16
16
|
*/
|
|
17
17
|
export declare function isErrorWithCode(error: unknown): error is {
|
|
18
18
|
code: string;
|
|
19
19
|
message: string;
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Internal Google One Tap Sign-In module.
|
|
23
23
|
*
|
|
24
24
|
* This module provides native Google Sign-In functionality using Google's
|
|
25
25
|
* Credential Manager API with full nonce support for replay attack protection.
|
|
26
26
|
*
|
|
27
|
-
* @
|
|
28
|
-
*
|
|
29
|
-
* import { ClerkGoogleOneTapSignIn } from '@clerk/clerk-expo';
|
|
30
|
-
* import * as Crypto from 'expo-crypto';
|
|
31
|
-
*
|
|
32
|
-
* // Configure once at app startup
|
|
33
|
-
* ClerkGoogleOneTapSignIn.configure({
|
|
34
|
-
* webClientId: 'YOUR_WEB_CLIENT_ID',
|
|
35
|
-
* });
|
|
36
|
-
*
|
|
37
|
-
* // Sign in with nonce
|
|
38
|
-
* const nonce = Crypto.randomUUID();
|
|
39
|
-
* const response = await ClerkGoogleOneTapSignIn.signIn({ nonce });
|
|
40
|
-
*
|
|
41
|
-
* if (response.type === 'success') {
|
|
42
|
-
* const { idToken } = response.data;
|
|
43
|
-
* // Use idToken with Clerk
|
|
44
|
-
* }
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* @platform Android
|
|
27
|
+
* @internal This is an internal module. Use the `useSignInWithGoogle` hook instead.
|
|
28
|
+
* @platform Android, iOS
|
|
48
29
|
*/
|
|
49
30
|
export declare const ClerkGoogleOneTapSignIn: {
|
|
50
31
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClerkGoogleOneTapSignIn.d.ts","sourceRoot":"","sources":["../../src/google-one-tap/ClerkGoogleOneTapSignIn.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,o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,MAAM,uBAAuB;IAClC;;;;;;;OAOG;sBACe,eAAe,GAAG,IAAI;IAIxC;;;;;;;;;;;OAWG;oBACmB,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;IAgB5D;;;;;;;;;;OAUG;2BAC0B,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC;IAgB1E;;;;;;;;;;OAUG;mCACkC,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC;IAanF;;;;OAIG;eACc,OAAO,CAAC,IAAI,CAAC;CAG/B,CAAC;AAEF,YAAY,EACV,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,UAAU,GACX,MAAM,SAAS,CAAC"}
|
|
@@ -43,7 +43,7 @@ function isSuccessResponse(response) {
|
|
|
43
43
|
return response.type === "success";
|
|
44
44
|
}
|
|
45
45
|
function isErrorWithCode(error) {
|
|
46
|
-
return error !== null && typeof error === "object" && "code" in error && typeof error.code === "string";
|
|
46
|
+
return error !== null && typeof error === "object" && "code" in error && typeof error.code === "string" && "message" in error && typeof error.message === "string";
|
|
47
47
|
}
|
|
48
48
|
const ClerkGoogleOneTapSignIn = {
|
|
49
49
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/google-one-tap/ClerkGoogleOneTapSignIn.ts"],"sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\n\nimport type {\n CancelledResponse,\n ConfigureParams,\n CreateAccountParams,\n ExplicitSignInParams,\n NoSavedCredentialFound,\n OneTapResponse,\n OneTapSuccessResponse,\n SignInParams,\n} from './types';\n\n// Type for the native module methods\ninterface ClerkGoogleSignInNativeModule {\n configure(params: ConfigureParams): void;\n signIn(params: SignInParams): Promise<OneTapResponse>;\n createAccount(params: CreateAccountParams): Promise<OneTapResponse>;\n presentExplicitSignIn(params: ExplicitSignInParams): Promise<OneTapResponse>;\n signOut(): Promise<void>;\n}\n\n// Lazy-load the native module to avoid crashes when not available\nlet _nativeModule: ClerkGoogleSignInNativeModule | null = null;\n\nfunction getNativeModule(): ClerkGoogleSignInNativeModule {\n if (!_nativeModule) {\n _nativeModule = requireNativeModule<ClerkGoogleSignInNativeModule>('ClerkGoogleSignIn');\n }\n return _nativeModule;\n}\n\n/**\n * Check if a response indicates the user cancelled the sign-in flow.\n */\nexport function isCancelledResponse(response: OneTapResponse): response is CancelledResponse {\n return response.type === 'cancelled';\n}\n\n/**\n * Check if a response indicates no saved credential was found.\n */\nexport function isNoSavedCredentialFoundResponse(response: OneTapResponse): response is NoSavedCredentialFound {\n return response.type === 'noSavedCredentialFound';\n}\n\n/**\n * Check if a response is a successful sign-in.\n */\nexport function isSuccessResponse(response: OneTapResponse): response is OneTapSuccessResponse {\n return response.type === 'success';\n}\n\n/**\n * Check if an error has
|
|
1
|
+
{"version":3,"sources":["../../src/google-one-tap/ClerkGoogleOneTapSignIn.ts"],"sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\n\nimport type {\n CancelledResponse,\n ConfigureParams,\n CreateAccountParams,\n ExplicitSignInParams,\n NoSavedCredentialFound,\n OneTapResponse,\n OneTapSuccessResponse,\n SignInParams,\n} from './types';\n\n// Type for the native module methods\ninterface ClerkGoogleSignInNativeModule {\n configure(params: ConfigureParams): void;\n signIn(params: SignInParams): Promise<OneTapResponse>;\n createAccount(params: CreateAccountParams): Promise<OneTapResponse>;\n presentExplicitSignIn(params: ExplicitSignInParams): Promise<OneTapResponse>;\n signOut(): Promise<void>;\n}\n\n// Lazy-load the native module to avoid crashes when not available\nlet _nativeModule: ClerkGoogleSignInNativeModule | null = null;\n\nfunction getNativeModule(): ClerkGoogleSignInNativeModule {\n if (!_nativeModule) {\n _nativeModule = requireNativeModule<ClerkGoogleSignInNativeModule>('ClerkGoogleSignIn');\n }\n return _nativeModule;\n}\n\n/**\n * Check if a response indicates the user cancelled the sign-in flow.\n */\nexport function isCancelledResponse(response: OneTapResponse): response is CancelledResponse {\n return response.type === 'cancelled';\n}\n\n/**\n * Check if a response indicates no saved credential was found.\n */\nexport function isNoSavedCredentialFoundResponse(response: OneTapResponse): response is NoSavedCredentialFound {\n return response.type === 'noSavedCredentialFound';\n}\n\n/**\n * Check if a response is a successful sign-in.\n */\nexport function isSuccessResponse(response: OneTapResponse): response is OneTapSuccessResponse {\n return response.type === 'success';\n}\n\n/**\n * Check if an error has code and message properties (Google Sign-In error).\n */\nexport function isErrorWithCode(error: unknown): error is { code: string; message: string } {\n return (\n error !== null &&\n typeof error === 'object' &&\n 'code' in error &&\n typeof (error as { code: unknown }).code === 'string' &&\n 'message' in error &&\n typeof (error as { message: unknown }).message === 'string'\n );\n}\n\n/**\n * Internal Google One Tap Sign-In module.\n *\n * This module provides native Google Sign-In functionality using Google's\n * Credential Manager API with full nonce support for replay attack protection.\n *\n * @internal This is an internal module. Use the `useSignInWithGoogle` hook instead.\n * @platform Android, iOS\n */\nexport const ClerkGoogleOneTapSignIn = {\n /**\n * Configure Google Sign-In. Must be called before any sign-in methods.\n *\n * @param params - Configuration parameters\n * @param params.webClientId - The web client ID from Google Cloud Console (required)\n * @param params.hostedDomain - Optional domain restriction\n * @param params.autoSelectEnabled - Auto-select for single credential (default: false)\n */\n configure(params: ConfigureParams): void {\n getNativeModule().configure(params);\n },\n\n /**\n * Attempt to sign in with saved credentials (One Tap).\n *\n * This method will show the One Tap UI if there are saved credentials,\n * or return a \"noSavedCredentialFound\" response if there are none.\n *\n * @param params - Sign-in parameters\n * @param params.nonce - Cryptographic nonce for replay protection\n * @param params.filterByAuthorizedAccounts - Only show previously authorized accounts (default: true)\n *\n * @returns Promise resolving to OneTapResponse\n */\n async signIn(params?: SignInParams): Promise<OneTapResponse> {\n try {\n return await getNativeModule().signIn(params ?? {});\n } catch (error) {\n if (isErrorWithCode(error)) {\n if (error.code === 'SIGN_IN_CANCELLED') {\n return { type: 'cancelled', data: null };\n }\n if (error.code === 'NO_SAVED_CREDENTIAL_FOUND') {\n return { type: 'noSavedCredentialFound', data: null };\n }\n }\n throw error;\n }\n },\n\n /**\n * Create a new account (shows all Google accounts).\n *\n * This method shows the account picker with all available Google accounts,\n * not just previously authorized ones.\n *\n * @param params - Create account parameters\n * @param params.nonce - Cryptographic nonce for replay protection\n *\n * @returns Promise resolving to OneTapResponse\n */\n async createAccount(params?: CreateAccountParams): Promise<OneTapResponse> {\n try {\n return await getNativeModule().createAccount(params ?? {});\n } catch (error) {\n if (isErrorWithCode(error)) {\n if (error.code === 'SIGN_IN_CANCELLED') {\n return { type: 'cancelled', data: null };\n }\n if (error.code === 'NO_SAVED_CREDENTIAL_FOUND') {\n return { type: 'noSavedCredentialFound', data: null };\n }\n }\n throw error;\n }\n },\n\n /**\n * Present explicit sign-in UI (Google Sign-In button flow).\n *\n * This shows the full Google Sign-In UI, similar to clicking a\n * \"Sign in with Google\" button.\n *\n * @param params - Explicit sign-in parameters\n * @param params.nonce - Cryptographic nonce for replay protection\n *\n * @returns Promise resolving to OneTapResponse\n */\n async presentExplicitSignIn(params?: ExplicitSignInParams): Promise<OneTapResponse> {\n try {\n return await getNativeModule().presentExplicitSignIn(params ?? {});\n } catch (error) {\n if (isErrorWithCode(error)) {\n if (error.code === 'SIGN_IN_CANCELLED') {\n return { type: 'cancelled', data: null };\n }\n }\n throw error;\n }\n },\n\n /**\n * Sign out and clear credential state.\n *\n * This disables automatic sign-in until the user signs in again.\n */\n async signOut(): Promise<void> {\n await getNativeModule().signOut();\n },\n};\n\nexport type {\n ConfigureParams,\n SignInParams,\n CreateAccountParams,\n ExplicitSignInParams,\n OneTapResponse,\n OneTapSuccessResponse,\n CancelledResponse,\n NoSavedCredentialFound,\n GoogleUser,\n} from './types';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAAoC;AAuBpC,IAAI,gBAAsD;AAE1D,SAAS,kBAAiD;AACxD,MAAI,CAAC,eAAe;AAClB,wBAAgB,8CA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MAAM,aAAa,MAAM,KAAK;AAAA,QACzC;AACA,YAAI,MAAM,SAAS,6BAA6B;AAC9C,iBAAO,EAAE,MAAM,0BAA0B,MAAM,KAAK;AAAA,QACtD;AAAA,MACF;AACA,YAAM;AAAA,IACR;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAaA,MAAM,sBAAsB,QAAwD;AAClF,QAAI;AACF,aAAO,MAAM,gBAAgB,EAAE,sBAAsB,0BAAU,CAAC,CAAC;AAAA,IACnE,SAAS,OAAO;AACd,UAAI,gBAAgB,KAAK,GAAG;AAC1B,YAAI,MAAM,SAAS,qBAAqB;AACtC,iBAAO,EAAE,MAAM,aAAa,MAAM,KAAK;AAAA,QACzC;AAAA,MACF;AACA,YAAM;AAAA,IACR;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,UAAyB;AAC7B,UAAM,gBAAgB,EAAE,QAAQ;AAAA,EAClC;AACF;","names":[]}
|
|
@@ -128,8 +128,14 @@ export type NoSavedCredentialFound = {
|
|
|
128
128
|
export type OneTapResponse = OneTapSuccessResponse | CancelledResponse | NoSavedCredentialFound;
|
|
129
129
|
/**
|
|
130
130
|
* Error codes that can be thrown by the Google Sign-In module.
|
|
131
|
+
*
|
|
132
|
+
* - `SIGN_IN_CANCELLED`: User cancelled the sign-in flow
|
|
133
|
+
* - `NO_SAVED_CREDENTIAL_FOUND`: No saved credentials available for One Tap
|
|
134
|
+
* - `NOT_CONFIGURED`: Module not configured before use
|
|
135
|
+
* - `GOOGLE_SIGN_IN_ERROR`: Generic Google Sign-In error
|
|
136
|
+
* - `E_ACTIVITY_UNAVAILABLE`: Android activity unavailable (GoogleSignInActivityUnavailableException)
|
|
131
137
|
*/
|
|
132
|
-
export type GoogleSignInErrorCode = 'SIGN_IN_CANCELLED' | 'NO_SAVED_CREDENTIAL_FOUND' | 'NOT_CONFIGURED' | 'GOOGLE_SIGN_IN_ERROR';
|
|
138
|
+
export type GoogleSignInErrorCode = 'SIGN_IN_CANCELLED' | 'NO_SAVED_CREDENTIAL_FOUND' | 'NOT_CONFIGURED' | 'GOOGLE_SIGN_IN_ERROR' | 'E_ACTIVITY_UNAVAILABLE';
|
|
133
139
|
/**
|
|
134
140
|
* Error thrown by the Google Sign-In module.
|
|
135
141
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/google-one-tap/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACtC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpB;;OAEG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,UAAU,EAAE,MA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|
-
{"version":3,"sources":["../../src/google-one-tap/types.ts"],"sourcesContent":["/**\n * Configuration parameters for Google One Tap Sign-In.\n */\nexport type ConfigureParams = {\n /**\n * The web client ID from Google Cloud Console.\n * This is required for Google Sign-In to work.\n * On iOS, this is used as the serverClientID for token audience.\n */\n webClientId: string;\n\n /**\n * The iOS client ID from Google Cloud Console.\n * This is only used on iOS for the OAuth flow.\n * If not provided, webClientId will be used.\n * @platform iOS\n */\n iosClientId?: string;\n\n /**\n * Optional hosted domain to restrict sign-in to a specific domain.\n */\n hostedDomain?: string;\n\n /**\n * Whether to enable auto-select for returning users.\n * When true, if only one credential is available, it will be automatically selected.\n * @default false\n */\n autoSelectEnabled?: boolean;\n};\n\n/**\n * Parameters for the signIn method.\n */\nexport type SignInParams = {\n /**\n * A cryptographically random string used to mitigate replay attacks.\n * The nonce will be included in the ID token.\n */\n nonce?: string;\n\n /**\n * Whether to filter credentials to only show accounts that have been\n * previously authorized for this app.\n * @default true\n */\n filterByAuthorizedAccounts?: boolean;\n};\n\n/**\n * Parameters for the createAccount method.\n */\nexport type CreateAccountParams = {\n /**\n * A cryptographically random string used to mitigate replay attacks.\n * The nonce will be included in the ID token.\n */\n nonce?: string;\n};\n\n/**\n * Parameters for the presentExplicitSignIn method.\n */\nexport type ExplicitSignInParams = {\n /**\n * A cryptographically random string used to mitigate replay attacks.\n * The nonce will be included in the ID token.\n */\n nonce?: string;\n};\n\n/**\n * User information returned from Google Sign-In.\n */\nexport type GoogleUser = {\n /**\n * The user's unique Google identifier (OIDC \"sub\" claim).\n * This is distinct from the user's email address.\n */\n id: string;\n\n /**\n * The user's email address.\n */\n email: string;\n\n /**\n * The user's full display name.\n */\n name: string | null;\n\n /**\n * The user's given (first) name.\n */\n givenName: string | null;\n\n /**\n * The user's family (last) name.\n */\n familyName: string | null;\n\n /**\n * URL to the user's profile picture.\n */\n photo: string | null;\n};\n\n/**\n * Successful sign-in response.\n */\nexport type OneTapSuccessResponse = {\n type: 'success';\n data: {\n /**\n * The Google ID token containing user information and nonce.\n */\n idToken: string;\n\n /**\n * The user's information.\n */\n user: GoogleUser;\n };\n};\n\n/**\n * Response when the user cancels the sign-in flow.\n */\nexport type CancelledResponse = {\n type: 'cancelled';\n data: null;\n};\n\n/**\n * Response when no saved credential is found.\n */\nexport type NoSavedCredentialFound = {\n type: 'noSavedCredentialFound';\n data: null;\n};\n\n/**\n * Union type for all possible One Tap responses.\n */\nexport type OneTapResponse = OneTapSuccessResponse | CancelledResponse | NoSavedCredentialFound;\n\n/**\n * Error codes that can be thrown by the Google Sign-In module.\n */\nexport type GoogleSignInErrorCode =\n | 'SIGN_IN_CANCELLED'\n | 'NO_SAVED_CREDENTIAL_FOUND'\n | 'NOT_CONFIGURED'\n | 'GOOGLE_SIGN_IN_ERROR';\n\n/**\n * Error thrown by the Google Sign-In module.\n */\nexport interface GoogleSignInError extends Error {\n code: GoogleSignInErrorCode;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/google-one-tap/types.ts"],"sourcesContent":["/**\n * Configuration parameters for Google One Tap Sign-In.\n */\nexport type ConfigureParams = {\n /**\n * The web client ID from Google Cloud Console.\n * This is required for Google Sign-In to work.\n * On iOS, this is used as the serverClientID for token audience.\n */\n webClientId: string;\n\n /**\n * The iOS client ID from Google Cloud Console.\n * This is only used on iOS for the OAuth flow.\n * If not provided, webClientId will be used.\n * @platform iOS\n */\n iosClientId?: string;\n\n /**\n * Optional hosted domain to restrict sign-in to a specific domain.\n */\n hostedDomain?: string;\n\n /**\n * Whether to enable auto-select for returning users.\n * When true, if only one credential is available, it will be automatically selected.\n * @default false\n */\n autoSelectEnabled?: boolean;\n};\n\n/**\n * Parameters for the signIn method.\n */\nexport type SignInParams = {\n /**\n * A cryptographically random string used to mitigate replay attacks.\n * The nonce will be included in the ID token.\n */\n nonce?: string;\n\n /**\n * Whether to filter credentials to only show accounts that have been\n * previously authorized for this app.\n * @default true\n */\n filterByAuthorizedAccounts?: boolean;\n};\n\n/**\n * Parameters for the createAccount method.\n */\nexport type CreateAccountParams = {\n /**\n * A cryptographically random string used to mitigate replay attacks.\n * The nonce will be included in the ID token.\n */\n nonce?: string;\n};\n\n/**\n * Parameters for the presentExplicitSignIn method.\n */\nexport type ExplicitSignInParams = {\n /**\n * A cryptographically random string used to mitigate replay attacks.\n * The nonce will be included in the ID token.\n */\n nonce?: string;\n};\n\n/**\n * User information returned from Google Sign-In.\n */\nexport type GoogleUser = {\n /**\n * The user's unique Google identifier (OIDC \"sub\" claim).\n * This is distinct from the user's email address.\n */\n id: string;\n\n /**\n * The user's email address.\n */\n email: string;\n\n /**\n * The user's full display name.\n */\n name: string | null;\n\n /**\n * The user's given (first) name.\n */\n givenName: string | null;\n\n /**\n * The user's family (last) name.\n */\n familyName: string | null;\n\n /**\n * URL to the user's profile picture.\n */\n photo: string | null;\n};\n\n/**\n * Successful sign-in response.\n */\nexport type OneTapSuccessResponse = {\n type: 'success';\n data: {\n /**\n * The Google ID token containing user information and nonce.\n */\n idToken: string;\n\n /**\n * The user's information.\n */\n user: GoogleUser;\n };\n};\n\n/**\n * Response when the user cancels the sign-in flow.\n */\nexport type CancelledResponse = {\n type: 'cancelled';\n data: null;\n};\n\n/**\n * Response when no saved credential is found.\n */\nexport type NoSavedCredentialFound = {\n type: 'noSavedCredentialFound';\n data: null;\n};\n\n/**\n * Union type for all possible One Tap responses.\n */\nexport type OneTapResponse = OneTapSuccessResponse | CancelledResponse | NoSavedCredentialFound;\n\n/**\n * Error codes that can be thrown by the Google Sign-In module.\n *\n * - `SIGN_IN_CANCELLED`: User cancelled the sign-in flow\n * - `NO_SAVED_CREDENTIAL_FOUND`: No saved credentials available for One Tap\n * - `NOT_CONFIGURED`: Module not configured before use\n * - `GOOGLE_SIGN_IN_ERROR`: Generic Google Sign-In error\n * - `E_ACTIVITY_UNAVAILABLE`: Android activity unavailable (GoogleSignInActivityUnavailableException)\n */\nexport type GoogleSignInErrorCode =\n | 'SIGN_IN_CANCELLED'\n | 'NO_SAVED_CREDENTIAL_FOUND'\n | 'NOT_CONFIGURED'\n | 'GOOGLE_SIGN_IN_ERROR'\n | 'E_ACTIVITY_UNAVAILABLE';\n\n/**\n * Error thrown by the Google Sign-In module.\n */\nexport interface GoogleSignInError extends Error {\n code: GoogleSignInErrorCode;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export type { StartGoogleAuthenticationFlowParams, StartGoogleAuthenticationFlowReturnType };
|
|
1
|
+
export type { StartGoogleAuthenticationFlowParams, StartGoogleAuthenticationFlowReturnType, } from './useSignInWithGoogle.types';
|
|
3
2
|
/**
|
|
4
3
|
* Hook for native Google Authentication on Android using Clerk's built-in Google One Tap module.
|
|
5
4
|
*
|
|
@@ -41,7 +40,7 @@ export type { StartGoogleAuthenticationFlowParams, StartGoogleAuthenticationFlow
|
|
|
41
40
|
*
|
|
42
41
|
* @returns An object containing the `startGoogleAuthenticationFlow` function
|
|
43
42
|
*/
|
|
44
|
-
export declare
|
|
45
|
-
startGoogleAuthenticationFlow: (startGoogleAuthenticationFlowParams?: StartGoogleAuthenticationFlowParams) => Promise<StartGoogleAuthenticationFlowReturnType>;
|
|
43
|
+
export declare const useSignInWithGoogle: () => {
|
|
44
|
+
startGoogleAuthenticationFlow: (startGoogleAuthenticationFlowParams?: import("./useSignInWithGoogle.types").StartGoogleAuthenticationFlowParams) => Promise<import("./useSignInWithGoogle.types").StartGoogleAuthenticationFlowReturnType>;
|
|
46
45
|
};
|
|
47
46
|
//# sourceMappingURL=useSignInWithGoogle.android.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignInWithGoogle.android.d.ts","sourceRoot":"","sources":["../../src/hooks/useSignInWithGoogle.android.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSignInWithGoogle.android.d.ts","sourceRoot":"","sources":["../../src/hooks/useSignInWithGoogle.android.ts"],"names":[],"mappings":"AACA,YAAY,EACV,mCAAmC,EACnC,uCAAuC,GACxC,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,mBAAmB;;CAA4D,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,47 +15,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var useSignInWithGoogle_android_exports = {};
|
|
30
20
|
__export(useSignInWithGoogle_android_exports, {
|
|
31
21
|
useSignInWithGoogle: () => useSignInWithGoogle
|
|
32
22
|
});
|
|
33
23
|
module.exports = __toCommonJS(useSignInWithGoogle_android_exports);
|
|
34
|
-
var import_react = require("@clerk/react");
|
|
35
|
-
var import_expo_constants = __toESM(require("expo-constants"));
|
|
36
|
-
var import_errors = require("../utils/errors");
|
|
37
24
|
var import_useSignInWithGoogle = require("./useSignInWithGoogle.shared");
|
|
38
|
-
|
|
39
|
-
const clerk = (0, import_react.useClerk)();
|
|
40
|
-
async function startGoogleAuthenticationFlow(startGoogleAuthenticationFlowParams) {
|
|
41
|
-
var _a, _b;
|
|
42
|
-
const { client, loaded, setActive } = clerk;
|
|
43
|
-
if (!loaded || !client) {
|
|
44
|
-
return {
|
|
45
|
-
createdSessionId: null,
|
|
46
|
-
setActive
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
const webClientId = ((_b = (_a = import_expo_constants.default.expoConfig) == null ? void 0 : _a.extra) == null ? void 0 : _b.EXPO_PUBLIC_CLERK_GOOGLE_WEB_CLIENT_ID) || process.env.EXPO_PUBLIC_CLERK_GOOGLE_WEB_CLIENT_ID;
|
|
50
|
-
if (!webClientId) {
|
|
51
|
-
return import_errors.errorThrower.throw(
|
|
52
|
-
"Google Sign-In credentials not found. Please set EXPO_PUBLIC_CLERK_GOOGLE_WEB_CLIENT_ID in your .env file."
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
return (0, import_useSignInWithGoogle.executeGoogleAuthenticationFlow)({ client, setActive }, { webClientId }, startGoogleAuthenticationFlowParams);
|
|
56
|
-
}
|
|
57
|
-
return {
|
|
58
|
-
startGoogleAuthenticationFlow
|
|
59
|
-
};
|
|
60
|
-
}
|
|
25
|
+
const useSignInWithGoogle = (0, import_useSignInWithGoogle.createUseSignInWithGoogle)({ requiresIosClientId: false });
|
|
61
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
62
27
|
0 && (module.exports = {
|
|
63
28
|
useSignInWithGoogle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/useSignInWithGoogle.android.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/useSignInWithGoogle.android.ts"],"sourcesContent":["import { createUseSignInWithGoogle } from './useSignInWithGoogle.shared';\nexport type {\n StartGoogleAuthenticationFlowParams,\n StartGoogleAuthenticationFlowReturnType,\n} from './useSignInWithGoogle.types';\n\n/**\n * Hook for native Google Authentication on Android using Clerk's built-in Google One Tap module.\n *\n * This hook provides a simplified way to authenticate users with their Google account\n * using the native Android Google Sign-In UI with Credential Manager. The authentication\n * flow automatically handles the ID token exchange with Clerk's backend and manages\n * the transfer flow between sign-in and sign-up.\n *\n * Features:\n * - Native Google One Tap UI\n * - Built-in nonce support for replay attack protection\n * - No additional dependencies required\n *\n * @example\n * ```tsx\n * import { useSignInWithGoogle } from '@clerk/clerk-expo';\n * import { Button } from 'react-native';\n *\n * function GoogleSignInButton() {\n * const { startGoogleAuthenticationFlow } = useSignInWithGoogle();\n *\n * const onPress = async () => {\n * try {\n * const { createdSessionId, setActive } = await startGoogleAuthenticationFlow();\n *\n * if (createdSessionId && setActive) {\n * await setActive({ session: createdSessionId });\n * }\n * } catch (err) {\n * console.error('Google Authentication error:', err);\n * }\n * };\n *\n * return <Button title=\"Sign in with Google\" onPress={onPress} />;\n * }\n * ```\n *\n * @platform Android - This is the Android-specific implementation using Credential Manager\n *\n * @returns An object containing the `startGoogleAuthenticationFlow` function\n */\nexport const useSignInWithGoogle = createUseSignInWithGoogle({ requiresIosClientId: false });\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAA0C;AA+CnC,MAAM,0BAAsB,sDAA0B,EAAE,qBAAqB,MAAM,CAAC;","names":[]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export type { StartGoogleAuthenticationFlowParams, StartGoogleAuthenticationFlowReturnType };
|
|
1
|
+
export type { StartGoogleAuthenticationFlowParams, StartGoogleAuthenticationFlowReturnType, } from './useSignInWithGoogle.types';
|
|
3
2
|
/**
|
|
4
3
|
* Hook for native Google Authentication on iOS using Clerk's built-in Google Sign-In module.
|
|
5
4
|
*
|
|
@@ -41,7 +40,7 @@ export type { StartGoogleAuthenticationFlowParams, StartGoogleAuthenticationFlow
|
|
|
41
40
|
*
|
|
42
41
|
* @returns An object containing the `startGoogleAuthenticationFlow` function
|
|
43
42
|
*/
|
|
44
|
-
export declare
|
|
45
|
-
startGoogleAuthenticationFlow: (startGoogleAuthenticationFlowParams?: StartGoogleAuthenticationFlowParams) => Promise<StartGoogleAuthenticationFlowReturnType>;
|
|
43
|
+
export declare const useSignInWithGoogle: () => {
|
|
44
|
+
startGoogleAuthenticationFlow: (startGoogleAuthenticationFlowParams?: import("./useSignInWithGoogle.types").StartGoogleAuthenticationFlowParams) => Promise<import("./useSignInWithGoogle.types").StartGoogleAuthenticationFlowReturnType>;
|
|
46
45
|
};
|
|
47
46
|
//# sourceMappingURL=useSignInWithGoogle.ios.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignInWithGoogle.ios.d.ts","sourceRoot":"","sources":["../../src/hooks/useSignInWithGoogle.ios.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSignInWithGoogle.ios.d.ts","sourceRoot":"","sources":["../../src/hooks/useSignInWithGoogle.ios.ts"],"names":[],"mappings":"AACA,YAAY,EACV,mCAAmC,EACnC,uCAAuC,GACxC,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,mBAAmB;;CAA2D,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,52 +15,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var useSignInWithGoogle_ios_exports = {};
|
|
30
20
|
__export(useSignInWithGoogle_ios_exports, {
|
|
31
21
|
useSignInWithGoogle: () => useSignInWithGoogle
|
|
32
22
|
});
|
|
33
23
|
module.exports = __toCommonJS(useSignInWithGoogle_ios_exports);
|
|
34
|
-
var import_react = require("@clerk/react");
|
|
35
|
-
var import_expo_constants = __toESM(require("expo-constants"));
|
|
36
|
-
var import_errors = require("../utils/errors");
|
|
37
24
|
var import_useSignInWithGoogle = require("./useSignInWithGoogle.shared");
|
|
38
|
-
|
|
39
|
-
const clerk = (0, import_react.useClerk)();
|
|
40
|
-
async function startGoogleAuthenticationFlow(startGoogleAuthenticationFlowParams) {
|
|
41
|
-
var _a, _b, _c, _d;
|
|
42
|
-
const { client, loaded, setActive } = clerk;
|
|
43
|
-
if (!loaded || !client) {
|
|
44
|
-
return {
|
|
45
|
-
createdSessionId: null,
|
|
46
|
-
setActive
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
const webClientId = ((_b = (_a = import_expo_constants.default.expoConfig) == null ? void 0 : _a.extra) == null ? void 0 : _b.EXPO_PUBLIC_CLERK_GOOGLE_WEB_CLIENT_ID) || process.env.EXPO_PUBLIC_CLERK_GOOGLE_WEB_CLIENT_ID;
|
|
50
|
-
const iosClientId = ((_d = (_c = import_expo_constants.default.expoConfig) == null ? void 0 : _c.extra) == null ? void 0 : _d.EXPO_PUBLIC_CLERK_GOOGLE_IOS_CLIENT_ID) || process.env.EXPO_PUBLIC_CLERK_GOOGLE_IOS_CLIENT_ID;
|
|
51
|
-
if (!webClientId || !iosClientId) {
|
|
52
|
-
return import_errors.errorThrower.throw(
|
|
53
|
-
"Google Sign-In credentials not found. Please set EXPO_PUBLIC_CLERK_GOOGLE_WEB_CLIENT_ID and EXPO_PUBLIC_CLERK_GOOGLE_IOS_CLIENT_ID in your .env file."
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
return (0, import_useSignInWithGoogle.executeGoogleAuthenticationFlow)(
|
|
57
|
-
{ client, setActive },
|
|
58
|
-
{ webClientId, iosClientId },
|
|
59
|
-
startGoogleAuthenticationFlowParams
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
return {
|
|
63
|
-
startGoogleAuthenticationFlow
|
|
64
|
-
};
|
|
65
|
-
}
|
|
25
|
+
const useSignInWithGoogle = (0, import_useSignInWithGoogle.createUseSignInWithGoogle)({ requiresIosClientId: true });
|
|
66
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
67
27
|
0 && (module.exports = {
|
|
68
28
|
useSignInWithGoogle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/useSignInWithGoogle.ios.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/useSignInWithGoogle.ios.ts"],"sourcesContent":["import { createUseSignInWithGoogle } from './useSignInWithGoogle.shared';\nexport type {\n StartGoogleAuthenticationFlowParams,\n StartGoogleAuthenticationFlowReturnType,\n} from './useSignInWithGoogle.types';\n\n/**\n * Hook for native Google Authentication on iOS using Clerk's built-in Google Sign-In module.\n *\n * This hook provides a simplified way to authenticate users with their Google account\n * using the native iOS Google Sign-In UI. The authentication flow automatically\n * handles the ID token exchange with Clerk's backend and manages the transfer flow\n * between sign-in and sign-up.\n *\n * Features:\n * - Native Google Sign-In UI\n * - Built-in nonce support for replay attack protection\n * - No additional dependencies required\n *\n * @example\n * ```tsx\n * import { useSignInWithGoogle } from '@clerk/clerk-expo';\n * import { Button } from 'react-native';\n *\n * function GoogleSigninButton() {\n * const { startGoogleAuthenticationFlow } = useSignInWithGoogle();\n *\n * const onPress = async () => {\n * try {\n * const { createdSessionId, setActive } = await startGoogleAuthenticationFlow();\n *\n * if (createdSessionId && setActive) {\n * await setActive({ session: createdSessionId });\n * }\n * } catch (err) {\n * console.error('Google Authentication error:', err);\n * }\n * };\n *\n * return <Button title=\"Sign in with Google\" onPress={onPress} />;\n * }\n * ```\n *\n * @platform iOS - This is the iOS-specific implementation using Google Sign-In SDK\n *\n * @returns An object containing the `startGoogleAuthenticationFlow` function\n */\nexport const useSignInWithGoogle = createUseSignInWithGoogle({ requiresIosClientId: true });\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iCAA0C;AA+CnC,MAAM,0BAAsB,sDAA0B,EAAE,qBAAqB,KAAK,CAAC;","names":[]}
|
|
@@ -8,10 +8,22 @@ export type GoogleAuthenticationFlowContext = {
|
|
|
8
8
|
client: ClientResource;
|
|
9
9
|
setActive: SetActive;
|
|
10
10
|
};
|
|
11
|
+
type PlatformConfig = {
|
|
12
|
+
requiresIosClientId: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Factory function to create the useSignInWithGoogle hook with platform-specific configuration.
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare function createUseSignInWithGoogle(platformConfig: PlatformConfig): () => {
|
|
20
|
+
startGoogleAuthenticationFlow: (startGoogleAuthenticationFlowParams?: StartGoogleAuthenticationFlowParams) => Promise<StartGoogleAuthenticationFlowReturnType>;
|
|
21
|
+
};
|
|
11
22
|
/**
|
|
12
23
|
* Core implementation of Google Authentication flow shared between iOS and Android.
|
|
13
24
|
*
|
|
14
25
|
* @internal
|
|
15
26
|
*/
|
|
16
27
|
export declare function executeGoogleAuthenticationFlow(context: GoogleAuthenticationFlowContext, clientIds: GoogleClientIds, params?: StartGoogleAuthenticationFlowParams): Promise<StartGoogleAuthenticationFlowReturnType>;
|
|
28
|
+
export {};
|
|
17
29
|
//# sourceMappingURL=useSignInWithGoogle.shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSignInWithGoogle.shared.d.ts","sourceRoot":"","sources":["../../src/hooks/useSignInWithGoogle.shared.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSignInWithGoogle.shared.d.ts","sourceRoot":"","sources":["../../src/hooks/useSignInWithGoogle.shared.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAIrE,OAAO,KAAK,EACV,mCAAmC,EACnC,uCAAuC,EACxC,MAAM,6BAA6B,CAAC;AAErC,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAAC;AA+BF;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,cAAc;0EAK5B,mCAAmC,KACxE,OAAO,CAAC,uCAAuC,CAAC;EAoCtD;AAED;;;;GAIG;AACH,wBAAsB,+BAA+B,CACnD,OAAO,EAAE,+BAA+B,EACxC,SAAS,EAAE,eAAe,EAC1B,MAAM,CAAC,EAAE,mCAAmC,GAC3C,OAAO,CAAC,uCAAuC,CAAC,CAmGlD"}
|
|
@@ -28,11 +28,62 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var useSignInWithGoogle_shared_exports = {};
|
|
30
30
|
__export(useSignInWithGoogle_shared_exports, {
|
|
31
|
+
createUseSignInWithGoogle: () => createUseSignInWithGoogle,
|
|
31
32
|
executeGoogleAuthenticationFlow: () => executeGoogleAuthenticationFlow
|
|
32
33
|
});
|
|
33
34
|
module.exports = __toCommonJS(useSignInWithGoogle_shared_exports);
|
|
35
|
+
var import_react = require("@clerk/react");
|
|
34
36
|
var import_error = require("@clerk/shared/error");
|
|
35
37
|
var import_google_one_tap = require("../google-one-tap");
|
|
38
|
+
var import_errors = require("../utils/errors");
|
|
39
|
+
async function getGoogleClientIds() {
|
|
40
|
+
var _a, _b, _c, _d;
|
|
41
|
+
let webClientId;
|
|
42
|
+
let iosClientId;
|
|
43
|
+
try {
|
|
44
|
+
const ConstantsModule = await import("expo-constants");
|
|
45
|
+
const Constants = ConstantsModule.default;
|
|
46
|
+
webClientId = ((_b = (_a = Constants == null ? void 0 : Constants.expoConfig) == null ? void 0 : _a.extra) == null ? void 0 : _b.EXPO_PUBLIC_CLERK_GOOGLE_WEB_CLIENT_ID) || process.env.EXPO_PUBLIC_CLERK_GOOGLE_WEB_CLIENT_ID;
|
|
47
|
+
iosClientId = ((_d = (_c = Constants == null ? void 0 : Constants.expoConfig) == null ? void 0 : _c.extra) == null ? void 0 : _d.EXPO_PUBLIC_CLERK_GOOGLE_IOS_CLIENT_ID) || process.env.EXPO_PUBLIC_CLERK_GOOGLE_IOS_CLIENT_ID;
|
|
48
|
+
} catch {
|
|
49
|
+
webClientId = process.env.EXPO_PUBLIC_CLERK_GOOGLE_WEB_CLIENT_ID;
|
|
50
|
+
iosClientId = process.env.EXPO_PUBLIC_CLERK_GOOGLE_IOS_CLIENT_ID;
|
|
51
|
+
}
|
|
52
|
+
return { webClientId, iosClientId };
|
|
53
|
+
}
|
|
54
|
+
function createUseSignInWithGoogle(platformConfig) {
|
|
55
|
+
return function useSignInWithGoogle() {
|
|
56
|
+
const clerk = (0, import_react.useClerk)();
|
|
57
|
+
async function startGoogleAuthenticationFlow(startGoogleAuthenticationFlowParams) {
|
|
58
|
+
const { client, loaded, setActive } = clerk;
|
|
59
|
+
if (!loaded || !client) {
|
|
60
|
+
return {
|
|
61
|
+
createdSessionId: null,
|
|
62
|
+
setActive
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const { webClientId, iosClientId } = await getGoogleClientIds();
|
|
66
|
+
if (!webClientId) {
|
|
67
|
+
return import_errors.errorThrower.throw(
|
|
68
|
+
"Google Sign-In credentials not found. Please set EXPO_PUBLIC_CLERK_GOOGLE_WEB_CLIENT_ID in your .env file."
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
if (platformConfig.requiresIosClientId && !iosClientId) {
|
|
72
|
+
return import_errors.errorThrower.throw(
|
|
73
|
+
"Google Sign-In credentials not found. Please set EXPO_PUBLIC_CLERK_GOOGLE_IOS_CLIENT_ID in your .env file."
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
return executeGoogleAuthenticationFlow(
|
|
77
|
+
{ client, setActive },
|
|
78
|
+
{ webClientId, iosClientId },
|
|
79
|
+
startGoogleAuthenticationFlowParams
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
startGoogleAuthenticationFlow
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
}
|
|
36
87
|
async function executeGoogleAuthenticationFlow(context, clientIds, params) {
|
|
37
88
|
var _a;
|
|
38
89
|
const { client, setActive } = context;
|
|
@@ -107,6 +158,7 @@ async function executeGoogleAuthenticationFlow(context, clientIds, params) {
|
|
|
107
158
|
}
|
|
108
159
|
// Annotate the CommonJS export names for ESM import in node:
|
|
109
160
|
0 && (module.exports = {
|
|
161
|
+
createUseSignInWithGoogle,
|
|
110
162
|
executeGoogleAuthenticationFlow
|
|
111
163
|
});
|
|
112
164
|
//# sourceMappingURL=useSignInWithGoogle.shared.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/useSignInWithGoogle.shared.ts"],"sourcesContent":["import { isClerkAPIResponseError } from '@clerk/shared/error';\nimport type { ClientResource, SetActive } from '@clerk/shared/types';\n\nimport { ClerkGoogleOneTapSignIn, isErrorWithCode, isSuccessResponse } from '../google-one-tap';\nimport type {\n StartGoogleAuthenticationFlowParams,\n StartGoogleAuthenticationFlowReturnType,\n} from './useSignInWithGoogle.types';\n\nexport type GoogleClientIds = {\n webClientId: string;\n iosClientId?: string;\n};\n\nexport type GoogleAuthenticationFlowContext = {\n client: ClientResource;\n setActive: SetActive;\n};\n\n/**\n * Core implementation of Google Authentication flow shared between iOS and Android.\n *\n * @internal\n */\nexport async function executeGoogleAuthenticationFlow(\n context: GoogleAuthenticationFlowContext,\n clientIds: GoogleClientIds,\n params?: StartGoogleAuthenticationFlowParams,\n): Promise<StartGoogleAuthenticationFlowReturnType> {\n const { client, setActive } = context;\n const { signIn, signUp } = client;\n\n // Configure Google Sign-In with client IDs\n ClerkGoogleOneTapSignIn.configure(clientIds);\n\n // Generate a cryptographic nonce for replay attack protection\n const { randomUUID } = await import('expo-crypto');\n const nonce = randomUUID();\n\n try {\n // Present Google Sign-In UI with nonce\n const response = await ClerkGoogleOneTapSignIn.presentExplicitSignIn({\n nonce,\n });\n\n // User cancelled\n if (!isSuccessResponse(response)) {\n return {\n createdSessionId: null,\n setActive,\n signIn,\n signUp,\n };\n }\n\n const { idToken } = response.data;\n\n try {\n // Try to sign in with the Google One Tap strategy\n await signIn.create({\n strategy: 'google_one_tap',\n token: idToken,\n });\n\n // Check if we need to transfer to SignUp (user doesn't exist yet)\n const userNeedsToBeCreated = signIn.firstFactorVerification.status === 'transferable';\n\n if (userNeedsToBeCreated) {\n // User doesn't exist - create a new SignUp with transfer\n await signUp.create({\n transfer: true,\n unsafeMetadata: params?.unsafeMetadata,\n });\n\n return {\n createdSessionId: signUp.createdSessionId,\n setActive,\n signIn,\n signUp,\n };\n }\n\n // User exists - return the SignIn session\n return {\n createdSessionId: signIn.createdSessionId,\n setActive,\n signIn,\n signUp,\n };\n } catch (signInError: unknown) {\n // Handle the case where the user doesn't exist (external_account_not_found)\n if (\n isClerkAPIResponseError(signInError) &&\n signInError.errors?.some(err => err.code === 'external_account_not_found')\n ) {\n // User doesn't exist - create a new SignUp with the token\n await signUp.create({\n strategy: 'google_one_tap',\n token: idToken,\n unsafeMetadata: params?.unsafeMetadata,\n });\n\n return {\n createdSessionId: signUp.createdSessionId,\n setActive,\n signIn,\n signUp,\n };\n }\n\n // Re-throw if it's a different error\n throw signInError;\n }\n } catch (error: unknown) {\n // Handle Google Sign-In cancellation errors\n if (isErrorWithCode(error) && error.code === 'SIGN_IN_CANCELLED') {\n return {\n createdSessionId: null,\n setActive,\n signIn,\n signUp,\n };\n }\n\n // Re-throw other errors\n throw error;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAwC;AAGxC,4BAA4E;
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/useSignInWithGoogle.shared.ts"],"sourcesContent":["import { useClerk } from '@clerk/react';\nimport { isClerkAPIResponseError } from '@clerk/shared/error';\nimport type { ClientResource, SetActive } from '@clerk/shared/types';\n\nimport { ClerkGoogleOneTapSignIn, isErrorWithCode, isSuccessResponse } from '../google-one-tap';\nimport { errorThrower } from '../utils/errors';\nimport type {\n StartGoogleAuthenticationFlowParams,\n StartGoogleAuthenticationFlowReturnType,\n} from './useSignInWithGoogle.types';\n\nexport type GoogleClientIds = {\n webClientId: string;\n iosClientId?: string;\n};\n\nexport type GoogleAuthenticationFlowContext = {\n client: ClientResource;\n setActive: SetActive;\n};\n\ntype PlatformConfig = {\n requiresIosClientId: boolean;\n};\n\n/**\n * Helper to get Google client IDs from expo-constants or process.env.\n * Dynamically imports expo-constants to keep it optional.\n */\nasync function getGoogleClientIds(): Promise<{ webClientId?: string; iosClientId?: string }> {\n let webClientId: string | undefined;\n let iosClientId: string | undefined;\n\n // Try to get values from expo-constants first\n try {\n const ConstantsModule = await import('expo-constants');\n const Constants = ConstantsModule.default as {\n expoConfig?: { extra?: Record<string, string> };\n };\n webClientId =\n Constants?.expoConfig?.extra?.EXPO_PUBLIC_CLERK_GOOGLE_WEB_CLIENT_ID ||\n process.env.EXPO_PUBLIC_CLERK_GOOGLE_WEB_CLIENT_ID;\n iosClientId =\n Constants?.expoConfig?.extra?.EXPO_PUBLIC_CLERK_GOOGLE_IOS_CLIENT_ID ||\n process.env.EXPO_PUBLIC_CLERK_GOOGLE_IOS_CLIENT_ID;\n } catch {\n // expo-constants not available, fall back to process.env only\n webClientId = process.env.EXPO_PUBLIC_CLERK_GOOGLE_WEB_CLIENT_ID;\n iosClientId = process.env.EXPO_PUBLIC_CLERK_GOOGLE_IOS_CLIENT_ID;\n }\n\n return { webClientId, iosClientId };\n}\n\n/**\n * Factory function to create the useSignInWithGoogle hook with platform-specific configuration.\n *\n * @internal\n */\nexport function createUseSignInWithGoogle(platformConfig: PlatformConfig) {\n return function useSignInWithGoogle() {\n const clerk = useClerk();\n\n async function startGoogleAuthenticationFlow(\n startGoogleAuthenticationFlowParams?: StartGoogleAuthenticationFlowParams,\n ): Promise<StartGoogleAuthenticationFlowReturnType> {\n const { client, loaded, setActive } = clerk;\n\n if (!loaded || !client) {\n return {\n createdSessionId: null,\n setActive,\n };\n }\n\n // Get environment variables from expo-constants or process.env\n const { webClientId, iosClientId } = await getGoogleClientIds();\n\n if (!webClientId) {\n return errorThrower.throw(\n 'Google Sign-In credentials not found. Please set EXPO_PUBLIC_CLERK_GOOGLE_WEB_CLIENT_ID in your .env file.',\n );\n }\n\n if (platformConfig.requiresIosClientId && !iosClientId) {\n return errorThrower.throw(\n 'Google Sign-In credentials not found. Please set EXPO_PUBLIC_CLERK_GOOGLE_IOS_CLIENT_ID in your .env file.',\n );\n }\n\n return executeGoogleAuthenticationFlow(\n { client, setActive },\n { webClientId, iosClientId },\n startGoogleAuthenticationFlowParams,\n );\n }\n\n return {\n startGoogleAuthenticationFlow,\n };\n };\n}\n\n/**\n * Core implementation of Google Authentication flow shared between iOS and Android.\n *\n * @internal\n */\nexport async function executeGoogleAuthenticationFlow(\n context: GoogleAuthenticationFlowContext,\n clientIds: GoogleClientIds,\n params?: StartGoogleAuthenticationFlowParams,\n): Promise<StartGoogleAuthenticationFlowReturnType> {\n const { client, setActive } = context;\n const { signIn, signUp } = client;\n\n // Configure Google Sign-In with client IDs\n ClerkGoogleOneTapSignIn.configure(clientIds);\n\n // Generate a cryptographic nonce for replay attack protection\n const { randomUUID } = await import('expo-crypto');\n const nonce = randomUUID();\n\n try {\n // Present Google Sign-In UI with nonce\n const response = await ClerkGoogleOneTapSignIn.presentExplicitSignIn({\n nonce,\n });\n\n // User cancelled\n if (!isSuccessResponse(response)) {\n return {\n createdSessionId: null,\n setActive,\n signIn,\n signUp,\n };\n }\n\n const { idToken } = response.data;\n\n try {\n // Try to sign in with the Google One Tap strategy\n await signIn.create({\n strategy: 'google_one_tap',\n token: idToken,\n });\n\n // Check if we need to transfer to SignUp (user doesn't exist yet)\n const userNeedsToBeCreated = signIn.firstFactorVerification.status === 'transferable';\n\n if (userNeedsToBeCreated) {\n // User doesn't exist - create a new SignUp with transfer\n await signUp.create({\n transfer: true,\n unsafeMetadata: params?.unsafeMetadata,\n });\n\n return {\n createdSessionId: signUp.createdSessionId,\n setActive,\n signIn,\n signUp,\n };\n }\n\n // User exists - return the SignIn session\n return {\n createdSessionId: signIn.createdSessionId,\n setActive,\n signIn,\n signUp,\n };\n } catch (signInError: unknown) {\n // Handle the case where the user doesn't exist (external_account_not_found)\n if (\n isClerkAPIResponseError(signInError) &&\n signInError.errors?.some(err => err.code === 'external_account_not_found')\n ) {\n // User doesn't exist - create a new SignUp with the token\n await signUp.create({\n strategy: 'google_one_tap',\n token: idToken,\n unsafeMetadata: params?.unsafeMetadata,\n });\n\n return {\n createdSessionId: signUp.createdSessionId,\n setActive,\n signIn,\n signUp,\n };\n }\n\n // Re-throw if it's a different error\n throw signInError;\n }\n } catch (error: unknown) {\n // Handle Google Sign-In cancellation errors\n if (isErrorWithCode(error) && error.code === 'SIGN_IN_CANCELLED') {\n return {\n createdSessionId: null,\n setActive,\n signIn,\n signUp,\n };\n }\n\n // Re-throw other errors\n throw error;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAyB;AACzB,mBAAwC;AAGxC,4BAA4E;AAC5E,oBAA6B;AAwB7B,eAAe,qBAA8E;AA7B7F;AA8BE,MAAI;AACJ,MAAI;AAGJ,MAAI;AACF,UAAM,kBAAkB,MAAM,OAAO,gBAAgB;AACrD,UAAM,YAAY,gBAAgB;AAGlC,oBACE,kDAAW,eAAX,mBAAuB,UAAvB,mBAA8B,2CAC9B,QAAQ,IAAI;AACd,oBACE,kDAAW,eAAX,mBAAuB,UAAvB,mBAA8B,2CAC9B,QAAQ,IAAI;AAAA,EAChB,QAAQ;AAEN,kBAAc,QAAQ,IAAI;AAC1B,kBAAc,QAAQ,IAAI;AAAA,EAC5B;AAEA,SAAO,EAAE,aAAa,YAAY;AACpC;AAOO,SAAS,0BAA0B,gBAAgC;AACxE,SAAO,SAAS,sBAAsB;AACpC,UAAM,YAAQ,uBAAS;AAEvB,mBAAe,8BACb,qCACkD;AAClD,YAAM,EAAE,QAAQ,QAAQ,UAAU,IAAI;AAEtC,UAAI,CAAC,UAAU,CAAC,QAAQ;AACtB,eAAO;AAAA,UACL,kBAAkB;AAAA,UAClB;AAAA,QACF;AAAA,MACF;AAGA,YAAM,EAAE,aAAa,YAAY,IAAI,MAAM,mB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,aAAsB;AAE7B,cACE,sCAAwB,WAAW,OACnC,iBAAY,WAAZ,mBAAoB,KAAK,SAAO,IAAI,SAAS,gCAC7C;AAEA,cAAM,OAAO,OAAO;AAAA,UAClB,UAAU;AAAA,UACV,OAAO;AAAA,UACP,gBAAgB,iCAAQ;AAAA,QAC1B,CAAC;AAED,eAAO;AAAA,UACL,kBAAkB,OAAO;AAAA,UACzB;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAGA,YAAM;AAAA,IACR;AAAA,EACF,SAAS,OAAgB;AAEvB,YAAI,uCAAgB,KAAK,KAAK,MAAM,SAAS,qBAAqB;AAChE,aAAO;AAAA,QACL,kBAAkB;AAAA,QAClB;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAGA,UAAM;AAAA,EACR;AACF;","names":[]}
|
|
@@ -39,7 +39,7 @@ var import_runtime = require("../utils/runtime");
|
|
|
39
39
|
var import_singleton = require("./singleton");
|
|
40
40
|
const SDK_METADATA = {
|
|
41
41
|
name: "@clerk/expo",
|
|
42
|
-
version: "3.0.0-snapshot.
|
|
42
|
+
version: "3.0.0-snapshot.v20251217165918"
|
|
43
43
|
};
|
|
44
44
|
function ClerkProvider(props) {
|
|
45
45
|
const {
|
package/dist/utils/errors.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const errorThrower: import("@clerk/shared/error-
|
|
1
|
+
export declare const errorThrower: import("@clerk/shared/error-D_08BTAz").y;
|
|
2
2
|
//# sourceMappingURL=errors.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clerk/expo",
|
|
3
|
-
"version": "3.0.0-snapshot.
|
|
3
|
+
"version": "3.0.0-snapshot.v20251217165918",
|
|
4
4
|
"description": "Clerk React Native/Expo library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -60,8 +60,7 @@
|
|
|
60
60
|
"types": "./dist/legacy.d.ts",
|
|
61
61
|
"default": "./dist/legacy.js"
|
|
62
62
|
},
|
|
63
|
-
"./app.plugin.js": "./app.plugin.js"
|
|
64
|
-
"./package.json": "./package.json"
|
|
63
|
+
"./app.plugin.js": "./app.plugin.js"
|
|
65
64
|
},
|
|
66
65
|
"main": "./dist/index.js",
|
|
67
66
|
"source": "./src/index.ts",
|
|
@@ -72,21 +71,15 @@
|
|
|
72
71
|
"ios",
|
|
73
72
|
"expo-module.config.json",
|
|
74
73
|
"app.plugin.js",
|
|
75
|
-
"plugin"
|
|
76
|
-
"web",
|
|
77
|
-
"local-credentials",
|
|
78
|
-
"passkeys",
|
|
79
|
-
"secure-store",
|
|
80
|
-
"resource-cache",
|
|
81
|
-
"token-cache"
|
|
74
|
+
"plugin"
|
|
82
75
|
],
|
|
83
76
|
"dependencies": {
|
|
84
77
|
"base-64": "^1.0.0",
|
|
85
78
|
"react-native-url-polyfill": "2.0.0",
|
|
86
79
|
"tslib": "2.8.1",
|
|
87
|
-
"@clerk/clerk-js": "
|
|
88
|
-
"@clerk/react": "6.0.0-snapshot.
|
|
89
|
-
"@clerk/shared": "4.0.0-snapshot.
|
|
80
|
+
"@clerk/clerk-js": "6.0.0-snapshot.v20251217165918",
|
|
81
|
+
"@clerk/react": "6.0.0-snapshot.v20251217165918",
|
|
82
|
+
"@clerk/shared": "4.0.0-snapshot.v20251217165918"
|
|
90
83
|
},
|
|
91
84
|
"devDependencies": {
|
|
92
85
|
"@expo/config-plugins": "^54.0.4",
|
|
@@ -100,10 +93,11 @@
|
|
|
100
93
|
"expo-secure-store": "^12.8.1",
|
|
101
94
|
"expo-web-browser": "^12.8.2",
|
|
102
95
|
"react-native": "^0.81.4",
|
|
103
|
-
"@clerk/expo-passkeys": "1.0.0-snapshot.
|
|
96
|
+
"@clerk/expo-passkeys": "1.0.0-snapshot.v20251217165918"
|
|
104
97
|
},
|
|
105
98
|
"peerDependencies": {
|
|
106
|
-
"@clerk/expo-passkeys": "1.0.0-snapshot.
|
|
99
|
+
"@clerk/expo-passkeys": "1.0.0-snapshot.v20251217165918",
|
|
100
|
+
"expo": ">=53 <55",
|
|
107
101
|
"expo-apple-authentication": ">=7.0.0",
|
|
108
102
|
"expo-auth-session": ">=5",
|
|
109
103
|
"expo-constants": ">=12",
|
|
@@ -112,8 +106,8 @@
|
|
|
112
106
|
"expo-modules-core": ">=3.0.0",
|
|
113
107
|
"expo-secure-store": ">=12.4.0",
|
|
114
108
|
"expo-web-browser": ">=12.5.0",
|
|
115
|
-
"react": "^18.0.0 || ^19.0.
|
|
116
|
-
"react-dom": "^18.0.0 || ^19.0.
|
|
109
|
+
"react": "^18.0.0 || ^19.0.3 || ^19.1.4 || ^19.2.3 || ^19.3.0-0",
|
|
110
|
+
"react-dom": "^18.0.0 || ^19.0.3 || ^19.1.4 || ^19.2.3 || ^19.3.0-0",
|
|
117
111
|
"react-native": ">=0.73"
|
|
118
112
|
},
|
|
119
113
|
"peerDependenciesMeta": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
4
|
-
const pkg = require('
|
|
4
|
+
const pkg = require('../../package.json');
|
|
5
5
|
/**
|
|
6
6
|
* Expo config plugin for @clerk/expo.
|
|
7
7
|
*
|