@clerk/expo 3.0.0-snapshot.v20251217162523 → 3.0.0-snapshot.v20251217194100
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/plugin/withClerkExpo.d.ts +4 -0
- package/dist/plugin/withClerkExpo.d.ts.map +1 -0
- package/dist/plugin/withClerkExpo.js +51 -0
- package/dist/plugin/withClerkExpo.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 +19 -7
|
@@ -0,0 +1,164 @@
|
|
|
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_shared_exports = {};
|
|
30
|
+
__export(useSignInWithGoogle_shared_exports, {
|
|
31
|
+
createUseSignInWithGoogle: () => createUseSignInWithGoogle,
|
|
32
|
+
executeGoogleAuthenticationFlow: () => executeGoogleAuthenticationFlow
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(useSignInWithGoogle_shared_exports);
|
|
35
|
+
var import_react = require("@clerk/react");
|
|
36
|
+
var import_error = require("@clerk/shared/error");
|
|
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
|
+
}
|
|
87
|
+
async function executeGoogleAuthenticationFlow(context, clientIds, params) {
|
|
88
|
+
var _a;
|
|
89
|
+
const { client, setActive } = context;
|
|
90
|
+
const { signIn, signUp } = client;
|
|
91
|
+
import_google_one_tap.ClerkGoogleOneTapSignIn.configure(clientIds);
|
|
92
|
+
const { randomUUID } = await import("expo-crypto");
|
|
93
|
+
const nonce = randomUUID();
|
|
94
|
+
try {
|
|
95
|
+
const response = await import_google_one_tap.ClerkGoogleOneTapSignIn.presentExplicitSignIn({
|
|
96
|
+
nonce
|
|
97
|
+
});
|
|
98
|
+
if (!(0, import_google_one_tap.isSuccessResponse)(response)) {
|
|
99
|
+
return {
|
|
100
|
+
createdSessionId: null,
|
|
101
|
+
setActive,
|
|
102
|
+
signIn,
|
|
103
|
+
signUp
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
const { idToken } = response.data;
|
|
107
|
+
try {
|
|
108
|
+
await signIn.create({
|
|
109
|
+
strategy: "google_one_tap",
|
|
110
|
+
token: idToken
|
|
111
|
+
});
|
|
112
|
+
const userNeedsToBeCreated = signIn.firstFactorVerification.status === "transferable";
|
|
113
|
+
if (userNeedsToBeCreated) {
|
|
114
|
+
await signUp.create({
|
|
115
|
+
transfer: true,
|
|
116
|
+
unsafeMetadata: params == null ? void 0 : params.unsafeMetadata
|
|
117
|
+
});
|
|
118
|
+
return {
|
|
119
|
+
createdSessionId: signUp.createdSessionId,
|
|
120
|
+
setActive,
|
|
121
|
+
signIn,
|
|
122
|
+
signUp
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
createdSessionId: signIn.createdSessionId,
|
|
127
|
+
setActive,
|
|
128
|
+
signIn,
|
|
129
|
+
signUp
|
|
130
|
+
};
|
|
131
|
+
} catch (signInError) {
|
|
132
|
+
if ((0, import_error.isClerkAPIResponseError)(signInError) && ((_a = signInError.errors) == null ? void 0 : _a.some((err) => err.code === "external_account_not_found"))) {
|
|
133
|
+
await signUp.create({
|
|
134
|
+
strategy: "google_one_tap",
|
|
135
|
+
token: idToken,
|
|
136
|
+
unsafeMetadata: params == null ? void 0 : params.unsafeMetadata
|
|
137
|
+
});
|
|
138
|
+
return {
|
|
139
|
+
createdSessionId: signUp.createdSessionId,
|
|
140
|
+
setActive,
|
|
141
|
+
signIn,
|
|
142
|
+
signUp
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
throw signInError;
|
|
146
|
+
}
|
|
147
|
+
} catch (error) {
|
|
148
|
+
if ((0, import_google_one_tap.isErrorWithCode)(error) && error.code === "SIGN_IN_CANCELLED") {
|
|
149
|
+
return {
|
|
150
|
+
createdSessionId: null,
|
|
151
|
+
setActive,
|
|
152
|
+
signIn,
|
|
153
|
+
signUp
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
throw error;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
160
|
+
0 && (module.exports = {
|
|
161
|
+
createUseSignInWithGoogle,
|
|
162
|
+
executeGoogleAuthenticationFlow
|
|
163
|
+
});
|
|
164
|
+
//# sourceMappingURL=useSignInWithGoogle.shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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":"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","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SetActive, SignInResource, SignUpResource } from '@clerk/shared/types';
|
|
2
|
+
export 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
|
+
//# sourceMappingURL=useSignInWithGoogle.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSignInWithGoogle.types.d.ts","sourceRoot":"","sources":["../../src/hooks/useSignInWithGoogle.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE3D,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"}
|
|
@@ -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 useSignInWithGoogle_types_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(useSignInWithGoogle_types_exports);
|
|
17
|
+
//# sourceMappingURL=useSignInWithGoogle.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/hooks/useSignInWithGoogle.types.ts"],"sourcesContent":["import type { SetActive, SignInResource, SignUpResource } from '@clerk/shared/types';\n\nexport type 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"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withClerkExpo.d.ts","sourceRoot":"","sources":["../../src/plugin/withClerkExpo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAsC,MAAM,sBAAsB,CAAC;;AA4C7F,wBAAiF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 withClerkExpo_exports = {};
|
|
20
|
+
__export(withClerkExpo_exports, {
|
|
21
|
+
default: () => withClerkExpo_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(withClerkExpo_exports);
|
|
24
|
+
var import_config_plugins = require("@expo/config-plugins");
|
|
25
|
+
const pkg = require("../../package.json");
|
|
26
|
+
const withClerkGoogleSignIn = (config) => {
|
|
27
|
+
var _a;
|
|
28
|
+
const iosUrlScheme = process.env.EXPO_PUBLIC_CLERK_GOOGLE_IOS_URL_SCHEME || ((_a = config.extra) == null ? void 0 : _a.EXPO_PUBLIC_CLERK_GOOGLE_IOS_URL_SCHEME);
|
|
29
|
+
if (!iosUrlScheme) {
|
|
30
|
+
return config;
|
|
31
|
+
}
|
|
32
|
+
return (0, import_config_plugins.withInfoPlist)(config, (modConfig) => {
|
|
33
|
+
if (!Array.isArray(modConfig.modResults.CFBundleURLTypes)) {
|
|
34
|
+
modConfig.modResults.CFBundleURLTypes = [];
|
|
35
|
+
}
|
|
36
|
+
const schemeExists = modConfig.modResults.CFBundleURLTypes.some(
|
|
37
|
+
(urlType) => {
|
|
38
|
+
var _a2;
|
|
39
|
+
return (_a2 = urlType.CFBundleURLSchemes) == null ? void 0 : _a2.includes(iosUrlScheme);
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
if (!schemeExists) {
|
|
43
|
+
modConfig.modResults.CFBundleURLTypes.push({
|
|
44
|
+
CFBundleURLSchemes: [iosUrlScheme]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return modConfig;
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
var withClerkExpo_default = (0, import_config_plugins.createRunOncePlugin)(withClerkGoogleSignIn, pkg.name, pkg.version);
|
|
51
|
+
//# sourceMappingURL=withClerkExpo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/plugin/withClerkExpo.ts"],"sourcesContent":["import { type ConfigPlugin, createRunOncePlugin, withInfoPlist } from '@expo/config-plugins';\n\nconst pkg = require('../../package.json');\n\n/**\n * Expo config plugin for @clerk/expo.\n *\n * This plugin configures the iOS URL scheme required for Google Sign-In.\n * The native Android module is automatically linked via expo-module.config.json.\n */\nconst withClerkGoogleSignIn: ConfigPlugin = config => {\n // Get the iOS URL scheme from environment or config.extra\n // We capture it here before entering the mod callback\n const iosUrlScheme =\n process.env.EXPO_PUBLIC_CLERK_GOOGLE_IOS_URL_SCHEME ||\n (config as { extra?: Record<string, string> }).extra?.EXPO_PUBLIC_CLERK_GOOGLE_IOS_URL_SCHEME;\n\n if (!iosUrlScheme) {\n // No URL scheme configured, skip iOS configuration\n return config;\n }\n\n // Add iOS URL scheme for Google Sign-In\n return withInfoPlist(config, modConfig => {\n if (!Array.isArray(modConfig.modResults.CFBundleURLTypes)) {\n modConfig.modResults.CFBundleURLTypes = [];\n }\n\n // Check if the scheme is already added to avoid duplicates\n const schemeExists = modConfig.modResults.CFBundleURLTypes.some(urlType =>\n urlType.CFBundleURLSchemes?.includes(iosUrlScheme),\n );\n\n if (!schemeExists) {\n // Add Google Sign-In URL scheme\n modConfig.modResults.CFBundleURLTypes.push({\n CFBundleURLSchemes: [iosUrlScheme],\n });\n }\n\n return modConfig;\n });\n};\n\nexport default createRunOncePlugin(withClerkGoogleSignIn, pkg.name, pkg.version);\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAAsE;AAEtE,MAAM,MAAM,QAAQ,oBAAoB;AAQxC,MAAM,wBAAsC,YAAU;AAVtD;AAaE,QAAM,eACJ,QAAQ,IAAI,6CACX,YAA8C,UAA9C,mBAAqD;AAExD,MAAI,CAAC,cAAc;AAEjB,WAAO;AAAA,EACT;AAGA,aAAO,qCAAc,QAAQ,eAAa;AACxC,QAAI,CAAC,MAAM,QAAQ,UAAU,WAAW,gBAAgB,GAAG;AACzD,gBAAU,WAAW,mBAAmB,CAAC;AAAA,IAC3C;AAGA,UAAM,eAAe,UAAU,WAAW,iBAAiB;AAAA,MAAK,aAAQ;AA7B5E,YAAAA;AA8BM,gBAAAA,MAAA,QAAQ,uBAAR,gBAAAA,IAA4B,SAAS;AAAA;AAAA,IACvC;AAEA,QAAI,CAAC,cAAc;AAEjB,gBAAU,WAAW,iBAAiB,KAAK;AAAA,QACzC,oBAAoB,CAAC,YAAY;AAAA,MACnC,CAAC;AAAA,IACH;AAEA,WAAO;AAAA,EACT,CAAC;AACH;AAEA,IAAO,4BAAQ,2CAAoB,uBAAuB,IAAI,MAAM,IAAI,OAAO;","names":["_a"]}
|
|
@@ -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.v20251217194100"
|
|
43
43
|
};
|
|
44
44
|
function ClerkProvider(props) {
|
|
45
45
|
const {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, '..', 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = 'ClerkGoogleSignIn'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = 'Native Google Sign-In module for Clerk Expo'
|
|
9
|
+
s.description = 'Native Google Sign-In functionality using Google Sign-In SDK with nonce support for Clerk authentication'
|
|
10
|
+
s.license = package['license']
|
|
11
|
+
s.author = package['author']
|
|
12
|
+
s.homepage = package['homepage']
|
|
13
|
+
s.platforms = { :ios => '13.4' }
|
|
14
|
+
s.swift_version = '5.4'
|
|
15
|
+
s.source = { :git => 'https://github.com/clerk/javascript.git' }
|
|
16
|
+
s.static_framework = true
|
|
17
|
+
|
|
18
|
+
s.dependency 'ExpoModulesCore'
|
|
19
|
+
s.dependency 'GoogleSignIn', '~> 9.0'
|
|
20
|
+
|
|
21
|
+
s.source_files = '*.swift'
|
|
22
|
+
end
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import ExpoModulesCore
|
|
2
|
+
import GoogleSignIn
|
|
3
|
+
|
|
4
|
+
public class ClerkGoogleSignInModule: Module {
|
|
5
|
+
private var clientId: String?
|
|
6
|
+
private var hostedDomain: String?
|
|
7
|
+
|
|
8
|
+
public func definition() -> ModuleDefinition {
|
|
9
|
+
Name("ClerkGoogleSignIn")
|
|
10
|
+
|
|
11
|
+
// Configure the module
|
|
12
|
+
Function("configure") { (params: ConfigureParams) in
|
|
13
|
+
self.clientId = params.iosClientId ?? params.webClientId
|
|
14
|
+
self.hostedDomain = params.hostedDomain
|
|
15
|
+
|
|
16
|
+
// Set the configuration globally
|
|
17
|
+
// clientID: iOS client ID for OAuth flow
|
|
18
|
+
// serverClientID: Web client ID for token audience (what Clerk backend verifies)
|
|
19
|
+
if let clientId = self.clientId {
|
|
20
|
+
let config = GIDConfiguration(
|
|
21
|
+
clientID: clientId,
|
|
22
|
+
serverClientID: params.webClientId
|
|
23
|
+
)
|
|
24
|
+
GIDSignIn.sharedInstance.configuration = config
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Sign in - attempts sign-in with hint if available
|
|
29
|
+
AsyncFunction("signIn") { (params: SignInParams?, promise: Promise) in
|
|
30
|
+
guard self.clientId != nil else {
|
|
31
|
+
promise.reject(NotConfiguredException())
|
|
32
|
+
return
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
DispatchQueue.main.async {
|
|
36
|
+
guard let presentingVC = self.getPresentingViewController() else {
|
|
37
|
+
promise.reject(GoogleSignInException(message: "No presenting view controller available"))
|
|
38
|
+
return
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Build sign-in hint if filtering by authorized accounts
|
|
42
|
+
let hint: String? = params?.filterByAuthorizedAccounts == true
|
|
43
|
+
? GIDSignIn.sharedInstance.currentUser?.profile?.email
|
|
44
|
+
: nil
|
|
45
|
+
|
|
46
|
+
GIDSignIn.sharedInstance.signIn(
|
|
47
|
+
withPresenting: presentingVC,
|
|
48
|
+
hint: hint,
|
|
49
|
+
additionalScopes: nil,
|
|
50
|
+
nonce: params?.nonce
|
|
51
|
+
) { result, error in
|
|
52
|
+
self.handleSignInResult(result: result, error: error, promise: promise)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Create account - shows account creation UI (same as sign in on iOS)
|
|
58
|
+
AsyncFunction("createAccount") { (params: CreateAccountParams?, promise: Promise) in
|
|
59
|
+
guard self.clientId != nil else {
|
|
60
|
+
promise.reject(NotConfiguredException())
|
|
61
|
+
return
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
DispatchQueue.main.async {
|
|
65
|
+
guard let presentingVC = self.getPresentingViewController() else {
|
|
66
|
+
promise.reject(GoogleSignInException(message: "No presenting view controller available"))
|
|
67
|
+
return
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
GIDSignIn.sharedInstance.signIn(
|
|
71
|
+
withPresenting: presentingVC,
|
|
72
|
+
hint: nil,
|
|
73
|
+
additionalScopes: nil,
|
|
74
|
+
nonce: params?.nonce
|
|
75
|
+
) { result, error in
|
|
76
|
+
self.handleSignInResult(result: result, error: error, promise: promise)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Explicit sign-in - uses standard Google Sign-In flow
|
|
82
|
+
AsyncFunction("presentExplicitSignIn") { (params: ExplicitSignInParams?, promise: Promise) in
|
|
83
|
+
guard self.clientId != nil else {
|
|
84
|
+
promise.reject(NotConfiguredException())
|
|
85
|
+
return
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
DispatchQueue.main.async {
|
|
89
|
+
guard let presentingVC = self.getPresentingViewController() else {
|
|
90
|
+
promise.reject(GoogleSignInException(message: "No presenting view controller available"))
|
|
91
|
+
return
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
GIDSignIn.sharedInstance.signIn(
|
|
95
|
+
withPresenting: presentingVC,
|
|
96
|
+
hint: nil,
|
|
97
|
+
additionalScopes: nil,
|
|
98
|
+
nonce: params?.nonce
|
|
99
|
+
) { result, error in
|
|
100
|
+
self.handleSignInResult(result: result, error: error, promise: promise)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Sign out - clears credential state
|
|
106
|
+
AsyncFunction("signOut") { (promise: Promise) in
|
|
107
|
+
GIDSignIn.sharedInstance.signOut()
|
|
108
|
+
promise.resolve(nil)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
private func getPresentingViewController() -> UIViewController? {
|
|
113
|
+
guard let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
|
|
114
|
+
let window = scene.windows.first,
|
|
115
|
+
let rootVC = window.rootViewController else {
|
|
116
|
+
return nil
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
var topVC = rootVC
|
|
120
|
+
while let presentedVC = topVC.presentedViewController {
|
|
121
|
+
topVC = presentedVC
|
|
122
|
+
}
|
|
123
|
+
return topVC
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
private func handleSignInResult(result: GIDSignInResult?, error: Error?, promise: Promise) {
|
|
127
|
+
if let error = error {
|
|
128
|
+
let nsError = error as NSError
|
|
129
|
+
|
|
130
|
+
// Check for user cancellation
|
|
131
|
+
if nsError.domain == kGIDSignInErrorDomain && nsError.code == GIDSignInError.canceled.rawValue {
|
|
132
|
+
promise.reject(SignInCancelledException())
|
|
133
|
+
return
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
promise.reject(GoogleSignInException(message: error.localizedDescription))
|
|
137
|
+
return
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
guard let result = result,
|
|
141
|
+
let idToken = result.user.idToken?.tokenString else {
|
|
142
|
+
promise.reject(GoogleSignInException(message: "No ID token received"))
|
|
143
|
+
return
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
let user = result.user
|
|
147
|
+
let profile = user.profile
|
|
148
|
+
|
|
149
|
+
let response: [String: Any] = [
|
|
150
|
+
"type": "success",
|
|
151
|
+
"data": [
|
|
152
|
+
"idToken": idToken,
|
|
153
|
+
"user": [
|
|
154
|
+
"id": user.userID ?? "",
|
|
155
|
+
"email": profile?.email ?? "",
|
|
156
|
+
"name": profile?.name ?? "",
|
|
157
|
+
"givenName": profile?.givenName ?? "",
|
|
158
|
+
"familyName": profile?.familyName ?? "",
|
|
159
|
+
"photo": profile?.imageURL(withDimension: 200)?.absoluteString ?? NSNull()
|
|
160
|
+
] as [String: Any]
|
|
161
|
+
] as [String: Any]
|
|
162
|
+
]
|
|
163
|
+
|
|
164
|
+
promise.resolve(response)
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// MARK: - Records
|
|
169
|
+
|
|
170
|
+
struct ConfigureParams: Record {
|
|
171
|
+
@Field
|
|
172
|
+
var webClientId: String = ""
|
|
173
|
+
|
|
174
|
+
@Field
|
|
175
|
+
var iosClientId: String?
|
|
176
|
+
|
|
177
|
+
@Field
|
|
178
|
+
var hostedDomain: String?
|
|
179
|
+
|
|
180
|
+
@Field
|
|
181
|
+
var autoSelectEnabled: Bool?
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
struct SignInParams: Record {
|
|
185
|
+
@Field
|
|
186
|
+
var nonce: String?
|
|
187
|
+
|
|
188
|
+
@Field
|
|
189
|
+
var filterByAuthorizedAccounts: Bool?
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
struct CreateAccountParams: Record {
|
|
193
|
+
@Field
|
|
194
|
+
var nonce: String?
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
struct ExplicitSignInParams: Record {
|
|
198
|
+
@Field
|
|
199
|
+
var nonce: String?
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// MARK: - Exceptions
|
|
203
|
+
|
|
204
|
+
class SignInCancelledException: Exception {
|
|
205
|
+
override var code: String { "SIGN_IN_CANCELLED" }
|
|
206
|
+
override var reason: String { "User cancelled the sign-in flow" }
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
class NoSavedCredentialException: Exception {
|
|
210
|
+
override var code: String { "NO_SAVED_CREDENTIAL_FOUND" }
|
|
211
|
+
override var reason: String { "No saved credential found" }
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
class NotConfiguredException: Exception {
|
|
215
|
+
override var code: String { "NOT_CONFIGURED" }
|
|
216
|
+
override var reason: String { "Google Sign-In is not configured. Call configure() first." }
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
class GoogleSignInException: Exception {
|
|
220
|
+
private let errorMessage: String
|
|
221
|
+
|
|
222
|
+
init(message: String) {
|
|
223
|
+
self.errorMessage = message
|
|
224
|
+
super.init()
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
override var code: String { "GOOGLE_SIGN_IN_ERROR" }
|
|
228
|
+
override var reason: String { errorMessage }
|
|
229
|
+
}
|
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.v20251217194100",
|
|
4
4
|
"description": "Clerk React Native/Expo library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -65,34 +65,43 @@
|
|
|
65
65
|
"source": "./src/index.ts",
|
|
66
66
|
"types": "./dist/index.d.ts",
|
|
67
67
|
"files": [
|
|
68
|
-
"dist"
|
|
68
|
+
"dist",
|
|
69
|
+
"android",
|
|
70
|
+
"ios",
|
|
71
|
+
"expo-module.config.json",
|
|
72
|
+
"app.plugin.js"
|
|
69
73
|
],
|
|
70
74
|
"dependencies": {
|
|
71
75
|
"base-64": "^1.0.0",
|
|
72
76
|
"react-native-url-polyfill": "2.0.0",
|
|
73
77
|
"tslib": "2.8.1",
|
|
74
|
-
"@clerk/clerk-js": "6.0.0-snapshot.
|
|
75
|
-
"@clerk/react": "6.0.0-snapshot.
|
|
76
|
-
"@clerk/shared": "4.0.0-snapshot.
|
|
78
|
+
"@clerk/clerk-js": "6.0.0-snapshot.v20251217194100",
|
|
79
|
+
"@clerk/react": "6.0.0-snapshot.v20251217194100",
|
|
80
|
+
"@clerk/shared": "4.0.0-snapshot.v20251217194100"
|
|
77
81
|
},
|
|
78
82
|
"devDependencies": {
|
|
83
|
+
"@expo/config-plugins": "^54.0.4",
|
|
79
84
|
"@types/base-64": "^1.0.2",
|
|
80
85
|
"expo-apple-authentication": "^7.2.4",
|
|
81
86
|
"expo-auth-session": "^5.4.0",
|
|
87
|
+
"expo-constants": "^18.0.0",
|
|
82
88
|
"expo-crypto": "^15.0.7",
|
|
83
89
|
"expo-local-authentication": "^13.8.0",
|
|
90
|
+
"expo-modules-core": "^3.0.0",
|
|
84
91
|
"expo-secure-store": "^12.8.1",
|
|
85
92
|
"expo-web-browser": "^12.8.2",
|
|
86
93
|
"react-native": "^0.81.4",
|
|
87
|
-
"@clerk/expo-passkeys": "1.0.0-snapshot.
|
|
94
|
+
"@clerk/expo-passkeys": "1.0.0-snapshot.v20251217194100"
|
|
88
95
|
},
|
|
89
96
|
"peerDependencies": {
|
|
90
|
-
"@clerk/expo-passkeys": "1.0.0-snapshot.
|
|
97
|
+
"@clerk/expo-passkeys": "1.0.0-snapshot.v20251217194100",
|
|
91
98
|
"expo": ">=53 <55",
|
|
92
99
|
"expo-apple-authentication": ">=7.0.0",
|
|
93
100
|
"expo-auth-session": ">=5",
|
|
101
|
+
"expo-constants": ">=12",
|
|
94
102
|
"expo-crypto": ">=12",
|
|
95
103
|
"expo-local-authentication": ">=13.5.0",
|
|
104
|
+
"expo-modules-core": ">=3.0.0",
|
|
96
105
|
"expo-secure-store": ">=12.4.0",
|
|
97
106
|
"expo-web-browser": ">=12.5.0",
|
|
98
107
|
"react": "^18.0.0 || ^19.0.3 || ^19.1.4 || ^19.2.3 || ^19.3.0-0",
|
|
@@ -106,6 +115,9 @@
|
|
|
106
115
|
"expo-apple-authentication": {
|
|
107
116
|
"optional": true
|
|
108
117
|
},
|
|
118
|
+
"expo-constants": {
|
|
119
|
+
"optional": true
|
|
120
|
+
},
|
|
109
121
|
"expo-crypto": {
|
|
110
122
|
"optional": true
|
|
111
123
|
},
|