@clerk/expo 3.0.0-snapshot.v20251217162523 → 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/android/build.gradle +64 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/expo/modules/clerk/googlesignin/ClerkGoogleSignInModule.kt +264 -0
- package/app.plugin.js +1 -0
- package/dist/google-one-tap/ClerkGoogleOneTapSignIn.d.ts +85 -0
- package/dist/google-one-tap/ClerkGoogleOneTapSignIn.d.ts.map +1 -0
- package/dist/google-one-tap/ClerkGoogleOneTapSignIn.js +153 -0
- package/dist/google-one-tap/ClerkGoogleOneTapSignIn.js.map +1 -0
- package/dist/google-one-tap/index.d.ts +3 -0
- package/dist/google-one-tap/index.d.ts.map +1 -0
- package/dist/google-one-tap/index.js +37 -0
- package/dist/google-one-tap/index.js.map +1 -0
- package/dist/google-one-tap/types.d.ts +145 -0
- package/dist/google-one-tap/types.d.ts.map +1 -0
- package/dist/google-one-tap/types.js +17 -0
- package/dist/google-one-tap/types.js.map +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useSignInWithGoogle.android.d.ts +46 -0
- package/dist/hooks/useSignInWithGoogle.android.d.ts.map +1 -0
- package/dist/hooks/useSignInWithGoogle.android.js +30 -0
- package/dist/hooks/useSignInWithGoogle.android.js.map +1 -0
- package/dist/hooks/useSignInWithGoogle.d.ts +52 -0
- package/dist/hooks/useSignInWithGoogle.d.ts.map +1 -0
- package/dist/hooks/useSignInWithGoogle.ios.d.ts +46 -0
- package/dist/hooks/useSignInWithGoogle.ios.d.ts.map +1 -0
- package/dist/hooks/useSignInWithGoogle.ios.js +30 -0
- package/dist/hooks/useSignInWithGoogle.ios.js.map +1 -0
- package/dist/hooks/useSignInWithGoogle.js +39 -0
- package/dist/hooks/useSignInWithGoogle.js.map +1 -0
- package/dist/hooks/useSignInWithGoogle.shared.d.ts +29 -0
- package/dist/hooks/useSignInWithGoogle.shared.d.ts.map +1 -0
- package/dist/hooks/useSignInWithGoogle.shared.js +164 -0
- package/dist/hooks/useSignInWithGoogle.shared.js.map +1 -0
- package/dist/hooks/useSignInWithGoogle.types.d.ts +12 -0
- package/dist/hooks/useSignInWithGoogle.types.d.ts.map +1 -0
- package/dist/hooks/useSignInWithGoogle.types.js +17 -0
- package/dist/hooks/useSignInWithGoogle.types.js.map +1 -0
- package/dist/provider/ClerkProvider.js +1 -1
- package/expo-module.config.json +9 -0
- package/ios/ClerkGoogleSignIn.podspec +22 -0
- package/ios/ClerkGoogleSignInModule.swift +229 -0
- package/package.json +24 -9
- package/plugin/build/withClerkExpo.d.ts +3 -0
- package/plugin/build/withClerkExpo.js +36 -0
- package/plugin/src/withClerkExpo.ts +45 -0
- package/plugin/tsconfig.json +15 -0
|
@@ -0,0 +1,145 @@
|
|
|
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
|
+
* - `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)
|
|
137
|
+
*/
|
|
138
|
+
export type GoogleSignInErrorCode = 'SIGN_IN_CANCELLED' | 'NO_SAVED_CREDENTIAL_FOUND' | 'NOT_CONFIGURED' | 'GOOGLE_SIGN_IN_ERROR' | 'E_ACTIVITY_UNAVAILABLE';
|
|
139
|
+
/**
|
|
140
|
+
* Error thrown by the Google Sign-In module.
|
|
141
|
+
*/
|
|
142
|
+
export interface GoogleSignInError extends Error {
|
|
143
|
+
code: GoogleSignInErrorCode;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +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,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;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAC7B,mBAAmB,GACnB,2BAA2B,GAC3B,gBAAgB,GAChB,sBAAsB,GACtB,wBAAwB,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,KAAK;IAC9C,IAAI,EAAE,qBAAqB,CAAC;CAC7B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { useClerk, useEmailLink, useOrganization, useOrganizationList, useSession, useSessionList, useSignIn, useSignUp, useUser, useReverification, } from '@clerk/react';
|
|
2
2
|
export * from './useSignInWithApple';
|
|
3
|
+
export * from './useSignInWithGoogle';
|
|
3
4
|
export * from './useSSO';
|
|
4
5
|
export * from './useOAuth';
|
|
5
6
|
export * from './useAuth';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,SAAS,EACT,SAAS,EACT,OAAO,EACP,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,cAAc,EACd,SAAS,EACT,SAAS,EACT,OAAO,EACP,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(hooks_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(hooks_exports);
|
|
34
34
|
var import_react = require("@clerk/react");
|
|
35
35
|
__reExport(hooks_exports, require("./useSignInWithApple"), module.exports);
|
|
36
|
+
__reExport(hooks_exports, require("./useSignInWithGoogle"), module.exports);
|
|
36
37
|
__reExport(hooks_exports, require("./useSSO"), module.exports);
|
|
37
38
|
__reExport(hooks_exports, require("./useOAuth"), module.exports);
|
|
38
39
|
__reExport(hooks_exports, require("./useAuth"), module.exports);
|
|
@@ -49,6 +50,7 @@ __reExport(hooks_exports, require("./useAuth"), module.exports);
|
|
|
49
50
|
useSignUp,
|
|
50
51
|
useUser,
|
|
51
52
|
...require("./useSignInWithApple"),
|
|
53
|
+
...require("./useSignInWithGoogle"),
|
|
52
54
|
...require("./useSSO"),
|
|
53
55
|
...require("./useOAuth"),
|
|
54
56
|
...require("./useAuth")
|
package/dist/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hooks/index.ts"],"sourcesContent":["export {\n useClerk,\n useEmailLink,\n useOrganization,\n useOrganizationList,\n useSession,\n useSessionList,\n useSignIn,\n useSignUp,\n useUser,\n useReverification,\n} from '@clerk/react';\n\nexport * from './useSignInWithApple';\nexport * from './useSSO';\nexport * from './useOAuth';\nexport * from './useAuth';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAWO;AAEP,0BAAc,iCAbd;AAcA,0BAAc,
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/index.ts"],"sourcesContent":["export {\n useClerk,\n useEmailLink,\n useOrganization,\n useOrganizationList,\n useSession,\n useSessionList,\n useSignIn,\n useSignUp,\n useUser,\n useReverification,\n} from '@clerk/react';\n\nexport * from './useSignInWithApple';\nexport * from './useSignInWithGoogle';\nexport * from './useSSO';\nexport * from './useOAuth';\nexport * from './useAuth';\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAWO;AAEP,0BAAc,iCAbd;AAcA,0BAAc,kCAdd;AAeA,0BAAc,qBAfd;AAgBA,0BAAc,uBAhBd;AAiBA,0BAAc,sBAjBd;","names":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export type { StartGoogleAuthenticationFlowParams, StartGoogleAuthenticationFlowReturnType, } from './useSignInWithGoogle.types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for native Google Authentication on Android using Clerk's built-in Google One Tap module.
|
|
4
|
+
*
|
|
5
|
+
* This hook provides a simplified way to authenticate users with their Google account
|
|
6
|
+
* using the native Android Google Sign-In UI with Credential Manager. The authentication
|
|
7
|
+
* flow automatically handles the ID token exchange with Clerk's backend and manages
|
|
8
|
+
* the transfer flow between sign-in and sign-up.
|
|
9
|
+
*
|
|
10
|
+
* Features:
|
|
11
|
+
* - Native Google One Tap UI
|
|
12
|
+
* - Built-in nonce support for replay attack protection
|
|
13
|
+
* - No additional dependencies required
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { useSignInWithGoogle } from '@clerk/clerk-expo';
|
|
18
|
+
* import { Button } from 'react-native';
|
|
19
|
+
*
|
|
20
|
+
* function GoogleSignInButton() {
|
|
21
|
+
* const { startGoogleAuthenticationFlow } = useSignInWithGoogle();
|
|
22
|
+
*
|
|
23
|
+
* const onPress = async () => {
|
|
24
|
+
* try {
|
|
25
|
+
* const { createdSessionId, setActive } = await startGoogleAuthenticationFlow();
|
|
26
|
+
*
|
|
27
|
+
* if (createdSessionId && setActive) {
|
|
28
|
+
* await setActive({ session: createdSessionId });
|
|
29
|
+
* }
|
|
30
|
+
* } catch (err) {
|
|
31
|
+
* console.error('Google Authentication error:', err);
|
|
32
|
+
* }
|
|
33
|
+
* };
|
|
34
|
+
*
|
|
35
|
+
* return <Button title="Sign in with Google" onPress={onPress} />;
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @platform Android - This is the Android-specific implementation using Credential Manager
|
|
40
|
+
*
|
|
41
|
+
* @returns An object containing the `startGoogleAuthenticationFlow` function
|
|
42
|
+
*/
|
|
43
|
+
export declare const useSignInWithGoogle: () => {
|
|
44
|
+
startGoogleAuthenticationFlow: (startGoogleAuthenticationFlowParams?: import("./useSignInWithGoogle.types").StartGoogleAuthenticationFlowParams) => Promise<import("./useSignInWithGoogle.types").StartGoogleAuthenticationFlowReturnType>;
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=useSignInWithGoogle.android.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 useSignInWithGoogle_android_exports = {};
|
|
20
|
+
__export(useSignInWithGoogle_android_exports, {
|
|
21
|
+
useSignInWithGoogle: () => useSignInWithGoogle
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(useSignInWithGoogle_android_exports);
|
|
24
|
+
var import_useSignInWithGoogle = require("./useSignInWithGoogle.shared");
|
|
25
|
+
const useSignInWithGoogle = (0, import_useSignInWithGoogle.createUseSignInWithGoogle)({ requiresIosClientId: false });
|
|
26
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
+
0 && (module.exports = {
|
|
28
|
+
useSignInWithGoogle
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=useSignInWithGoogle.android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export type { StartGoogleAuthenticationFlowParams, StartGoogleAuthenticationFlowReturnType, } from './useSignInWithGoogle.types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for native Google Authentication on iOS using Clerk's built-in Google Sign-In module.
|
|
4
|
+
*
|
|
5
|
+
* This hook provides a simplified way to authenticate users with their Google account
|
|
6
|
+
* using the native iOS Google Sign-In UI. The authentication flow automatically
|
|
7
|
+
* handles the ID token exchange with Clerk's backend and manages the transfer flow
|
|
8
|
+
* between sign-in and sign-up.
|
|
9
|
+
*
|
|
10
|
+
* Features:
|
|
11
|
+
* - Native Google Sign-In UI
|
|
12
|
+
* - Built-in nonce support for replay attack protection
|
|
13
|
+
* - No additional dependencies required
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { useSignInWithGoogle } from '@clerk/clerk-expo';
|
|
18
|
+
* import { Button } from 'react-native';
|
|
19
|
+
*
|
|
20
|
+
* function GoogleSigninButton() {
|
|
21
|
+
* const { startGoogleAuthenticationFlow } = useSignInWithGoogle();
|
|
22
|
+
*
|
|
23
|
+
* const onPress = async () => {
|
|
24
|
+
* try {
|
|
25
|
+
* const { createdSessionId, setActive } = await startGoogleAuthenticationFlow();
|
|
26
|
+
*
|
|
27
|
+
* if (createdSessionId && setActive) {
|
|
28
|
+
* await setActive({ session: createdSessionId });
|
|
29
|
+
* }
|
|
30
|
+
* } catch (err) {
|
|
31
|
+
* console.error('Google Authentication error:', err);
|
|
32
|
+
* }
|
|
33
|
+
* };
|
|
34
|
+
*
|
|
35
|
+
* return <Button title="Sign in with Google" onPress={onPress} />;
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @platform iOS - This is the iOS-specific implementation using Google Sign-In SDK
|
|
40
|
+
*
|
|
41
|
+
* @returns An object containing the `startGoogleAuthenticationFlow` function
|
|
42
|
+
*/
|
|
43
|
+
export declare const useSignInWithGoogle: () => {
|
|
44
|
+
startGoogleAuthenticationFlow: (startGoogleAuthenticationFlowParams?: import("./useSignInWithGoogle.types").StartGoogleAuthenticationFlowParams) => Promise<import("./useSignInWithGoogle.types").StartGoogleAuthenticationFlowReturnType>;
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=useSignInWithGoogle.ios.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 useSignInWithGoogle_ios_exports = {};
|
|
20
|
+
__export(useSignInWithGoogle_ios_exports, {
|
|
21
|
+
useSignInWithGoogle: () => useSignInWithGoogle
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(useSignInWithGoogle_ios_exports);
|
|
24
|
+
var import_useSignInWithGoogle = require("./useSignInWithGoogle.shared");
|
|
25
|
+
const useSignInWithGoogle = (0, import_useSignInWithGoogle.createUseSignInWithGoogle)({ requiresIosClientId: true });
|
|
26
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
+
0 && (module.exports = {
|
|
28
|
+
useSignInWithGoogle
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=useSignInWithGoogle.ios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 useSignInWithGoogle_exports = {};
|
|
20
|
+
__export(useSignInWithGoogle_exports, {
|
|
21
|
+
useSignInWithGoogle: () => useSignInWithGoogle
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(useSignInWithGoogle_exports);
|
|
24
|
+
var import_errors = require("../utils/errors");
|
|
25
|
+
function useSignInWithGoogle() {
|
|
26
|
+
function startGoogleAuthenticationFlow(_startGoogleAuthenticationFlowParams) {
|
|
27
|
+
return import_errors.errorThrower.throw(
|
|
28
|
+
'Native Google Authentication is only available on iOS and Android. For web and other platforms, please use the OAuth-based flow with useSSO and strategy: "oauth_google".'
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
startGoogleAuthenticationFlow
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
useSignInWithGoogle
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=useSignInWithGoogle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/useSignInWithGoogle.ts"],"sourcesContent":["import type { SetActive, SignInResource, SignUpResource } from '@clerk/shared/types';\n\nimport { errorThrower } from '../utils/errors';\n\ntype SignUpUnsafeMetadata = Record<string, unknown>;\n\nexport type StartGoogleAuthenticationFlowParams = {\n unsafeMetadata?: SignUpUnsafeMetadata;\n};\n\nexport type StartGoogleAuthenticationFlowReturnType = {\n createdSessionId: string | null;\n setActive?: SetActive;\n signIn?: SignInResource;\n signUp?: SignUpResource;\n};\n\n/**\n * Stub for Google Authentication hook on unsupported platforms.\n *\n * Native Google Authentication is only available on iOS and Android.\n * For web platforms, use the OAuth-based Google Sign-In flow instead via useSSO.\n *\n * @example\n * ```tsx\n * import { useSSO } from '@clerk/clerk-expo';\n * import { Button } from 'react-native';\n *\n * function GoogleSignInButton() {\n * const { startSSOFlow } = useSSO();\n *\n * const onPress = async () => {\n * try {\n * const { createdSessionId, setActive } = await startSSOFlow({\n * strategy: 'oauth_google'\n * });\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, Android - This hook only works on iOS and Android. On other platforms, it will throw an error.\n *\n * @returns An object containing the `startGoogleAuthenticationFlow` function that throws an error\n */\nexport function useSignInWithGoogle(): {\n startGoogleAuthenticationFlow: (\n startGoogleAuthenticationFlowParams?: StartGoogleAuthenticationFlowParams,\n ) => Promise<StartGoogleAuthenticationFlowReturnType>;\n} {\n function startGoogleAuthenticationFlow(\n _startGoogleAuthenticationFlowParams?: StartGoogleAuthenticationFlowParams,\n ): Promise<StartGoogleAuthenticationFlowReturnType> {\n return errorThrower.throw(\n 'Native Google Authentication is only available on iOS and Android. ' +\n 'For web and other platforms, please use the OAuth-based flow with useSSO and strategy: \"oauth_google\".',\n );\n }\n\n return {\n startGoogleAuthenticationFlow,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA6B;AAmDtB,SAAS,sBAId;AACA,WAAS,8BACP,sCACkD;AAClD,WAAO,2BAAa;AAAA,MAClB;AAAA,IAEF;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ClientResource, SetActive } from '@clerk/shared/types';
|
|
2
|
+
import type { StartGoogleAuthenticationFlowParams, StartGoogleAuthenticationFlowReturnType } from './useSignInWithGoogle.types';
|
|
3
|
+
export type GoogleClientIds = {
|
|
4
|
+
webClientId: string;
|
|
5
|
+
iosClientId?: string;
|
|
6
|
+
};
|
|
7
|
+
export type GoogleAuthenticationFlowContext = {
|
|
8
|
+
client: ClientResource;
|
|
9
|
+
setActive: SetActive;
|
|
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
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Core implementation of Google Authentication flow shared between iOS and Android.
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
export declare function executeGoogleAuthenticationFlow(context: GoogleAuthenticationFlowContext, clientIds: GoogleClientIds, params?: StartGoogleAuthenticationFlowParams): Promise<StartGoogleAuthenticationFlowReturnType>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=useSignInWithGoogle.shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|