@clerk/expo 3.0.0-snapshot.v20251216175437 → 3.0.0-snapshot.v20251217162523

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 (51) hide show
  1. package/dist/errorThrower.d.ts +1 -1
  2. package/dist/hooks/index.d.ts +0 -1
  3. package/dist/hooks/index.d.ts.map +1 -1
  4. package/dist/hooks/index.js +0 -2
  5. package/dist/hooks/index.js.map +1 -1
  6. package/dist/provider/ClerkProvider.js +1 -1
  7. package/dist/utils/errors.d.ts +1 -1
  8. package/package.json +12 -33
  9. package/android/build.gradle +0 -64
  10. package/android/src/main/AndroidManifest.xml +0 -2
  11. package/android/src/main/java/expo/modules/clerk/googlesignin/ClerkGoogleSignInModule.kt +0 -264
  12. package/app.plugin.js +0 -1
  13. package/dist/google-one-tap/ClerkGoogleOneTapSignIn.d.ts +0 -104
  14. package/dist/google-one-tap/ClerkGoogleOneTapSignIn.d.ts.map +0 -1
  15. package/dist/google-one-tap/ClerkGoogleOneTapSignIn.js +0 -153
  16. package/dist/google-one-tap/ClerkGoogleOneTapSignIn.js.map +0 -1
  17. package/dist/google-one-tap/index.d.ts +0 -3
  18. package/dist/google-one-tap/index.d.ts.map +0 -1
  19. package/dist/google-one-tap/index.js +0 -37
  20. package/dist/google-one-tap/index.js.map +0 -1
  21. package/dist/google-one-tap/types.d.ts +0 -139
  22. package/dist/google-one-tap/types.d.ts.map +0 -1
  23. package/dist/google-one-tap/types.js +0 -17
  24. package/dist/google-one-tap/types.js.map +0 -1
  25. package/dist/hooks/useSignInWithGoogle.android.d.ts +0 -47
  26. package/dist/hooks/useSignInWithGoogle.android.d.ts.map +0 -1
  27. package/dist/hooks/useSignInWithGoogle.android.js +0 -65
  28. package/dist/hooks/useSignInWithGoogle.android.js.map +0 -1
  29. package/dist/hooks/useSignInWithGoogle.d.ts +0 -52
  30. package/dist/hooks/useSignInWithGoogle.d.ts.map +0 -1
  31. package/dist/hooks/useSignInWithGoogle.ios.d.ts +0 -47
  32. package/dist/hooks/useSignInWithGoogle.ios.d.ts.map +0 -1
  33. package/dist/hooks/useSignInWithGoogle.ios.js +0 -70
  34. package/dist/hooks/useSignInWithGoogle.ios.js.map +0 -1
  35. package/dist/hooks/useSignInWithGoogle.js +0 -39
  36. package/dist/hooks/useSignInWithGoogle.js.map +0 -1
  37. package/dist/hooks/useSignInWithGoogle.shared.d.ts +0 -17
  38. package/dist/hooks/useSignInWithGoogle.shared.d.ts.map +0 -1
  39. package/dist/hooks/useSignInWithGoogle.shared.js +0 -112
  40. package/dist/hooks/useSignInWithGoogle.shared.js.map +0 -1
  41. package/dist/hooks/useSignInWithGoogle.types.d.ts +0 -12
  42. package/dist/hooks/useSignInWithGoogle.types.d.ts.map +0 -1
  43. package/dist/hooks/useSignInWithGoogle.types.js +0 -17
  44. package/dist/hooks/useSignInWithGoogle.types.js.map +0 -1
  45. package/expo-module.config.json +0 -9
  46. package/ios/ClerkGoogleSignIn.podspec +0 -22
  47. package/ios/ClerkGoogleSignInModule.swift +0 -229
  48. package/plugin/build/withClerkExpo.d.ts +0 -3
  49. package/plugin/build/withClerkExpo.js +0 -36
  50. package/plugin/src/withClerkExpo.ts +0 -45
  51. package/plugin/tsconfig.json +0 -15
