@turnkey/sdk-browser 1.16.0 → 2.0.0
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/CHANGELOG.md +53 -0
- package/dist/__clients__/base-client.d.ts +7 -0
- package/dist/__clients__/base-client.d.ts.map +1 -0
- package/dist/__clients__/base-client.js +13 -0
- package/dist/__clients__/base-client.js.map +1 -0
- package/dist/__clients__/base-client.mjs +11 -0
- package/dist/__clients__/base-client.mjs.map +1 -0
- package/dist/__clients__/browser-clients.d.ts +243 -0
- package/dist/__clients__/browser-clients.d.ts.map +1 -0
- package/dist/__clients__/browser-clients.js +633 -0
- package/dist/__clients__/browser-clients.js.map +1 -0
- package/dist/__clients__/browser-clients.mjs +628 -0
- package/dist/__clients__/browser-clients.mjs.map +1 -0
- package/dist/__generated__/sdk-client-base.d.ts.map +1 -1
- package/dist/__generated__/sdk-client-base.js +106 -110
- package/dist/__generated__/sdk-client-base.js.map +1 -1
- package/dist/__generated__/sdk-client-base.mjs +106 -110
- package/dist/__generated__/sdk-client-base.mjs.map +1 -1
- package/dist/__generated__/version.d.ts +1 -1
- package/dist/__generated__/version.d.ts.map +1 -1
- package/dist/__generated__/version.js +1 -1
- package/dist/__generated__/version.mjs +1 -1
- package/dist/__types__/base.d.ts +12 -0
- package/dist/__types__/base.d.ts.map +1 -1
- package/dist/__types__/base.js +5 -0
- package/dist/__types__/base.js.map +1 -1
- package/dist/__types__/base.mjs +6 -1
- package/dist/__types__/base.mjs.map +1 -1
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +6 -0
- package/dist/constants.js.map +1 -0
- package/dist/constants.mjs +4 -0
- package/dist/constants.mjs.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/models.d.ts +1 -1
- package/dist/models.d.ts.map +1 -1
- package/dist/sdk-client.d.ts +14 -186
- package/dist/sdk-client.d.ts.map +1 -1
- package/dist/sdk-client.js +75 -437
- package/dist/sdk-client.js.map +1 -1
- package/dist/sdk-client.mjs +69 -431
- package/dist/sdk-client.mjs.map +1 -1
- package/dist/storage.d.ts +23 -3
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +17 -0
- package/dist/storage.js.map +1 -1
- package/dist/storage.mjs +17 -1
- package/dist/storage.mjs.map +1 -1
- package/package.json +6 -5
package/dist/sdk-client.js
CHANGED
|
@@ -1,39 +1,37 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var webauthnStamper = require('@turnkey/webauthn-stamper');
|
|
4
|
-
var iframeStamper = require('@turnkey/iframe-stamper');
|
|
5
|
-
var http = require('@turnkey/http');
|
|
6
3
|
var walletStamper = require('@turnkey/wallet-stamper');
|
|
7
|
-
var
|
|
4
|
+
var iframeStamper = require('@turnkey/iframe-stamper');
|
|
5
|
+
var webauthnStamper = require('@turnkey/webauthn-stamper');
|
|
8
6
|
var window = require('./__polyfills__/window.js');
|
|
9
7
|
var base = require('./__types__/base.js');
|
|
10
|
-
var sdkClientBase = require('./__generated__/sdk-client-base.js');
|
|
11
8
|
var storage = require('./storage.js');
|
|
12
|
-
var
|
|
9
|
+
var browserClients = require('./__clients__/browser-clients.js');
|
|
10
|
+
var version = require('./__generated__/version.js');
|
|
13
11
|
|
|
14
|
-
const DEFAULT_SESSION_EXPIRATION = "900"; // default to 15 minutes
|
|
15
12
|
class TurnkeyBrowserSDK {
|
|
16
13
|
constructor(config) {
|
|
17
14
|
/**
|
|
18
|
-
* Creates a passkey client. The parameters
|
|
19
|
-
* @param
|
|
20
|
-
* @param timeout optional timeout (defaults to 5mins)
|
|
21
|
-
* @param userVerification optional UV flag (defaults to "preferred")
|
|
22
|
-
* @param allowCredentials optional allowCredentials array (defaults to empty array)
|
|
15
|
+
* Creates a passkey client. The parameters override the default values passed to the underlying Turnkey `WebauthnStamper`
|
|
16
|
+
* @param PasskeyClientParams
|
|
23
17
|
* @returns new TurnkeyPasskeyClient
|
|
24
18
|
*/
|
|
25
|
-
this.passkeyClient = (
|
|
26
|
-
const targetRpId = rpId ?? this.config.rpId ?? window.location.hostname;
|
|
19
|
+
this.passkeyClient = (params) => {
|
|
20
|
+
const targetRpId = params?.rpId ?? this.config.rpId ?? window.location.hostname;
|
|
27
21
|
if (!targetRpId) {
|
|
28
22
|
throw new Error("Tried to initialize a passkey client with no rpId defined");
|
|
29
23
|
}
|
|
30
24
|
this.stamper = new webauthnStamper.WebauthnStamper({
|
|
31
25
|
rpId: targetRpId,
|
|
32
|
-
...(timeout !== undefined && { timeout }),
|
|
33
|
-
...(userVerification !== undefined && {
|
|
34
|
-
|
|
26
|
+
...(params?.timeout !== undefined && { timeout: params?.timeout }),
|
|
27
|
+
...(params?.userVerification !== undefined && {
|
|
28
|
+
userVerification: params?.userVerification,
|
|
29
|
+
}),
|
|
30
|
+
...(params?.allowCredentials !== undefined && {
|
|
31
|
+
allowCredentials: params?.allowCredentials,
|
|
32
|
+
}),
|
|
35
33
|
});
|
|
36
|
-
return new TurnkeyPasskeyClient({
|
|
34
|
+
return new browserClients.TurnkeyPasskeyClient({
|
|
37
35
|
stamper: this.stamper,
|
|
38
36
|
apiBaseUrl: this.config.apiBaseUrl,
|
|
39
37
|
organizationId: this.config.defaultOrganizationId,
|
|
@@ -49,15 +47,15 @@ class TurnkeyBrowserSDK {
|
|
|
49
47
|
iframeUrl: params.iframeUrl,
|
|
50
48
|
iframeElementId: TurnkeyIframeElementId,
|
|
51
49
|
});
|
|
52
|
-
await this.stamper.init();
|
|
53
|
-
return new TurnkeyIframeClient({
|
|
50
|
+
await this.stamper.init(params.dangerouslyOverrideIframeKeyTtl ?? undefined);
|
|
51
|
+
return new browserClients.TurnkeyIframeClient({
|
|
54
52
|
stamper: this.stamper,
|
|
55
53
|
apiBaseUrl: this.config.apiBaseUrl,
|
|
56
54
|
organizationId: this.config.defaultOrganizationId,
|
|
57
55
|
});
|
|
58
56
|
};
|
|
59
57
|
this.walletClient = (wallet) => {
|
|
60
|
-
return new TurnkeyWalletClient({
|
|
58
|
+
return new browserClients.TurnkeyWalletClient({
|
|
61
59
|
stamper: new walletStamper.WalletStamper(wallet),
|
|
62
60
|
wallet,
|
|
63
61
|
apiBaseUrl: this.config.apiBaseUrl,
|
|
@@ -106,7 +104,7 @@ class TurnkeyBrowserSDK {
|
|
|
106
104
|
return;
|
|
107
105
|
}
|
|
108
106
|
if (currentUser?.session?.read?.expiry > Date.now()) {
|
|
109
|
-
return new TurnkeyBrowserClient({
|
|
107
|
+
return new browserClients.TurnkeyBrowserClient({
|
|
110
108
|
readOnlySession: currentUser?.session?.read?.token,
|
|
111
109
|
apiBaseUrl: this.config.apiBaseUrl,
|
|
112
110
|
organizationId: currentUser?.organization?.organizationId ??
|
|
@@ -114,13 +112,13 @@ class TurnkeyBrowserSDK {
|
|
|
114
112
|
});
|
|
115
113
|
}
|
|
116
114
|
else {
|
|
117
|
-
this.
|
|
115
|
+
await this.logout();
|
|
118
116
|
}
|
|
119
117
|
return;
|
|
120
118
|
};
|
|
121
119
|
/**
|
|
122
120
|
* If there is a valid, current read-session, this will return an auth bundle and its expiration. This auth bundle can be used in conjunction with an iframeStamper to create a read + write session.
|
|
123
|
-
*
|
|
121
|
+
* @deprecated use `getSession` instead
|
|
124
122
|
* @returns {Promise<ReadWriteSession | undefined>}
|
|
125
123
|
*/
|
|
126
124
|
this.getReadWriteSession = async () => {
|
|
@@ -136,14 +134,21 @@ class TurnkeyBrowserSDK {
|
|
|
136
134
|
return;
|
|
137
135
|
};
|
|
138
136
|
/**
|
|
139
|
-
*
|
|
140
|
-
* It has been replaced by the `getReadWriteSession` method.
|
|
141
|
-
* Fetches an auth bundle stored in local storage.
|
|
137
|
+
* If there is a valid, active READ_WRITE session, this will return it
|
|
142
138
|
*
|
|
143
|
-
* @returns {Promise<
|
|
139
|
+
* @returns {Promise<Session | undefined>}
|
|
144
140
|
*/
|
|
145
|
-
this.
|
|
146
|
-
|
|
141
|
+
this.getSession = async () => {
|
|
142
|
+
const currentSession = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
143
|
+
if (currentSession?.sessionType === base.SessionType.READ_WRITE) {
|
|
144
|
+
if (currentSession?.expiry > Date.now()) {
|
|
145
|
+
return currentSession;
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
await storage.removeStorageValue(storage.StorageKeys.Session);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return;
|
|
147
152
|
};
|
|
148
153
|
/**
|
|
149
154
|
* Fetches the current user's organization details.
|
|
@@ -160,427 +165,60 @@ class TurnkeyBrowserSDK {
|
|
|
160
165
|
* @returns {Promise<User | undefined>}
|
|
161
166
|
*/
|
|
162
167
|
this.getCurrentUser = async () => {
|
|
163
|
-
return await storage.getStorageValue(storage.StorageKeys.UserSession);
|
|
164
|
-
};
|
|
165
|
-
/**
|
|
166
|
-
* Clears out all data pertaining to a user session.
|
|
167
|
-
*
|
|
168
|
-
* @returns {Promise<boolean>}
|
|
169
|
-
*/
|
|
170
|
-
this.logoutUser = async () => {
|
|
171
|
-
await storage.removeStorageValue(storage.StorageKeys.AuthBundle); // DEPRECATED
|
|
172
|
-
await storage.removeStorageValue(storage.StorageKeys.CurrentUser);
|
|
173
|
-
await storage.removeStorageValue(storage.StorageKeys.UserSession);
|
|
174
|
-
await storage.removeStorageValue(storage.StorageKeys.ReadWriteSession);
|
|
175
|
-
return true;
|
|
176
|
-
};
|
|
177
|
-
this.config = config;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
class TurnkeyBrowserClient extends sdkClientBase.TurnkeySDKClientBase {
|
|
181
|
-
constructor(config, authClient) {
|
|
182
|
-
super(config);
|
|
183
|
-
this.login = async (config) => {
|
|
184
|
-
const readOnlySessionResult = await this.createReadOnlySession(config || {});
|
|
185
|
-
await storage.saveSession(readOnlySessionResult, this.authClient);
|
|
186
|
-
return readOnlySessionResult;
|
|
187
|
-
};
|
|
188
|
-
/**
|
|
189
|
-
* Creates a read-write session. This method infers the current user's organization ID and target userId.
|
|
190
|
-
* To be used in conjunction with an `iframeStamper`: the resulting session's credential bundle can be
|
|
191
|
-
* injected into an iframeStamper to create a session that enables both read and write requests.
|
|
192
|
-
*
|
|
193
|
-
* @param targetEmbeddedKey
|
|
194
|
-
* @param expirationSeconds
|
|
195
|
-
* @param userId
|
|
196
|
-
* @returns {Promise<SdkApiTypes.TCreateReadWriteSessionResponse>}
|
|
197
|
-
*/
|
|
198
|
-
this.loginWithReadWriteSession = async (targetEmbeddedKey, expirationSeconds = DEFAULT_SESSION_EXPIRATION, userId) => {
|
|
199
|
-
const readWriteSessionResult = await this.createReadWriteSession({
|
|
200
|
-
targetPublicKey: targetEmbeddedKey,
|
|
201
|
-
expirationSeconds,
|
|
202
|
-
userId: userId,
|
|
203
|
-
});
|
|
204
|
-
// Ensure session and sessionExpiry are included in the object
|
|
205
|
-
const readWriteSessionResultWithSession = {
|
|
206
|
-
...readWriteSessionResult,
|
|
207
|
-
credentialBundle: readWriteSessionResult.credentialBundle,
|
|
208
|
-
sessionExpiry: Date.now() + Number(expirationSeconds) * 1000,
|
|
209
|
-
};
|
|
210
|
-
// store auth bundle in local storage
|
|
211
|
-
await storage.saveSession(readWriteSessionResultWithSession, this.authClient);
|
|
212
|
-
return readWriteSessionResultWithSession;
|
|
213
|
-
};
|
|
214
|
-
/**
|
|
215
|
-
* Logs in with an existing auth bundle. this bundle enables both read and write requests.
|
|
216
|
-
*
|
|
217
|
-
* @param credentialBundle
|
|
218
|
-
* @param expirationSeconds
|
|
219
|
-
* @returns {Promise<boolean>}
|
|
220
|
-
*/
|
|
221
|
-
this.loginWithAuthBundle = async (credentialBundle, expirationSeconds = DEFAULT_SESSION_EXPIRATION) => {
|
|
222
|
-
try {
|
|
223
|
-
const whoAmIResult = await this.getWhoami();
|
|
224
|
-
const readWriteSessionResultWithSession = {
|
|
225
|
-
...whoAmIResult,
|
|
226
|
-
credentialBundle: credentialBundle,
|
|
227
|
-
sessionExpiry: Date.now() + Number(expirationSeconds) * 1000,
|
|
228
|
-
};
|
|
229
|
-
await storage.saveSession(readWriteSessionResultWithSession, this.authClient);
|
|
230
|
-
return true;
|
|
231
|
-
}
|
|
232
|
-
catch {
|
|
233
|
-
return false;
|
|
234
|
-
}
|
|
235
|
-
};
|
|
236
|
-
/**
|
|
237
|
-
* Removes authentication factors from an end user.
|
|
238
|
-
*
|
|
239
|
-
* This function allows selectively removing:
|
|
240
|
-
* - Phone number
|
|
241
|
-
* - Email
|
|
242
|
-
* - Authenticators (by ID)
|
|
243
|
-
* - OAuth providers (by ID)
|
|
244
|
-
* - API keys (by ID)
|
|
245
|
-
*
|
|
246
|
-
* All removal operations are executed in parallel if multiple
|
|
247
|
-
* parameters are provided.
|
|
248
|
-
*
|
|
249
|
-
* @param params - A structured object containing all the removal parameters
|
|
250
|
-
* @param params.userId - Unique identifier of the user
|
|
251
|
-
* @param params.phoneNumber - true to remove the phone number
|
|
252
|
-
* @param params.email - true to remove the email
|
|
253
|
-
* @param params.authenticatorIds - Array of authenticator IDs to remove
|
|
254
|
-
* @param params.oauthProviderIds - Array of OAuth provider IDs to remove
|
|
255
|
-
* @param params.apiKeyIds - Array of API key IDs to remove
|
|
256
|
-
* @returns A promise that resolves to an array of results from each removal operation
|
|
257
|
-
*/
|
|
258
|
-
this.deleteUserAuth = async (params) => {
|
|
259
168
|
try {
|
|
260
|
-
const
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
169
|
+
const session = await storage.getStorageValue(storage.StorageKeys.Session);
|
|
170
|
+
if (session?.userId && session?.organizationId) {
|
|
171
|
+
return {
|
|
172
|
+
userId: session.userId,
|
|
173
|
+
organization: {
|
|
174
|
+
organizationId: session.organizationId,
|
|
175
|
+
organizationName: "",
|
|
176
|
+
},
|
|
177
|
+
session: {
|
|
178
|
+
...(session.sessionType === base.SessionType.READ_ONLY && {
|
|
179
|
+
read: {
|
|
180
|
+
token: session.token,
|
|
181
|
+
expiry: session.expiry,
|
|
182
|
+
},
|
|
183
|
+
}),
|
|
184
|
+
...(session.sessionType === base.SessionType.READ_WRITE && {
|
|
185
|
+
write: {
|
|
186
|
+
credentialBundle: session.token,
|
|
187
|
+
expiry: session.expiry,
|
|
188
|
+
},
|
|
189
|
+
}),
|
|
190
|
+
},
|
|
191
|
+
};
|
|
273
192
|
}
|
|
274
|
-
|
|
275
|
-
|
|
193
|
+
else {
|
|
194
|
+
return undefined;
|
|
276
195
|
}
|
|
277
|
-
// Execute all removal operations in parallel
|
|
278
|
-
return await Promise.all(promises);
|
|
279
196
|
}
|
|
280
197
|
catch (error) {
|
|
281
|
-
|
|
282
|
-
throw error;
|
|
198
|
+
return;
|
|
283
199
|
}
|
|
284
200
|
};
|
|
285
201
|
/**
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
* This function allows selectively adding:
|
|
289
|
-
* - Phone number
|
|
290
|
-
* - Email
|
|
291
|
-
* - Authenticators
|
|
292
|
-
* - OAuth providers
|
|
293
|
-
* - API keys
|
|
202
|
+
* Clears out all data pertaining to an end user session.
|
|
294
203
|
*
|
|
295
|
-
*
|
|
296
|
-
* parameters are provided.
|
|
297
|
-
*
|
|
298
|
-
* @param params - A structured object containing all the addition/update parameters
|
|
299
|
-
* @param params.userId - Unique identifier of the user
|
|
300
|
-
* @param params.phoneNumber - New phone number for the user
|
|
301
|
-
* @param params.email - New email address for the user
|
|
302
|
-
* @param params.authenticators - Array of authenticator objects to create
|
|
303
|
-
* @param params.oauthProviders - Array of OAuth provider objects to create
|
|
304
|
-
* @param params.apiKeys - Array of API key objects to create
|
|
305
|
-
* @returns A promise that resolves to an array of results from each addition or update
|
|
204
|
+
* @returns {Promise<boolean>}
|
|
306
205
|
*/
|
|
307
|
-
this.
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
userPhoneNumber: phoneNumber,
|
|
315
|
-
userTagIds: [],
|
|
316
|
-
}));
|
|
317
|
-
}
|
|
318
|
-
if (email) {
|
|
319
|
-
promises.push(this.updateUser({ userId, userEmail: email, userTagIds: [] }));
|
|
320
|
-
}
|
|
321
|
-
if (authenticators && authenticators.length > 0) {
|
|
322
|
-
promises.push(this.createAuthenticators({ userId, authenticators }));
|
|
323
|
-
}
|
|
324
|
-
if (oauthProviders && oauthProviders.length > 0) {
|
|
325
|
-
promises.push(this.createOauthProviders({ userId, oauthProviders }));
|
|
326
|
-
}
|
|
327
|
-
if (apiKeys && apiKeys.length > 0) {
|
|
328
|
-
promises.push(this.createApiKeys({ userId, apiKeys }));
|
|
329
|
-
}
|
|
330
|
-
// Execute all additions/updates operations in parallel
|
|
331
|
-
return await Promise.all(promises);
|
|
332
|
-
}
|
|
333
|
-
catch (error) {
|
|
334
|
-
// Surface error
|
|
335
|
-
throw error;
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
this.authClient = authClient;
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* Comprehensive authentication update for an end user.
|
|
342
|
-
* Combines add/update and delete operations into a single call.
|
|
343
|
-
*
|
|
344
|
-
* The behavior is driven by whether values are set to:
|
|
345
|
-
* - A string/array (to create or update)
|
|
346
|
-
* - `null` or an array of IDs (to remove)
|
|
347
|
-
*
|
|
348
|
-
* All operations are executed in parallel where applicable.
|
|
349
|
-
*
|
|
350
|
-
* @param params - A structured object containing all the update parameters
|
|
351
|
-
* @param params.userId - Unique identifier of the user
|
|
352
|
-
* @param params.phoneNumber - String to set (new phone) or `null` to remove
|
|
353
|
-
* @param params.email - String to set (new email) or `null` to remove
|
|
354
|
-
* @param params.authenticators - Object describing authenticators to add or remove
|
|
355
|
-
* @param params.oauthProviders - Object describing OAuth providers to add or remove
|
|
356
|
-
* @param params.apiKeys - Object describing API keys to add or remove
|
|
357
|
-
*
|
|
358
|
-
* @returns A promise that resolves to a boolean indicating overall success
|
|
359
|
-
*/
|
|
360
|
-
async updateUserAuth(params) {
|
|
361
|
-
try {
|
|
362
|
-
const { userId, phoneNumber, email, authenticators, oauthProviders, apiKeys, } = params;
|
|
363
|
-
const promises = [];
|
|
364
|
-
// Handle phone/email in a single updateUser call if both are changing,
|
|
365
|
-
// or separate calls if only one is changing.
|
|
366
|
-
const userUpdates = {};
|
|
367
|
-
if (phoneNumber !== undefined) {
|
|
368
|
-
userUpdates.userPhoneNumber = phoneNumber === null ? "" : phoneNumber;
|
|
369
|
-
}
|
|
370
|
-
if (email !== undefined) {
|
|
371
|
-
userUpdates.userEmail = email === null ? "" : email;
|
|
372
|
-
}
|
|
373
|
-
if (Object.keys(userUpdates).length > 0) {
|
|
374
|
-
promises.push(this.updateUser({ userId, ...userUpdates, userTagIds: [] }));
|
|
375
|
-
}
|
|
376
|
-
// Handle authenticators
|
|
377
|
-
if (authenticators) {
|
|
378
|
-
if (authenticators.add?.length) {
|
|
379
|
-
promises.push(this.createAuthenticators({
|
|
380
|
-
userId,
|
|
381
|
-
authenticators: authenticators.add,
|
|
382
|
-
}));
|
|
383
|
-
}
|
|
384
|
-
if (authenticators.deleteIds?.length) {
|
|
385
|
-
promises.push(this.deleteAuthenticators({
|
|
386
|
-
userId,
|
|
387
|
-
authenticatorIds: authenticators.deleteIds,
|
|
388
|
-
}));
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
// Handle OAuth providers
|
|
392
|
-
if (oauthProviders) {
|
|
393
|
-
if (oauthProviders.add?.length) {
|
|
394
|
-
promises.push(this.createOauthProviders({
|
|
395
|
-
userId,
|
|
396
|
-
oauthProviders: oauthProviders.add,
|
|
397
|
-
}));
|
|
398
|
-
}
|
|
399
|
-
if (oauthProviders.deleteIds?.length) {
|
|
400
|
-
promises.push(this.deleteOauthProviders({
|
|
401
|
-
userId,
|
|
402
|
-
providerIds: oauthProviders.deleteIds,
|
|
403
|
-
}));
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
// Handle API keys
|
|
407
|
-
if (apiKeys) {
|
|
408
|
-
if (apiKeys.add?.length) {
|
|
409
|
-
promises.push(this.createApiKeys({
|
|
410
|
-
userId,
|
|
411
|
-
apiKeys: apiKeys.add,
|
|
412
|
-
}));
|
|
413
|
-
}
|
|
414
|
-
if (apiKeys.deleteIds?.length) {
|
|
415
|
-
promises.push(this.deleteApiKeys({
|
|
416
|
-
userId,
|
|
417
|
-
apiKeyIds: apiKeys.deleteIds,
|
|
418
|
-
}));
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
// Execute all requested operations in parallel
|
|
422
|
-
await Promise.all(promises);
|
|
206
|
+
this.logout = async () => {
|
|
207
|
+
await storage.removeStorageValue(storage.StorageKeys.AuthBundle); // DEPRECATED
|
|
208
|
+
await storage.removeStorageValue(storage.StorageKeys.CurrentUser);
|
|
209
|
+
await storage.removeStorageValue(storage.StorageKeys.UserSession);
|
|
210
|
+
await storage.removeStorageValue(storage.StorageKeys.ReadWriteSession);
|
|
211
|
+
await storage.removeStorageValue(storage.StorageKeys.Client);
|
|
212
|
+
await storage.removeStorageValue(storage.StorageKeys.Session);
|
|
423
213
|
return true;
|
|
424
|
-
}
|
|
425
|
-
catch (error) {
|
|
426
|
-
// Surface error
|
|
427
|
-
throw error;
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
class TurnkeyPasskeyClient extends TurnkeyBrowserClient {
|
|
432
|
-
constructor(config) {
|
|
433
|
-
super(config, base.AuthClient.Passkey);
|
|
434
|
-
/**
|
|
435
|
-
* Create a passkey for an end-user, taking care of various lower-level details.
|
|
436
|
-
*
|
|
437
|
-
* @returns {Promise<Passkey>}
|
|
438
|
-
*/
|
|
439
|
-
this.createUserPasskey = async (config = {}) => {
|
|
440
|
-
const challenge = utils.generateRandomBuffer();
|
|
441
|
-
const encodedChallenge = utils.base64UrlEncode(challenge);
|
|
442
|
-
const authenticatorUserId = utils.generateRandomBuffer();
|
|
443
|
-
// WebAuthn credential options options can be found here:
|
|
444
|
-
// https://www.w3.org/TR/webauthn-2/#sctn-sample-registration
|
|
445
|
-
//
|
|
446
|
-
// All pubkey algorithms can be found here: https://www.iana.org/assignments/cose/cose.xhtml#algorithms
|
|
447
|
-
// Turnkey only supports ES256 (-7) and RS256 (-257)
|
|
448
|
-
//
|
|
449
|
-
// The pubkey type only supports one value, "public-key"
|
|
450
|
-
// See https://www.w3.org/TR/webauthn-2/#enumdef-publickeycredentialtype for more details
|
|
451
|
-
// TODO: consider un-nesting these config params
|
|
452
|
-
const webauthnConfig = {
|
|
453
|
-
publicKey: {
|
|
454
|
-
rp: {
|
|
455
|
-
id: config.publicKey?.rp?.id ?? this.rpId,
|
|
456
|
-
name: config.publicKey?.rp?.name ?? "",
|
|
457
|
-
},
|
|
458
|
-
challenge: config.publicKey?.challenge ?? challenge,
|
|
459
|
-
pubKeyCredParams: config.publicKey?.pubKeyCredParams ?? [
|
|
460
|
-
{
|
|
461
|
-
type: "public-key",
|
|
462
|
-
alg: -7,
|
|
463
|
-
},
|
|
464
|
-
{
|
|
465
|
-
type: "public-key",
|
|
466
|
-
alg: -257,
|
|
467
|
-
},
|
|
468
|
-
],
|
|
469
|
-
user: {
|
|
470
|
-
id: config.publicKey?.user?.id ?? authenticatorUserId,
|
|
471
|
-
name: config.publicKey?.user?.name ?? "Default User",
|
|
472
|
-
displayName: config.publicKey?.user?.displayName ?? "Default User",
|
|
473
|
-
},
|
|
474
|
-
authenticatorSelection: {
|
|
475
|
-
authenticatorAttachment: config.publicKey?.authenticatorSelection?.authenticatorAttachment ??
|
|
476
|
-
undefined,
|
|
477
|
-
requireResidentKey: config.publicKey?.authenticatorSelection?.requireResidentKey ??
|
|
478
|
-
true,
|
|
479
|
-
residentKey: config.publicKey?.authenticatorSelection?.residentKey ?? "required",
|
|
480
|
-
userVerification: config.publicKey?.authenticatorSelection?.userVerification ??
|
|
481
|
-
"preferred",
|
|
482
|
-
},
|
|
483
|
-
},
|
|
484
|
-
};
|
|
485
|
-
const attestation = await http.getWebAuthnAttestation(webauthnConfig);
|
|
486
|
-
return {
|
|
487
|
-
encodedChallenge: config.publicKey?.challenge
|
|
488
|
-
? utils.base64UrlEncode(config.publicKey?.challenge)
|
|
489
|
-
: encodedChallenge,
|
|
490
|
-
attestation,
|
|
491
|
-
};
|
|
492
|
-
};
|
|
493
|
-
/**
|
|
494
|
-
* Uses passkey authentication to create a read-write session, via an embedded API key,
|
|
495
|
-
* and stores + returns the resulting auth bundle that contains the encrypted API key.
|
|
496
|
-
* This auth bundle (also referred to as a credential bundle) can be injected into an `iframeStamper`,
|
|
497
|
-
* resulting in a touch-free authenticator. Unlike `loginWithReadWriteSession`, this method
|
|
498
|
-
* assumes the end-user's organization ID (i.e. the sub-organization ID) is already known.
|
|
499
|
-
*
|
|
500
|
-
* @param userId
|
|
501
|
-
* @param targetEmbeddedKey
|
|
502
|
-
* @param expirationSeconds
|
|
503
|
-
* @param curveType
|
|
504
|
-
* @returns {Promise<ReadWriteSession>}
|
|
505
|
-
*/
|
|
506
|
-
this.createPasskeySession = async (userId, targetEmbeddedKey, expirationSeconds = DEFAULT_SESSION_EXPIRATION, organizationId) => {
|
|
507
|
-
const user = await storage.getStorageValue(storage.StorageKeys.UserSession);
|
|
508
|
-
organizationId = organizationId ?? user?.organization.organizationId;
|
|
509
|
-
if (!organizationId) {
|
|
510
|
-
throw new Error("Error creating passkey session: Organization ID is required");
|
|
511
|
-
}
|
|
512
|
-
userId = userId ?? user?.userId;
|
|
513
|
-
const { authBundle: credentialBundle, publicKey } = await utils.createEmbeddedAPIKey(targetEmbeddedKey);
|
|
514
|
-
// add API key to Turnkey User
|
|
515
|
-
await this.createApiKeys({
|
|
516
|
-
organizationId,
|
|
517
|
-
userId,
|
|
518
|
-
apiKeys: [
|
|
519
|
-
{
|
|
520
|
-
apiKeyName: `Session Key ${String(Date.now())}`,
|
|
521
|
-
publicKey,
|
|
522
|
-
expirationSeconds,
|
|
523
|
-
curveType: "API_KEY_CURVE_P256",
|
|
524
|
-
},
|
|
525
|
-
],
|
|
526
|
-
});
|
|
527
|
-
const expiry = Date.now() + Number(expirationSeconds) * 1000;
|
|
528
|
-
await storage.saveSession({
|
|
529
|
-
organizationId,
|
|
530
|
-
organizationName: user?.organization.organizationName ?? "",
|
|
531
|
-
userId,
|
|
532
|
-
username: user?.username ?? "",
|
|
533
|
-
credentialBundle,
|
|
534
|
-
sessionExpiry: expiry,
|
|
535
|
-
}, this.authClient);
|
|
536
|
-
return {
|
|
537
|
-
credentialBundle,
|
|
538
|
-
expiry,
|
|
539
|
-
};
|
|
540
|
-
};
|
|
541
|
-
this.rpId = this.stamper.rpId;
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
class TurnkeyIframeClient extends TurnkeyBrowserClient {
|
|
545
|
-
constructor(config) {
|
|
546
|
-
super(config, base.AuthClient.Iframe);
|
|
547
|
-
this.injectCredentialBundle = async (credentialBundle) => {
|
|
548
|
-
return await this.stamper.injectCredentialBundle(credentialBundle);
|
|
549
|
-
};
|
|
550
|
-
this.injectWalletExportBundle = async (credentialBundle, organizationId) => {
|
|
551
|
-
return await this.stamper.injectWalletExportBundle(credentialBundle, organizationId);
|
|
552
|
-
};
|
|
553
|
-
this.injectKeyExportBundle = async (credentialBundle, organizationId, keyFormat) => {
|
|
554
|
-
return await this.stamper.injectKeyExportBundle(credentialBundle, organizationId, keyFormat);
|
|
555
|
-
};
|
|
556
|
-
this.injectImportBundle = async (bundle, organizationId, userId) => {
|
|
557
|
-
return await this.stamper.injectImportBundle(bundle, organizationId, userId);
|
|
558
|
-
};
|
|
559
|
-
this.extractWalletEncryptedBundle = async () => {
|
|
560
|
-
return await this.stamper.extractWalletEncryptedBundle();
|
|
561
214
|
};
|
|
562
|
-
this.
|
|
563
|
-
return await this.stamper.extractKeyEncryptedBundle();
|
|
564
|
-
};
|
|
565
|
-
this.iframePublicKey = this.stamper.iframePublicKey;
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
class TurnkeyWalletClient extends TurnkeyBrowserClient {
|
|
569
|
-
constructor(config) {
|
|
570
|
-
super(config, base.AuthClient.Wallet);
|
|
571
|
-
this.wallet = config.wallet;
|
|
572
|
-
}
|
|
573
|
-
async getPublicKey() {
|
|
574
|
-
return this.wallet.getPublicKey();
|
|
575
|
-
}
|
|
576
|
-
getWalletInterface() {
|
|
577
|
-
return this.wallet;
|
|
215
|
+
this.config = config;
|
|
578
216
|
}
|
|
579
217
|
}
|
|
580
218
|
|
|
581
|
-
exports.TurnkeyBrowserClient = TurnkeyBrowserClient;
|
|
219
|
+
exports.TurnkeyBrowserClient = browserClients.TurnkeyBrowserClient;
|
|
220
|
+
exports.TurnkeyIframeClient = browserClients.TurnkeyIframeClient;
|
|
221
|
+
exports.TurnkeyPasskeyClient = browserClients.TurnkeyPasskeyClient;
|
|
222
|
+
exports.TurnkeyWalletClient = browserClients.TurnkeyWalletClient;
|
|
582
223
|
exports.TurnkeyBrowserSDK = TurnkeyBrowserSDK;
|
|
583
|
-
exports.TurnkeyIframeClient = TurnkeyIframeClient;
|
|
584
|
-
exports.TurnkeyPasskeyClient = TurnkeyPasskeyClient;
|
|
585
|
-
exports.TurnkeyWalletClient = TurnkeyWalletClient;
|
|
586
224
|
//# sourceMappingURL=sdk-client.js.map
|
package/dist/sdk-client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk-client.js","sources":["../src/sdk-client.ts"],"sourcesContent":[null],"names":["WindowWrapper","WebauthnStamper","IframeStamper","WalletStamper","VERSION","TurnkeyRequestError","getStorageValue","StorageKeys","removeStorageValue","TurnkeySDKClientBase","saveSession","AuthClient","generateRandomBuffer","base64UrlEncode","getWebAuthnAttestation","createEmbeddedAPIKey"],"mappings":";;;;;;;;;;;;;AAwCA,MAAM,0BAA0B,GAA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AAA,OAAO,MAAO,IAAI,CAAC,OAAyB,CAAC,kBAAkB,CAC7D,MAAM,EACN,cAAc,EACd,MAAM,CACP,CAAC;AACJ,SAAC,CAAC;QAEF,IAA4B,CAAA,4BAAA,GAAG,YAA4B;AACzD,YAAA,OAAO,MAAO,IAAI,CAAC,OAAyB,CAAC,4BAA4B,EAAE,CAAC;AAC9E,SAAC,CAAC;QAEF,IAAyB,CAAA,yBAAA,GAAG,YAA4B;AACtD,YAAA,OAAO,MAAO,IAAI,CAAC,OAAyB,CAAC,yBAAyB,EAAE,CAAC;AAC3E,SAAC,CAAC;QAnDA,IAAI,CAAC,eAAe,GAAI,IAAI,CAAC,OAAyB,CAAC,eAAe,CAAC;KACxE;AAmDF,CAAA;AAEK,MAAO,mBAAoB,SAAQ,oBAAoB,CAAA;AAG3D,IAAA,WAAA,CAAY,MAAiC,EAAA;AAC3C,QAAA,KAAK,CAAC,MAAM,EAAEA,eAAU,CAAC,MAAM,CAAC,CAAC;AACjC,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;KAC7B;AAED,IAAA,MAAM,YAAY,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;KACnC;IAED,kBAAkB,GAAA;QAChB,OAAO,IAAI,CAAC,MAAM,CAAC;KACpB;AACF;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"sdk-client.js","sources":["../src/sdk-client.ts"],"sourcesContent":[null],"names":["WindowWrapper","WebauthnStamper","TurnkeyPasskeyClient","IframeStamper","TurnkeyIframeClient","TurnkeyWalletClient","WalletStamper","VERSION","TurnkeyRequestError","TurnkeyBrowserClient","getStorageValue","StorageKeys","removeStorageValue","SessionType"],"mappings":";;;;;;;;;;;MAiEa,iBAAiB,CAAA;AAK5B,IAAA,WAAA,CAAY,MAA+B,EAAA;AAI3C;;;;AAIG;AACH,QAAA,IAAA,CAAA,aAAa,GAAG,CAAC,MAA4B,KAA0B;AACrE,Y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