@@ -1,153 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var ClerkGoogleOneTapSignIn_exports = {};
20
- __export(ClerkGoogleOneTapSignIn_exports, {
21
- ClerkGoogleOneTapSignIn: () => ClerkGoogleOneTapSignIn,
22
- isCancelledResponse: () => isCancelledResponse,
23
- isErrorWithCode: () => isErrorWithCode,
24
- isNoSavedCredentialFoundResponse: () => isNoSavedCredentialFoundResponse,
25
- isSuccessResponse: () => isSuccessResponse
26
- });
27
- module.exports = __toCommonJS(ClerkGoogleOneTapSignIn_exports);
28
- var import_expo_modules_core = require("expo-modules-core");
29
- let _nativeModule = null;
30
- function getNativeModule() {
31
- if (!_nativeModule) {
32
- _nativeModule = (0, import_expo_modules_core.requireNativeModule)("ClerkGoogleSignIn");
33
- }
34
- return _nativeModule;
35
- }
36
- function isCancelledResponse(response) {
37
- return response.type === "cancelled";
38
- }
39
- function isNoSavedCredentialFoundResponse(response) {
40
- return response.type === "noSavedCredentialFound";
41
- }
42
- function isSuccessResponse(response) {
43
- return response.type === "success";
44
- }
45
- function isErrorWithCode(error) {
46
- return error !== null && typeof error === "object" && "code" in error && typeof error.code === "string";
47
- }
48
- const ClerkGoogleOneTapSignIn = {
49
- /**
50
- * Configure Google Sign-In. Must be called before any sign-in methods.
51
- *
52
- * @param params - Configuration parameters
53
- * @param params.webClientId - The web client ID from Google Cloud Console (required)
54
- * @param params.hostedDomain - Optional domain restriction
55
- * @param params.autoSelectEnabled - Auto-select for single credential (default: false)
56
- */
57
- configure(params) {
58
- getNativeModule().configure(params);
59
- },
60
- /**
61
- * Attempt to sign in with saved credentials (One Tap).
62
- *
63
- * This method will show the One Tap UI if there are saved credentials,
64
- * or return a "noSavedCredentialFound" response if there are none.
65
- *
66
- * @param params - Sign-in parameters
67
- * @param params.nonce - Cryptographic nonce for replay protection
68
- * @param params.filterByAuthorizedAccounts - Only show previously authorized accounts (default: true)
69
- *
70
- * @returns Promise resolving to OneTapResponse
71
- */
72
- async signIn(params) {
73
- try {
74
- return await getNativeModule().signIn(params != null ? params : {});
75
- } catch (error) {
76
- if (isErrorWithCode(error)) {
77
- if (error.code === "SIGN_IN_CANCELLED") {
78
- return { type: "cancelled", data: null };
79
- }
80
- if (error.code === "NO_SAVED_CREDENTIAL_FOUND") {
81
- return { type: "noSavedCredentialFound", data: null };
82
- }
83
- }
84
- throw error;
85
- }
86
- },
87
- /**
88
- * Create a new account (shows all Google accounts).
89
- *
90
- * This method shows the account picker with all available Google accounts,
91
- * not just previously authorized ones.
92
- *
93
- * @param params - Create account parameters
94
- * @param params.nonce - Cryptographic nonce for replay protection
95
- *
96
- * @returns Promise resolving to OneTapResponse
97
- */
98
- async createAccount(params) {
99
- try {
100
- return await getNativeModule().createAccount(params != null ? params : {});
101
- } catch (error) {
102
- if (isErrorWithCode(error)) {
103
- if (error.code === "SIGN_IN_CANCELLED") {
104
- return { type: "cancelled", data: null };
105
- }
106
- if (error.code === "NO_SAVED_CREDENTIAL_FOUND") {
107
- return { type: "noSavedCredentialFound", data: null };
108
- }
109
- }
110
- throw error;
111
- }
112
- },
113
- /**
114
- * Present explicit sign-in UI (Google Sign-In button flow).
115
- *
116
- * This shows the full Google Sign-In UI, similar to clicking a
117
- * "Sign in with Google" button.
118
- *
119
- * @param params - Explicit sign-in parameters
120
- * @param params.nonce - Cryptographic nonce for replay protection
121
- *
122
- * @returns Promise resolving to OneTapResponse
123
- */
124
- async presentExplicitSignIn(params) {
125
- try {
126
- return await getNativeModule().presentExplicitSignIn(params != null ? params : {});
127
- } catch (error) {
128
- if (isErrorWithCode(error)) {
129
- if (error.code === "SIGN_IN_CANCELLED") {
130
- return { type: "cancelled", data: null };
131
- }
132
- }
133
- throw error;
134
- }
135
- },
136
- /**
137
- * Sign out and clear credential state.
138
- *
139
- * This disables automatic sign-in until the user signs in again.
140
- */
141
- async signOut() {
142
- await getNativeModule().signOut();
143
- }
144
- };
145
- // Annotate the CommonJS export names for ESM import in node:
146
- 0 && (module.exports = {
147
- ClerkGoogleOneTapSignIn,
148
- isCancelledResponse,
149
- isErrorWithCode,
150
- isNoSavedCredentialFoundResponse,
151
- isSuccessResponse
152
- });
153
- //# sourceMappingURL=ClerkGoogleOneTapSignIn.js.map
@@ -1 +0,0 @@
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 a code property (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 );\n}\n\n/**\n * Clerk's Google One Tap Sign-In module for Android.\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 * @example\n * ```typescript\n * import { ClerkGoogleOneTapSignIn } from '@clerk/clerk-expo';\n * import * as Crypto from 'expo-crypto';\n *\n * // Configure once at app startup\n * ClerkGoogleOneTapSignIn.configure({\n * webClientId: 'YOUR_WEB_CLIENT_ID',\n * });\n *\n * // Sign in with nonce\n * const nonce = Crypto.randomUUID();\n * const response = await ClerkGoogleOneTapSignIn.signIn({ nonce });\n *\n * if (response.type === 'success') {\n * const { idToken } = response.data;\n * // Use idToken with Clerk\n * }\n * ```\n *\n * @platform Android\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,8CAAmD,mBAAmB;AAAA,EACxF;AACA,SAAO;AACT;AAKO,SAAS,oBAAoB,UAAyD;AAC3F,SAAO,SAAS,SAAS;AAC3B;AAKO,SAAS,iCAAiC,UAA8D;AAC7G,SAAO,SAAS,SAAS;AAC3B;AAKO,SAAS,kBAAkB,UAA6D;AAC7F,SAAO,SAAS,SAAS;AAC3B;AAKO,SAAS,gBAAgB,OAA4D;AAC1F,SACE,UAAU,QACV,OAAO,UAAU,YACjB,UAAU,SACV,OAAQ,MAA4B,SAAS;AAEjD;AA8BO,MAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASrC,UAAU,QAA+B;AACvC,oBAAgB,EAAE,UAAU,MAAM;AAAA,EACpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,MAAM,OAAO,QAAgD;AAC3D,QAAI;AACF,aAAO,MAAM,gBAAgB,EAAE,OAAO,0BAAU,CAAC,CAAC;AAAA,IACpD,SAAS,OAAO;AACd,UAAI,gBAAgB,KAAK,GAAG;AAC1B,YAAI,MAAM,SAAS,qBAAqB;AACtC,iBAAO,EAAE,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,cAAc,QAAuD;AACzE,QAAI;AACF,aAAO,MAAM,gBAAgB,EAAE,cAAc,0BAAU,CAAC,CAAC;AAAA,IAC3D,SAAS,OAAO;AACd,UAAI,gBAAgB,KAAK,GAAG;AAC1B,YAAI,MAAM,SAAS,qBAAqB;AACtC,iBAAO,EAAE,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":[]}
@@ -1,3 +0,0 @@
1
- export { ClerkGoogleOneTapSignIn, isCancelledResponse, isNoSavedCredentialFoundResponse, isSuccessResponse, isErrorWithCode, } from './ClerkGoogleOneTapSignIn';
2
- export type { ConfigureParams, SignInParams, CreateAccountParams, ExplicitSignInParams, OneTapResponse, OneTapSuccessResponse, CancelledResponse, NoSavedCredentialFound, GoogleUser, GoogleSignInError, GoogleSignInErrorCode, } from './types';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/google-one-tap/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,gCAAgC,EAChC,iBAAiB,EACjB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EACV,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,UAAU,EACV,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,SAAS,CAAC"}
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var google_one_tap_exports = {};
20
- __export(google_one_tap_exports, {
21
- ClerkGoogleOneTapSignIn: () => import_ClerkGoogleOneTapSignIn.ClerkGoogleOneTapSignIn,
22
- isCancelledResponse: () => import_ClerkGoogleOneTapSignIn.isCancelledResponse,
23
- isErrorWithCode: () => import_ClerkGoogleOneTapSignIn.isErrorWithCode,
24
- isNoSavedCredentialFoundResponse: () => import_ClerkGoogleOneTapSignIn.isNoSavedCredentialFoundResponse,
25
- isSuccessResponse: () => import_ClerkGoogleOneTapSignIn.isSuccessResponse
26
- });
27
- module.exports = __toCommonJS(google_one_tap_exports);
28
- var import_ClerkGoogleOneTapSignIn = require("./ClerkGoogleOneTapSignIn");
29
- // Annotate the CommonJS export names for ESM import in node:
30
- 0 && (module.exports = {
31
- ClerkGoogleOneTapSignIn,
32
- isCancelledResponse,
33
- isErrorWithCode,
34
- isNoSavedCredentialFoundResponse,
35
- isSuccessResponse
36
- });
37
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/google-one-tap/index.ts"],"sourcesContent":["export {\n ClerkGoogleOneTapSignIn,\n isCancelledResponse,\n isNoSavedCredentialFoundResponse,\n isSuccessResponse,\n isErrorWithCode,\n} from './ClerkGoogleOneTapSignIn';\n\nexport type {\n ConfigureParams,\n SignInParams,\n CreateAccountParams,\n ExplicitSignInParams,\n OneTapResponse,\n OneTapSuccessResponse,\n CancelledResponse,\n NoSavedCredentialFound,\n GoogleUser,\n GoogleSignInError,\n GoogleSignInErrorCode,\n} from './types';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qCAMO;","names":[]}
@@ -1,139 +0,0 @@
1
- /**
2
- * Configuration parameters for Google One Tap Sign-In.
3
- */
4
- export type ConfigureParams = {
5
- /**
6
- * The web client ID from Google Cloud Console.
7
- * This is required for Google Sign-In to work.
8
- * On iOS, this is used as the serverClientID for token audience.
9
- */
10
- webClientId: string;
11
- /**
12
- * The iOS client ID from Google Cloud Console.
13
- * This is only used on iOS for the OAuth flow.
14
- * If not provided, webClientId will be used.
15
- * @platform iOS
16
- */
17
- iosClientId?: string;
18
- /**
19
- * Optional hosted domain to restrict sign-in to a specific domain.
20
- */
21
- hostedDomain?: string;
22
- /**
23
- * Whether to enable auto-select for returning users.
24
- * When true, if only one credential is available, it will be automatically selected.
25
- * @default false
26
- */
27
- autoSelectEnabled?: boolean;
28
- };
29
- /**
30
- * Parameters for the signIn method.
31
- */
32
- export type SignInParams = {
33
- /**
34
- * A cryptographically random string used to mitigate replay attacks.
35
- * The nonce will be included in the ID token.
36
- */
37
- nonce?: string;
38
- /**
39
- * Whether to filter credentials to only show accounts that have been
40
- * previously authorized for this app.
41
- * @default true
42
- */
43
- filterByAuthorizedAccounts?: boolean;
44
- };
45
- /**
46
- * Parameters for the createAccount method.
47
- */
48
- export type CreateAccountParams = {
49
- /**
50
- * A cryptographically random string used to mitigate replay attacks.
51
- * The nonce will be included in the ID token.
52
- */
53
- nonce?: string;
54
- };
55
- /**
56
- * Parameters for the presentExplicitSignIn method.
57
- */
58
- export type ExplicitSignInParams = {
59
- /**
60
- * A cryptographically random string used to mitigate replay attacks.
61
- * The nonce will be included in the ID token.
62
- */
63
- nonce?: string;
64
- };
65
- /**
66
- * User information returned from Google Sign-In.
67
- */
68
- export type GoogleUser = {
69
- /**
70
- * The user's unique Google identifier (OIDC "sub" claim).
71
- * This is distinct from the user's email address.
72
- */
73
- id: string;
74
- /**
75
- * The user's email address.
76
- */
77
- email: string;
78
- /**
79
- * The user's full display name.
80
- */
81
- name: string | null;
82
- /**
83
- * The user's given (first) name.
84
- */
85
- givenName: string | null;
86
- /**
87
- * The user's family (last) name.
88
- */
89
- familyName: string | null;
90
- /**
91
- * URL to the user's profile picture.
92
- */
93
- photo: string | null;
94
- };
95
- /**
96
- * Successful sign-in response.
97
- */
98
- export type OneTapSuccessResponse = {
99
- type: 'success';
100
- data: {
101
- /**
102
- * The Google ID token containing user information and nonce.
103
- */
104
- idToken: string;
105
- /**
106
- * The user's information.
107
- */
108
- user: GoogleUser;
109
- };
110
- };
111
- /**
112
- * Response when the user cancels the sign-in flow.
113
- */
114
- export type CancelledResponse = {
115
- type: 'cancelled';
116
- data: null;
117
- };
118
- /**
119
- * Response when no saved credential is found.
120
- */
121
- export type NoSavedCredentialFound = {
122
- type: 'noSavedCredentialFound';
123
- data: null;
124
- };
125
- /**
126
- * Union type for all possible One Tap responses.
127
- */
128
- export type OneTapResponse = OneTapSuccessResponse | CancelledResponse | NoSavedCredentialFound;
129
- /**
130
- * Error codes that can be thrown by the Google Sign-In module.
131
- */
132
- export type GoogleSignInErrorCode = 'SIGN_IN_CANCELLED' | 'NO_SAVED_CREDENTIAL_FOUND' | 'NOT_CONFIGURED' | 'GOOGLE_SIGN_IN_ERROR';
133
- /**
134
- * Error thrown by the Google Sign-In module.
135
- */
136
- export interface GoogleSignInError extends Error {
137
- code: GoogleSignInErrorCode;
138
- }
139
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
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,MAAM,GAAG,IAAI,CAAC;IAE1B;;OAEG;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE;QACJ;;WAEG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,IAAI,EAAE,UAAU,CAAC;KAClB,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,qBAAqB,GAAG,iBAAiB,GAAG,sBAAsB,CAAC;AAEhG;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC7B,mBAAmB,GACnB,2BAA2B,GAC3B,gBAAgB,GAChB,sBAAsB,CAAC;AAE3B;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,KAAK;IAC9C,IAAI,EAAE,qBAAqB,CAAC;CAC7B"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
- var types_exports = {};
16
- module.exports = __toCommonJS(types_exports);
17
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
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 */\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,47 +0,0 @@
1
- import type { StartGoogleAuthenticationFlowParams, StartGoogleAuthenticationFlowReturnType } from './useSignInWithGoogle.types';
2
- export type { StartGoogleAuthenticationFlowParams, StartGoogleAuthenticationFlowReturnType };
3
- /**
4
- * Hook for native Google Authentication on Android using Clerk's built-in Google One Tap module.
5
- *
6
- * This hook provides a simplified way to authenticate users with their Google account
7
- * using the native Android Google Sign-In UI with Credential Manager. The authentication
8
- * flow automatically handles the ID token exchange with Clerk's backend and manages
9
- * the transfer flow between sign-in and sign-up.
10
- *
11
- * Features:
12
- * - Native Google One Tap UI
13
- * - Built-in nonce support for replay attack protection
14
- * - No additional dependencies required
15
- *
16
- * @example
17
- * ```tsx
18
- * import { useSignInWithGoogle } from '@clerk/clerk-expo';
19
- * import { Button } from 'react-native';
20
- *
21
- * function GoogleSignInButton() {
22
- * const { startGoogleAuthenticationFlow } = useSignInWithGoogle();
23
- *
24
- * const onPress = async () => {
25
- * try {
26
- * const { createdSessionId, setActive } = await startGoogleAuthenticationFlow();
27
- *
28
- * if (createdSessionId && setActive) {
29
- * await setActive({ session: createdSessionId });
30
- * }
31
- * } catch (err) {
32
- * console.error('Google Authentication error:', err);
33
- * }
34
- * };
35
- *
36
- * return <Button title="Sign in with Google" onPress={onPress} />;
37
- * }
38
- * ```
39
- *
40
- * @platform Android - This is the Android-specific implementation using Credential Manager
41
- *
42
- * @returns An object containing the `startGoogleAuthenticationFlow` function
43
- */
44
- export declare function useSignInWithGoogle(): {
45
- startGoogleAuthenticationFlow: (startGoogleAuthenticationFlowParams?: StartGoogleAuthenticationFlowParams) => Promise<StartGoogleAuthenticationFlowReturnType>;
46
- };
47
- //# sourceMappingURL=useSignInWithGoogle.android.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSignInWithGoogle.android.d.ts","sourceRoot":"","sources":["../../src/hooks/useSignInWithGoogle.android.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,mCAAmC,EACnC,uCAAuC,EACxC,MAAM,6BAA6B,CAAC;AAErC,YAAY,EAAE,mCAAmC,EAAE,uCAAuC,EAAE,CAAC;AAE7F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,mBAAmB;0EAIO,mCAAmC,KACxE,OAAO,CAAC,uCAAuC,CAAC;EA2BpD"}
@@ -1,65 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
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
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var useSignInWithGoogle_android_exports = {};
30
- __export(useSignInWithGoogle_android_exports, {
31
- useSignInWithGoogle: () => useSignInWithGoogle
32
- });
33
- 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
- var import_useSignInWithGoogle = require("./useSignInWithGoogle.shared");
38
- function useSignInWithGoogle() {
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
- }
61
- // Annotate the CommonJS export names for ESM import in node:
62
- 0 && (module.exports = {
63
- useSignInWithGoogle
64
- });
65
- //# sourceMappingURL=useSignInWithGoogle.android.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/hooks/useSignInWithGoogle.android.ts"],"sourcesContent":["import { useClerk } from '@clerk/react';\nimport Constants from 'expo-constants';\n\nimport { errorThrower } from '../utils/errors';\nimport { executeGoogleAuthenticationFlow } from './useSignInWithGoogle.shared';\nimport type {\n StartGoogleAuthenticationFlowParams,\n StartGoogleAuthenticationFlowReturnType,\n} from './useSignInWithGoogle.types';\n\nexport type { StartGoogleAuthenticationFlowParams, StartGoogleAuthenticationFlowReturnType };\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 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\n const webClientId =\n Constants.expoConfig?.extra?.EXPO_PUBLIC_CLERK_GOOGLE_WEB_CLIENT_ID ||\n process.env.EXPO_PUBLIC_CLERK_GOOGLE_WEB_CLIENT_ID;\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 return executeGoogleAuthenticationFlow({ client, setActive }, { webClientId }, startGoogleAuthenticationFlowParams);\n }\n\n return {\n startGoogleAuthenticationFlow,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAyB;AACzB,4BAAsB;AAEtB,oBAA6B;AAC7B,iCAAgD;AAiDzC,SAAS,sBAAsB;AACpC,QAAM,YAAQ,uBAAS;AAEvB,iBAAe,8BACb,qCACkD;AA1DtD;AA2DI,UAAM,EAAE,QAAQ,QAAQ,UAAU,IAAI;AAEtC,QAAI,CAAC,UAAU,CAAC,QAAQ;AACtB,aAAO;AAAA,QACL,kBAAkB;AAAA,QAClB;AAAA,MACF;AAAA,IACF;AAGA,UAAM,gBACJ,iCAAAA,QAAU,eAAV,mBAAsB,UAAtB,mBAA6B,2CAC7B,QAAQ,IAAI;AAEd,QAAI,CAAC,aAAa;AAChB,aAAO,2BAAa;AAAA,QAClB;AAAA,MACF;AAAA,IACF;AAEA,eAAO,4DAAgC,EAAE,QAAQ,UAAU,GAAG,EAAE,YAAY,GAAG,mCAAmC;AAAA,EACpH;AAEA,SAAO;AAAA,IACL;AAAA,EACF;AACF;","names":["Constants"]}
@@ -1,52 +0,0 @@
1
- import type { SetActive, SignInResource, SignUpResource } from '@clerk/shared/types';
2
- type SignUpUnsafeMetadata = Record<string, unknown>;
3
- export type StartGoogleAuthenticationFlowParams = {
4
- unsafeMetadata?: SignUpUnsafeMetadata;
5
- };
6
- export type StartGoogleAuthenticationFlowReturnType = {
7
- createdSessionId: string | null;
8
- setActive?: SetActive;
9
- signIn?: SignInResource;
10
- signUp?: SignUpResource;
11
- };
12
- /**
13
- * Stub for Google Authentication hook on unsupported platforms.
14
- *
15
- * Native Google Authentication is only available on iOS and Android.
16
- * For web platforms, use the OAuth-based Google Sign-In flow instead via useSSO.
17
- *
18
- * @example
19
- * ```tsx
20
- * import { useSSO } from '@clerk/clerk-expo';
21
- * import { Button } from 'react-native';
22
- *
23
- * function GoogleSignInButton() {
24
- * const { startSSOFlow } = useSSO();
25
- *
26
- * const onPress = async () => {
27
- * try {
28
- * const { createdSessionId, setActive } = await startSSOFlow({
29
- * strategy: 'oauth_google'
30
- * });
31
- *
32
- * if (createdSessionId && setActive) {
33
- * await setActive({ session: createdSessionId });
34
- * }
35
- * } catch (err) {
36
- * console.error('Google Authentication error:', err);
37
- * }
38
- * };
39
- *
40
- * return <Button title="Sign in with Google" onPress={onPress} />;
41
- * }
42
- * ```
43
- *
44
- * @platform iOS, Android - This hook only works on iOS and Android. On other platforms, it will throw an error.
45
- *
46
- * @returns An object containing the `startGoogleAuthenticationFlow` function that throws an error
47
- */
48
- export declare function useSignInWithGoogle(): {
49
- startGoogleAuthenticationFlow: (startGoogleAuthenticationFlowParams?: StartGoogleAuthenticationFlowParams) => Promise<StartGoogleAuthenticationFlowReturnType>;
50
- };
51
- export {};
52
- //# sourceMappingURL=useSignInWithGoogle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSignInWithGoogle.d.ts","sourceRoot":"","sources":["../../src/hooks/useSignInWithGoogle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAIrF,KAAK,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEpD,MAAM,MAAM,mCAAmC,GAAG;IAChD,cAAc,CAAC,EAAE,oBAAoB,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,uCAAuC,GAAG;IACpD,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,mBAAmB,IAAI;IACrC,6BAA6B,EAAE,CAC7B,mCAAmC,CAAC,EAAE,mCAAmC,KACtE,OAAO,CAAC,uCAAuC,CAAC,CAAC;CACvD,CAaA"}
@@ -1,47 +0,0 @@
1
- import type { StartGoogleAuthenticationFlowParams, StartGoogleAuthenticationFlowReturnType } from './useSignInWithGoogle.types';
2
- export type { StartGoogleAuthenticationFlowParams, StartGoogleAuthenticationFlowReturnType };
3
- /**
4
- * Hook for native Google Authentication on iOS using Clerk's built-in Google Sign-In module.
5
- *
6
- * This hook provides a simplified way to authenticate users with their Google account
7
- * using the native iOS Google Sign-In UI. The authentication flow automatically
8
- * handles the ID token exchange with Clerk's backend and manages the transfer flow
9
- * between sign-in and sign-up.
10
- *
11
- * Features:
12
- * - Native Google Sign-In UI
13
- * - Built-in nonce support for replay attack protection
14
- * - No additional dependencies required
15
- *
16
- * @example
17
- * ```tsx
18
- * import { useSignInWithGoogle } from '@clerk/clerk-expo';
19
- * import { Button } from 'react-native';
20
- *
21
- * function GoogleSigninButton() {
22
- * const { startGoogleAuthenticationFlow } = useSignInWithGoogle();
23
- *
24
- * const onPress = async () => {
25
- * try {
26
- * const { createdSessionId, setActive } = await startGoogleAuthenticationFlow();
27
- *
28
- * if (createdSessionId && setActive) {
29
- * await setActive({ session: createdSessionId });
30
- * }
31
- * } catch (err) {
32
- * console.error('Google Authentication error:', err);
33
- * }
34
- * };
35
- *
36
- * return <Button title="Sign in with Google" onPress={onPress} />;
37
- * }
38
- * ```
39
- *
40
- * @platform iOS - This is the iOS-specific implementation using Google Sign-In SDK
41
- *
42
- * @returns An object containing the `startGoogleAuthenticationFlow` function
43
- */
44
- export declare function useSignInWithGoogle(): {
45
- startGoogleAuthenticationFlow: (startGoogleAuthenticationFlowParams?: StartGoogleAuthenticationFlowParams) => Promise<StartGoogleAuthenticationFlowReturnType>;
46
- };
47
- //# sourceMappingURL=useSignInWithGoogle.ios.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSignInWithGoogle.ios.d.ts","sourceRoot":"","sources":["../../src/hooks/useSignInWithGoogle.ios.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,mCAAmC,EACnC,uCAAuC,EACxC,MAAM,6BAA6B,CAAC;AAErC,YAAY,EAAE,mCAAmC,EAAE,uCAAuC,EAAE,CAAC;AAE7F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,mBAAmB;0EAIO,mCAAmC,KACxE,OAAO,CAAC,uCAAuC,CAAC;EAkCpD"}