@descope/web-js-sdk 0.0.0-alpha.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.
@@ -0,0 +1,3847 @@
1
+ import * as oidc_client_ts from 'oidc-client-ts';
2
+ import * as _descope_core_js_sdk from '@descope/core-js-sdk';
3
+ export { UserResponse } from '@descope/core-js-sdk';
4
+
5
+ type OidcConfigOptions = {
6
+ applicationId?: string;
7
+ redirectUri?: string;
8
+ scope?: string;
9
+ };
10
+ type OidcConfig = boolean | OidcConfigOptions;
11
+
12
+ /**
13
+ * Configuration for OneTap.
14
+ */
15
+ interface OneTapConfig {
16
+ /** Whether to auto select. Optional. */
17
+ auto_select?: boolean;
18
+ /** Whether to cancel on tap outside. Optional. */
19
+ cancel_on_tap_outside?: boolean;
20
+ /** ID of the prompt parent. Optional. */
21
+ prompt_parent_id?: string;
22
+ /** Context. Optional. */
23
+ context?: 'signin' | 'signup' | 'use';
24
+ /** Callback function to handle the intermediate iframe close event. Optional. */
25
+ intermediate_iframe_close_callback?: () => void;
26
+ /** Whether to support ITP. Optional. */
27
+ itp_support?: boolean;
28
+ /** Login hint. Optional. */
29
+ login_hint?: string;
30
+ /** HD. Optional. */
31
+ hd?: string;
32
+ /** Whether to use FedCM for prompt. Optional. */
33
+ use_fedcm_for_prompt?: boolean;
34
+ }
35
+
36
+ declare function isSupported(requirePlatformAuthenticator?: boolean): Promise<boolean>;
37
+
38
+ type LastLoggedInUserOptions = {
39
+ storeLastAuthenticatedUser?: boolean;
40
+ keepLastAuthenticatedUserAfterLogout?: boolean;
41
+ };
42
+
43
+ type AutoRefreshOptions = {
44
+ autoRefresh?: boolean;
45
+ };
46
+
47
+ type FingerprintOptions = {
48
+ fpKey?: string;
49
+ fpLoad?: boolean;
50
+ };
51
+
52
+ type SameSite = 'Strict' | 'Lax' | 'None';
53
+ type CookieConfig = boolean | {
54
+ sameSite?: SameSite;
55
+ secure?: boolean;
56
+ };
57
+ type PersistTokensOptions<A extends CookieConfig> = {
58
+ persistTokens?: A;
59
+ storagePrefix?: string;
60
+ preview?: boolean;
61
+ sessionTokenViaCookie?: A extends false ? never : true | CookieConfig;
62
+ };
63
+
64
+ /** Default name for the session cookie name / local storage key */
65
+ declare const SESSION_TOKEN_KEY = "DS";
66
+ /** Default name for the refresh local storage key */
67
+ declare const REFRESH_TOKEN_KEY = "DSR";
68
+
69
+ /**
70
+ * Ensure fingerprint ids (request id, session id) exist.
71
+ * If not, It will generate and load them into to browser storage.
72
+ * NOTE: Using fingerprintJS data has cost, use considerably.
73
+ * @param fpKey FingerprintJS API key
74
+ */
75
+ declare const ensureFingerprintIds: (fpKey: string, baseUrl?: string) => Promise<void>;
76
+ /** Clear Fingerprint data from storage */
77
+ declare const clearFingerprintData: () => void;
78
+
79
+ declare const hasOidcParamsInUrl: () => boolean;
80
+
81
+ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPersistTokens, sessionTokenViaCookie, storagePrefix, ...config }: Omit<{
82
+ projectId: string;
83
+ logger?: {
84
+ error: {
85
+ (...data: any[]): void;
86
+ (message?: any, ...optionalParams: any[]): void;
87
+ };
88
+ debug: {
89
+ (...data: any[]): void;
90
+ (message?: any, ...optionalParams: any[]): void;
91
+ };
92
+ log: {
93
+ (...data: any[]): void;
94
+ (message?: any, ...optionalParams: any[]): void;
95
+ };
96
+ warn: {
97
+ (...data: any[]): void;
98
+ (message?: any, ...optionalParams: any[]): void;
99
+ };
100
+ };
101
+ baseUrl?: string;
102
+ hooks?: {
103
+ beforeRequest?: (config: _descope_core_js_sdk.RequestConfig) => _descope_core_js_sdk.RequestConfig;
104
+ afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
105
+ transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
106
+ };
107
+ cookiePolicy?: RequestCredentials;
108
+ baseHeaders?: HeadersInit;
109
+ refreshCookieName?: string;
110
+ fetch?: typeof fetch;
111
+ }, "hooks"> & {
112
+ hooks?: {
113
+ beforeRequest?: ((config: _descope_core_js_sdk.RequestConfig) => _descope_core_js_sdk.RequestConfig) | ((config: _descope_core_js_sdk.RequestConfig) => _descope_core_js_sdk.RequestConfig)[];
114
+ afterRequest?: ((req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>) | ((req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>)[];
115
+ transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
116
+ };
117
+ } & {
118
+ oidcConfig?: OidcConfig;
119
+ } & FingerprintOptions & AutoRefreshOptions & LastLoggedInUserOptions & PersistTokensOptions<A>) => A extends false ? (({
120
+ refresh: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
121
+ logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
122
+ flow: {
123
+ start: (flowId: string, options?: Pick<{
124
+ redirectUrl?: string;
125
+ location?: string;
126
+ tenant?: string;
127
+ deviceInfo?: {
128
+ webAuthnSupport?: boolean;
129
+ };
130
+ lastAuth?: {
131
+ authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
132
+ oauthProvider?: string;
133
+ name?: string;
134
+ loginId?: string;
135
+ };
136
+ redirectAuth?: {
137
+ callbackUrl: string;
138
+ codeChallenge: string;
139
+ };
140
+ oidcIdpStateId?: string;
141
+ preview?: boolean;
142
+ samlIdpStateId?: string;
143
+ samlIdpUsername?: string;
144
+ ssoAppId?: string;
145
+ thirdPartyAppId?: string;
146
+ oidcLoginHint?: string;
147
+ abTestingKey?: number;
148
+ startOptionsVersion?: number;
149
+ client?: Record<string, any>;
150
+ locale?: string;
151
+ oidcPrompt?: string;
152
+ oidcErrorRedirectUri?: string;
153
+ nativeOptions?: {
154
+ platform: "ios" | "android";
155
+ oauthProvider?: string;
156
+ oauthRedirect?: string;
157
+ };
158
+ thirdPartyAppStateId?: string;
159
+ applicationScopes?: string;
160
+ }, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes"> & {
161
+ lastAuth?: Omit<{
162
+ authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
163
+ oauthProvider?: string;
164
+ name?: string;
165
+ loginId?: string;
166
+ }, "loginId" | "name">;
167
+ }, conditionInteractionId?: string, interactionId?: string, componentsVersion?: string, flowVersions?: Record<string, number>, input?: {
168
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any)[])[])[])[])[])[])[])[])[])[])[];
169
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
170
+ next: (executionId: string, stepId: string, interactionId: string, version?: number, componentsVersion?: string, input?: {
171
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any)[])[])[])[])[])[])[])[])[])[])[];
172
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
173
+ };
174
+ webauthn: {
175
+ signUp: ((identifier: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
176
+ start: (loginId: string, origin: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
177
+ transactionId: string;
178
+ options: string;
179
+ create: boolean;
180
+ }>>;
181
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
182
+ };
183
+ signIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
184
+ start: (loginId: string, origin: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
185
+ transactionId: string;
186
+ options: string;
187
+ create: boolean;
188
+ }>>;
189
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
190
+ };
191
+ signUpOrIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
192
+ start: (loginId: string, origin: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
193
+ transactionId: string;
194
+ options: string;
195
+ create: boolean;
196
+ }>>;
197
+ };
198
+ update: ((identifier: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
199
+ start: (loginId: string, origin: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
200
+ transactionId: string;
201
+ options: string;
202
+ create: boolean;
203
+ }>>;
204
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
205
+ };
206
+ helpers: {
207
+ create: (options: string) => Promise<string>;
208
+ get: (options: string) => Promise<string>;
209
+ isSupported: typeof isSupported;
210
+ conditional: (options: string, abort: AbortController) => Promise<string>;
211
+ };
212
+ };
213
+ fedcm: {
214
+ oneTap(provider?: string, oneTapConfig?: OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: (reason?: string) => void, onDismissed?: (reason?: string) => void): Promise<unknown>;
215
+ launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
216
+ isSupported(): boolean;
217
+ isLoggedIn(context?: "signin" | "signup" | "use" | "continue"): Promise<boolean>;
218
+ };
219
+ oidc: {
220
+ login: (arg?: oidc_client_ts.CreateSigninRequestArgs, disableNavigation?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
221
+ finishLogin: (url?: string) => Promise<any>;
222
+ finishLoginIfNeed: (url?: string) => Promise<any>;
223
+ refreshToken: (refreshToken: string) => Promise<oidc_client_ts.SigninResponse>;
224
+ logout: (arg?: oidc_client_ts.CreateSignoutRequestArgs, disableNavigation?: boolean) => Promise<any>;
225
+ };
226
+ accessKey: {
227
+ exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
228
+ };
229
+ otp: {
230
+ verify: {
231
+ sms: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
232
+ voice: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
233
+ whatsapp: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
234
+ email: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
235
+ };
236
+ signIn: {
237
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
238
+ maskedPhone: string;
239
+ }>>;
240
+ voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
241
+ maskedPhone: string;
242
+ }>>;
243
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
244
+ maskedPhone: string;
245
+ }>>;
246
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
247
+ maskedEmail: string;
248
+ }>>;
249
+ };
250
+ signUp: {
251
+ sms: (loginId: string, user?: {
252
+ email?: string;
253
+ name?: string;
254
+ givenName?: string;
255
+ middleName?: string;
256
+ familyName?: string;
257
+ phone?: string;
258
+ }, signUpOptions?: {
259
+ customClaims?: Record<string, any>;
260
+ templateId?: string;
261
+ templateOptions?: {
262
+ [x: string]: string;
263
+ };
264
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
265
+ maskedPhone: string;
266
+ }>>;
267
+ voice: (loginId: string, user?: {
268
+ email?: string;
269
+ name?: string;
270
+ givenName?: string;
271
+ middleName?: string;
272
+ familyName?: string;
273
+ phone?: string;
274
+ }, signUpOptions?: {
275
+ customClaims?: Record<string, any>;
276
+ templateId?: string;
277
+ templateOptions?: {
278
+ [x: string]: string;
279
+ };
280
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
281
+ maskedPhone: string;
282
+ }>>;
283
+ whatsapp: (loginId: string, user?: {
284
+ email?: string;
285
+ name?: string;
286
+ givenName?: string;
287
+ middleName?: string;
288
+ familyName?: string;
289
+ phone?: string;
290
+ }, signUpOptions?: {
291
+ customClaims?: Record<string, any>;
292
+ templateId?: string;
293
+ templateOptions?: {
294
+ [x: string]: string;
295
+ };
296
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
297
+ maskedPhone: string;
298
+ }>>;
299
+ email: (loginId: string, user?: {
300
+ email?: string;
301
+ name?: string;
302
+ givenName?: string;
303
+ middleName?: string;
304
+ familyName?: string;
305
+ phone?: string;
306
+ }, signUpOptions?: {
307
+ customClaims?: Record<string, any>;
308
+ templateId?: string;
309
+ templateOptions?: {
310
+ [x: string]: string;
311
+ };
312
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
313
+ maskedEmail: string;
314
+ }>>;
315
+ };
316
+ signUpOrIn: {
317
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
318
+ maskedPhone: string;
319
+ }>>;
320
+ voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
321
+ maskedPhone: string;
322
+ }>>;
323
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
324
+ maskedPhone: string;
325
+ }>>;
326
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
327
+ maskedEmail: string;
328
+ }>>;
329
+ };
330
+ update: {
331
+ email: <T extends boolean>(loginId: string, email: string, token?: string, updateOptions?: {
332
+ addToLoginIDs?: T;
333
+ onMergeUseExisting?: T extends true ? boolean : never;
334
+ templateOptions?: {
335
+ [x: string]: string;
336
+ };
337
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
338
+ maskedEmail: string;
339
+ }>>;
340
+ phone: {
341
+ sms: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
342
+ addToLoginIDs?: T_1;
343
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
344
+ templateOptions?: {
345
+ [x: string]: string;
346
+ };
347
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
348
+ maskedPhone: string;
349
+ }>>;
350
+ voice: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
351
+ addToLoginIDs?: T_1;
352
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
353
+ templateOptions?: {
354
+ [x: string]: string;
355
+ };
356
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
357
+ maskedPhone: string;
358
+ }>>;
359
+ whatsapp: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
360
+ addToLoginIDs?: T_1;
361
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
362
+ templateOptions?: {
363
+ [x: string]: string;
364
+ };
365
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
366
+ maskedPhone: string;
367
+ }>>;
368
+ };
369
+ };
370
+ };
371
+ magicLink: {
372
+ verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
373
+ signIn: {
374
+ sms: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
375
+ maskedPhone: string;
376
+ }>>;
377
+ voice: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
378
+ maskedPhone: string;
379
+ }>>;
380
+ whatsapp: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
381
+ maskedPhone: string;
382
+ }>>;
383
+ email: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
384
+ maskedEmail: string;
385
+ }>>;
386
+ };
387
+ signUp: {
388
+ sms: (loginId: string, URI: string, user?: {
389
+ email?: string;
390
+ name?: string;
391
+ givenName?: string;
392
+ middleName?: string;
393
+ familyName?: string;
394
+ phone?: string;
395
+ }, signUpOptions?: {
396
+ customClaims?: Record<string, any>;
397
+ templateId?: string;
398
+ templateOptions?: {
399
+ [x: string]: string;
400
+ };
401
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
402
+ maskedPhone: string;
403
+ }>>;
404
+ voice: (loginId: string, URI: string, user?: {
405
+ email?: string;
406
+ name?: string;
407
+ givenName?: string;
408
+ middleName?: string;
409
+ familyName?: string;
410
+ phone?: string;
411
+ }, signUpOptions?: {
412
+ customClaims?: Record<string, any>;
413
+ templateId?: string;
414
+ templateOptions?: {
415
+ [x: string]: string;
416
+ };
417
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
418
+ maskedPhone: string;
419
+ }>>;
420
+ whatsapp: (loginId: string, URI: string, user?: {
421
+ email?: string;
422
+ name?: string;
423
+ givenName?: string;
424
+ middleName?: string;
425
+ familyName?: string;
426
+ phone?: string;
427
+ }, signUpOptions?: {
428
+ customClaims?: Record<string, any>;
429
+ templateId?: string;
430
+ templateOptions?: {
431
+ [x: string]: string;
432
+ };
433
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
434
+ maskedPhone: string;
435
+ }>>;
436
+ email: (loginId: string, URI: string, user?: {
437
+ email?: string;
438
+ name?: string;
439
+ givenName?: string;
440
+ middleName?: string;
441
+ familyName?: string;
442
+ phone?: string;
443
+ }, signUpOptions?: {
444
+ customClaims?: Record<string, any>;
445
+ templateId?: string;
446
+ templateOptions?: {
447
+ [x: string]: string;
448
+ };
449
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
450
+ maskedEmail: string;
451
+ }>>;
452
+ };
453
+ signUpOrIn: {
454
+ sms: (loginId: string, URI?: string, signUpOptions?: {
455
+ customClaims?: Record<string, any>;
456
+ templateId?: string;
457
+ templateOptions?: {
458
+ [x: string]: string;
459
+ };
460
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
461
+ maskedPhone: string;
462
+ }>>;
463
+ voice: (loginId: string, URI?: string, signUpOptions?: {
464
+ customClaims?: Record<string, any>;
465
+ templateId?: string;
466
+ templateOptions?: {
467
+ [x: string]: string;
468
+ };
469
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
470
+ maskedPhone: string;
471
+ }>>;
472
+ whatsapp: (loginId: string, URI?: string, signUpOptions?: {
473
+ customClaims?: Record<string, any>;
474
+ templateId?: string;
475
+ templateOptions?: {
476
+ [x: string]: string;
477
+ };
478
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
479
+ maskedPhone: string;
480
+ }>>;
481
+ email: (loginId: string, URI?: string, signUpOptions?: {
482
+ customClaims?: Record<string, any>;
483
+ templateId?: string;
484
+ templateOptions?: {
485
+ [x: string]: string;
486
+ };
487
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
488
+ maskedEmail: string;
489
+ }>>;
490
+ };
491
+ update: {
492
+ email: <T_2 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
493
+ addToLoginIDs?: T_2;
494
+ onMergeUseExisting?: T_2 extends true ? boolean : never;
495
+ templateOptions?: {
496
+ [x: string]: string;
497
+ };
498
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
499
+ maskedEmail: string;
500
+ }>>;
501
+ phone: {
502
+ sms: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
503
+ addToLoginIDs?: T_3;
504
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
505
+ templateOptions?: {
506
+ [x: string]: string;
507
+ };
508
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
509
+ maskedPhone: string;
510
+ }>>;
511
+ voice: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
512
+ addToLoginIDs?: T_3;
513
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
514
+ templateOptions?: {
515
+ [x: string]: string;
516
+ };
517
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
518
+ maskedPhone: string;
519
+ }>>;
520
+ whatsapp: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
521
+ addToLoginIDs?: T_3;
522
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
523
+ templateOptions?: {
524
+ [x: string]: string;
525
+ };
526
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
527
+ maskedPhone: string;
528
+ }>>;
529
+ };
530
+ };
531
+ };
532
+ enchantedLink: {
533
+ verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
534
+ signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
535
+ signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
536
+ customClaims?: Record<string, any>;
537
+ templateId?: string;
538
+ templateOptions?: {
539
+ [x: string]: string;
540
+ };
541
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
542
+ signUp: (loginId: string, URI?: string, user?: {
543
+ email?: string;
544
+ name?: string;
545
+ givenName?: string;
546
+ middleName?: string;
547
+ familyName?: string;
548
+ phone?: string;
549
+ }, signUpOptions?: {
550
+ customClaims?: Record<string, any>;
551
+ templateId?: string;
552
+ templateOptions?: {
553
+ [x: string]: string;
554
+ };
555
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
556
+ waitForSession: (pendingRef: string, config?: {
557
+ pollingIntervalMs: number;
558
+ timeoutMs: number;
559
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
560
+ update: {
561
+ email: <T_4 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
562
+ addToLoginIDs?: T_4;
563
+ onMergeUseExisting?: T_4 extends true ? boolean : never;
564
+ templateOptions?: {
565
+ [x: string]: string;
566
+ };
567
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
568
+ };
569
+ };
570
+ oauth: {
571
+ start: ((provider: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
572
+ google: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
573
+ facebook: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
574
+ github: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
575
+ microsoft: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
576
+ gitlab: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
577
+ apple: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
578
+ discord: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
579
+ linkedin: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
580
+ slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
581
+ };
582
+ exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
583
+ startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
584
+ finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
585
+ };
586
+ saml: {
587
+ start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, ssoId?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
588
+ exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
589
+ };
590
+ totp: {
591
+ signUp: (loginId: string, user?: {
592
+ email?: string;
593
+ name?: string;
594
+ givenName?: string;
595
+ middleName?: string;
596
+ familyName?: string;
597
+ phone?: string;
598
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
599
+ verify: (loginId: string, code: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
600
+ update: (loginId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
601
+ };
602
+ notp: {
603
+ signUpOrIn: (loginId?: string, signUpOptions?: {
604
+ customClaims?: Record<string, any>;
605
+ templateId?: string;
606
+ templateOptions?: {
607
+ [x: string]: string;
608
+ };
609
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
610
+ pendingRef: string;
611
+ redirectUrl: string;
612
+ image: string;
613
+ }>>;
614
+ signUp: (loginId?: string, user?: {
615
+ email?: string;
616
+ name?: string;
617
+ givenName?: string;
618
+ middleName?: string;
619
+ familyName?: string;
620
+ phone?: string;
621
+ }, signUpOptions?: {
622
+ customClaims?: Record<string, any>;
623
+ templateId?: string;
624
+ templateOptions?: {
625
+ [x: string]: string;
626
+ };
627
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
628
+ pendingRef: string;
629
+ redirectUrl: string;
630
+ image: string;
631
+ }>>;
632
+ signIn: (loginId?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
633
+ pendingRef: string;
634
+ redirectUrl: string;
635
+ image: string;
636
+ }>>;
637
+ waitForSession: (pendingRef: string, config?: {
638
+ pollingIntervalMs: number;
639
+ timeoutMs: number;
640
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
641
+ };
642
+ password: {
643
+ signUp: (loginId: string, password: string, user?: {
644
+ email?: string;
645
+ name?: string;
646
+ givenName?: string;
647
+ middleName?: string;
648
+ familyName?: string;
649
+ phone?: string;
650
+ }, signUpOptions?: {
651
+ customClaims?: Record<string, any>;
652
+ templateId?: string;
653
+ templateOptions?: {
654
+ [x: string]: string;
655
+ };
656
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
657
+ signIn: (loginId: string, password: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
658
+ sendReset: (loginId: string, redirectUrl?: string, templateOptions?: {
659
+ [x: string]: string;
660
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
661
+ resetMethod: string;
662
+ pendingRef?: string;
663
+ linkId?: string;
664
+ maskedEmail: string;
665
+ }>>;
666
+ update: (loginId: string, newPassword: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
667
+ replace: (loginId: string, oldPassword: string, newPassword: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
668
+ policy: () => Promise<_descope_core_js_sdk.SdkResponse<{
669
+ minLength: number;
670
+ lowercase: boolean;
671
+ uppercase: boolean;
672
+ number: boolean;
673
+ nonAlphanumeric: boolean;
674
+ }>>;
675
+ };
676
+ selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
677
+ logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
678
+ me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
679
+ myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
680
+ tenants: {
681
+ id: string;
682
+ name: string;
683
+ customAttributes?: Record<string, any>;
684
+ }[];
685
+ }>>;
686
+ history: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserHistoryResponse>>;
687
+ isJwtExpired: (token: string) => boolean;
688
+ getTenants: (token: string) => string[];
689
+ getJwtPermissions: (token: string, tenant?: string) => string[];
690
+ getJwtRoles: (token: string, tenant?: string) => string[];
691
+ getCurrentTenant: (token: string) => string;
692
+ httpClient: {
693
+ get: (path: string, config?: {
694
+ headers?: HeadersInit;
695
+ queryParams?: {
696
+ [key: string]: string;
697
+ };
698
+ token?: string;
699
+ }) => Promise<Response>;
700
+ post: (path: string, body?: any, config?: {
701
+ headers?: HeadersInit;
702
+ queryParams?: {
703
+ [key: string]: string;
704
+ };
705
+ token?: string;
706
+ }) => Promise<Response>;
707
+ patch: (path: string, body?: any, config?: {
708
+ headers?: HeadersInit;
709
+ queryParams?: {
710
+ [key: string]: string;
711
+ };
712
+ token?: string;
713
+ }) => Promise<Response>;
714
+ put: (path: string, body?: any, config?: {
715
+ headers?: HeadersInit;
716
+ queryParams?: {
717
+ [key: string]: string;
718
+ };
719
+ token?: string;
720
+ }) => Promise<Response>;
721
+ delete: (path: string, config?: {
722
+ headers?: HeadersInit;
723
+ queryParams?: {
724
+ [key: string]: string;
725
+ };
726
+ token?: string;
727
+ }) => Promise<Response>;
728
+ hooks?: {
729
+ beforeRequest?: (config: _descope_core_js_sdk.RequestConfig) => _descope_core_js_sdk.RequestConfig;
730
+ afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
731
+ transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
732
+ };
733
+ buildUrl: (path: string, queryParams?: {
734
+ [key: string]: string;
735
+ }) => string;
736
+ };
737
+ } | {
738
+ refresh: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
739
+ logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
740
+ flow: {
741
+ start: (flowId: string, options?: Pick<{
742
+ redirectUrl?: string;
743
+ location?: string;
744
+ tenant?: string;
745
+ deviceInfo?: {
746
+ webAuthnSupport?: boolean;
747
+ };
748
+ lastAuth?: {
749
+ authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
750
+ oauthProvider?: string;
751
+ name?: string;
752
+ loginId?: string;
753
+ };
754
+ redirectAuth?: {
755
+ callbackUrl: string;
756
+ codeChallenge: string;
757
+ };
758
+ oidcIdpStateId?: string;
759
+ preview?: boolean;
760
+ samlIdpStateId?: string;
761
+ samlIdpUsername?: string;
762
+ ssoAppId?: string;
763
+ thirdPartyAppId?: string;
764
+ oidcLoginHint?: string;
765
+ abTestingKey?: number;
766
+ startOptionsVersion?: number;
767
+ client?: Record<string, any>;
768
+ locale?: string;
769
+ oidcPrompt?: string;
770
+ oidcErrorRedirectUri?: string;
771
+ nativeOptions?: {
772
+ platform: "ios" | "android";
773
+ oauthProvider?: string;
774
+ oauthRedirect?: string;
775
+ };
776
+ thirdPartyAppStateId?: string;
777
+ applicationScopes?: string;
778
+ }, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes"> & {
779
+ lastAuth?: Omit<{
780
+ authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
781
+ oauthProvider?: string;
782
+ name?: string;
783
+ loginId?: string;
784
+ }, "loginId" | "name">;
785
+ }, conditionInteractionId?: string, interactionId?: string, componentsVersion?: string, flowVersions?: Record<string, number>, input?: {
786
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any)[])[])[])[])[])[])[])[])[])[])[];
787
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
788
+ next: (executionId: string, stepId: string, interactionId: string, version?: number, componentsVersion?: string, input?: {
789
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any)[])[])[])[])[])[])[])[])[])[])[];
790
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
791
+ };
792
+ webauthn: {
793
+ signUp: ((identifier: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
794
+ start: (loginId: string, origin: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
795
+ transactionId: string;
796
+ options: string;
797
+ create: boolean;
798
+ }>>;
799
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
800
+ };
801
+ signIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
802
+ start: (loginId: string, origin: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
803
+ transactionId: string;
804
+ options: string;
805
+ create: boolean;
806
+ }>>;
807
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
808
+ };
809
+ signUpOrIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
810
+ start: (loginId: string, origin: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
811
+ transactionId: string;
812
+ options: string;
813
+ create: boolean;
814
+ }>>;
815
+ };
816
+ update: ((identifier: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
817
+ start: (loginId: string, origin: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
818
+ transactionId: string;
819
+ options: string;
820
+ create: boolean;
821
+ }>>;
822
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
823
+ };
824
+ helpers: {
825
+ create: (options: string) => Promise<string>;
826
+ get: (options: string) => Promise<string>;
827
+ isSupported: typeof isSupported;
828
+ conditional: (options: string, abort: AbortController) => Promise<string>;
829
+ };
830
+ };
831
+ fedcm: {
832
+ oneTap(provider?: string, oneTapConfig?: OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: (reason?: string) => void, onDismissed?: (reason?: string) => void): Promise<unknown>;
833
+ launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
834
+ isSupported(): boolean;
835
+ isLoggedIn(context?: "signin" | "signup" | "use" | "continue"): Promise<boolean>;
836
+ };
837
+ oidc: {
838
+ login: (arg?: oidc_client_ts.CreateSigninRequestArgs, disableNavigation?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
839
+ finishLogin: (url?: string) => Promise<any>;
840
+ finishLoginIfNeed: (url?: string) => Promise<any>;
841
+ refreshToken: (refreshToken: string) => Promise<oidc_client_ts.SigninResponse>;
842
+ logout: (arg?: oidc_client_ts.CreateSignoutRequestArgs, disableNavigation?: boolean) => Promise<any>;
843
+ };
844
+ accessKey: {
845
+ exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
846
+ };
847
+ otp: {
848
+ verify: {
849
+ sms: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
850
+ voice: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
851
+ whatsapp: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
852
+ email: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
853
+ };
854
+ signIn: {
855
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
856
+ maskedPhone: string;
857
+ }>>;
858
+ voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
859
+ maskedPhone: string;
860
+ }>>;
861
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
862
+ maskedPhone: string;
863
+ }>>;
864
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
865
+ maskedEmail: string;
866
+ }>>;
867
+ };
868
+ signUp: {
869
+ sms: (loginId: string, user?: {
870
+ email?: string;
871
+ name?: string;
872
+ givenName?: string;
873
+ middleName?: string;
874
+ familyName?: string;
875
+ phone?: string;
876
+ }, signUpOptions?: {
877
+ customClaims?: Record<string, any>;
878
+ templateId?: string;
879
+ templateOptions?: {
880
+ [x: string]: string;
881
+ };
882
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
883
+ maskedPhone: string;
884
+ }>>;
885
+ voice: (loginId: string, user?: {
886
+ email?: string;
887
+ name?: string;
888
+ givenName?: string;
889
+ middleName?: string;
890
+ familyName?: string;
891
+ phone?: string;
892
+ }, signUpOptions?: {
893
+ customClaims?: Record<string, any>;
894
+ templateId?: string;
895
+ templateOptions?: {
896
+ [x: string]: string;
897
+ };
898
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
899
+ maskedPhone: string;
900
+ }>>;
901
+ whatsapp: (loginId: string, user?: {
902
+ email?: string;
903
+ name?: string;
904
+ givenName?: string;
905
+ middleName?: string;
906
+ familyName?: string;
907
+ phone?: string;
908
+ }, signUpOptions?: {
909
+ customClaims?: Record<string, any>;
910
+ templateId?: string;
911
+ templateOptions?: {
912
+ [x: string]: string;
913
+ };
914
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
915
+ maskedPhone: string;
916
+ }>>;
917
+ email: (loginId: string, user?: {
918
+ email?: string;
919
+ name?: string;
920
+ givenName?: string;
921
+ middleName?: string;
922
+ familyName?: string;
923
+ phone?: string;
924
+ }, signUpOptions?: {
925
+ customClaims?: Record<string, any>;
926
+ templateId?: string;
927
+ templateOptions?: {
928
+ [x: string]: string;
929
+ };
930
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
931
+ maskedEmail: string;
932
+ }>>;
933
+ };
934
+ signUpOrIn: {
935
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
936
+ maskedPhone: string;
937
+ }>>;
938
+ voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
939
+ maskedPhone: string;
940
+ }>>;
941
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
942
+ maskedPhone: string;
943
+ }>>;
944
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
945
+ maskedEmail: string;
946
+ }>>;
947
+ };
948
+ update: {
949
+ email: <T extends boolean>(loginId: string, email: string, token?: string, updateOptions?: {
950
+ addToLoginIDs?: T;
951
+ onMergeUseExisting?: T extends true ? boolean : never;
952
+ templateOptions?: {
953
+ [x: string]: string;
954
+ };
955
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
956
+ maskedEmail: string;
957
+ }>>;
958
+ phone: {
959
+ sms: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
960
+ addToLoginIDs?: T_1;
961
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
962
+ templateOptions?: {
963
+ [x: string]: string;
964
+ };
965
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
966
+ maskedPhone: string;
967
+ }>>;
968
+ voice: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
969
+ addToLoginIDs?: T_1;
970
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
971
+ templateOptions?: {
972
+ [x: string]: string;
973
+ };
974
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
975
+ maskedPhone: string;
976
+ }>>;
977
+ whatsapp: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
978
+ addToLoginIDs?: T_1;
979
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
980
+ templateOptions?: {
981
+ [x: string]: string;
982
+ };
983
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
984
+ maskedPhone: string;
985
+ }>>;
986
+ };
987
+ };
988
+ };
989
+ magicLink: {
990
+ verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
991
+ signIn: {
992
+ sms: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
993
+ maskedPhone: string;
994
+ }>>;
995
+ voice: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
996
+ maskedPhone: string;
997
+ }>>;
998
+ whatsapp: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
999
+ maskedPhone: string;
1000
+ }>>;
1001
+ email: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1002
+ maskedEmail: string;
1003
+ }>>;
1004
+ };
1005
+ signUp: {
1006
+ sms: (loginId: string, URI: string, user?: {
1007
+ email?: string;
1008
+ name?: string;
1009
+ givenName?: string;
1010
+ middleName?: string;
1011
+ familyName?: string;
1012
+ phone?: string;
1013
+ }, signUpOptions?: {
1014
+ customClaims?: Record<string, any>;
1015
+ templateId?: string;
1016
+ templateOptions?: {
1017
+ [x: string]: string;
1018
+ };
1019
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1020
+ maskedPhone: string;
1021
+ }>>;
1022
+ voice: (loginId: string, URI: string, user?: {
1023
+ email?: string;
1024
+ name?: string;
1025
+ givenName?: string;
1026
+ middleName?: string;
1027
+ familyName?: string;
1028
+ phone?: string;
1029
+ }, signUpOptions?: {
1030
+ customClaims?: Record<string, any>;
1031
+ templateId?: string;
1032
+ templateOptions?: {
1033
+ [x: string]: string;
1034
+ };
1035
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1036
+ maskedPhone: string;
1037
+ }>>;
1038
+ whatsapp: (loginId: string, URI: string, user?: {
1039
+ email?: string;
1040
+ name?: string;
1041
+ givenName?: string;
1042
+ middleName?: string;
1043
+ familyName?: string;
1044
+ phone?: string;
1045
+ }, signUpOptions?: {
1046
+ customClaims?: Record<string, any>;
1047
+ templateId?: string;
1048
+ templateOptions?: {
1049
+ [x: string]: string;
1050
+ };
1051
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1052
+ maskedPhone: string;
1053
+ }>>;
1054
+ email: (loginId: string, URI: string, user?: {
1055
+ email?: string;
1056
+ name?: string;
1057
+ givenName?: string;
1058
+ middleName?: string;
1059
+ familyName?: string;
1060
+ phone?: string;
1061
+ }, signUpOptions?: {
1062
+ customClaims?: Record<string, any>;
1063
+ templateId?: string;
1064
+ templateOptions?: {
1065
+ [x: string]: string;
1066
+ };
1067
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1068
+ maskedEmail: string;
1069
+ }>>;
1070
+ };
1071
+ signUpOrIn: {
1072
+ sms: (loginId: string, URI?: string, signUpOptions?: {
1073
+ customClaims?: Record<string, any>;
1074
+ templateId?: string;
1075
+ templateOptions?: {
1076
+ [x: string]: string;
1077
+ };
1078
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1079
+ maskedPhone: string;
1080
+ }>>;
1081
+ voice: (loginId: string, URI?: string, signUpOptions?: {
1082
+ customClaims?: Record<string, any>;
1083
+ templateId?: string;
1084
+ templateOptions?: {
1085
+ [x: string]: string;
1086
+ };
1087
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1088
+ maskedPhone: string;
1089
+ }>>;
1090
+ whatsapp: (loginId: string, URI?: string, signUpOptions?: {
1091
+ customClaims?: Record<string, any>;
1092
+ templateId?: string;
1093
+ templateOptions?: {
1094
+ [x: string]: string;
1095
+ };
1096
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1097
+ maskedPhone: string;
1098
+ }>>;
1099
+ email: (loginId: string, URI?: string, signUpOptions?: {
1100
+ customClaims?: Record<string, any>;
1101
+ templateId?: string;
1102
+ templateOptions?: {
1103
+ [x: string]: string;
1104
+ };
1105
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1106
+ maskedEmail: string;
1107
+ }>>;
1108
+ };
1109
+ update: {
1110
+ email: <T_2 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
1111
+ addToLoginIDs?: T_2;
1112
+ onMergeUseExisting?: T_2 extends true ? boolean : never;
1113
+ templateOptions?: {
1114
+ [x: string]: string;
1115
+ };
1116
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1117
+ maskedEmail: string;
1118
+ }>>;
1119
+ phone: {
1120
+ sms: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
1121
+ addToLoginIDs?: T_3;
1122
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
1123
+ templateOptions?: {
1124
+ [x: string]: string;
1125
+ };
1126
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1127
+ maskedPhone: string;
1128
+ }>>;
1129
+ voice: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
1130
+ addToLoginIDs?: T_3;
1131
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
1132
+ templateOptions?: {
1133
+ [x: string]: string;
1134
+ };
1135
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1136
+ maskedPhone: string;
1137
+ }>>;
1138
+ whatsapp: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
1139
+ addToLoginIDs?: T_3;
1140
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
1141
+ templateOptions?: {
1142
+ [x: string]: string;
1143
+ };
1144
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1145
+ maskedPhone: string;
1146
+ }>>;
1147
+ };
1148
+ };
1149
+ };
1150
+ enchantedLink: {
1151
+ verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1152
+ signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1153
+ signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
1154
+ customClaims?: Record<string, any>;
1155
+ templateId?: string;
1156
+ templateOptions?: {
1157
+ [x: string]: string;
1158
+ };
1159
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1160
+ signUp: (loginId: string, URI?: string, user?: {
1161
+ email?: string;
1162
+ name?: string;
1163
+ givenName?: string;
1164
+ middleName?: string;
1165
+ familyName?: string;
1166
+ phone?: string;
1167
+ }, signUpOptions?: {
1168
+ customClaims?: Record<string, any>;
1169
+ templateId?: string;
1170
+ templateOptions?: {
1171
+ [x: string]: string;
1172
+ };
1173
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1174
+ waitForSession: (pendingRef: string, config?: {
1175
+ pollingIntervalMs: number;
1176
+ timeoutMs: number;
1177
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1178
+ update: {
1179
+ email: <T_4 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
1180
+ addToLoginIDs?: T_4;
1181
+ onMergeUseExisting?: T_4 extends true ? boolean : never;
1182
+ templateOptions?: {
1183
+ [x: string]: string;
1184
+ };
1185
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1186
+ };
1187
+ };
1188
+ oauth: {
1189
+ start: ((provider: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
1190
+ google: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1191
+ facebook: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1192
+ github: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1193
+ microsoft: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1194
+ gitlab: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1195
+ apple: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1196
+ discord: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1197
+ linkedin: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1198
+ slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1199
+ };
1200
+ exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1201
+ startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
1202
+ finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
1203
+ };
1204
+ saml: {
1205
+ start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, ssoId?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1206
+ exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1207
+ };
1208
+ totp: {
1209
+ signUp: (loginId: string, user?: {
1210
+ email?: string;
1211
+ name?: string;
1212
+ givenName?: string;
1213
+ middleName?: string;
1214
+ familyName?: string;
1215
+ phone?: string;
1216
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
1217
+ verify: (loginId: string, code: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1218
+ update: (loginId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
1219
+ };
1220
+ notp: {
1221
+ signUpOrIn: (loginId?: string, signUpOptions?: {
1222
+ customClaims?: Record<string, any>;
1223
+ templateId?: string;
1224
+ templateOptions?: {
1225
+ [x: string]: string;
1226
+ };
1227
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1228
+ pendingRef: string;
1229
+ redirectUrl: string;
1230
+ image: string;
1231
+ }>>;
1232
+ signUp: (loginId?: string, user?: {
1233
+ email?: string;
1234
+ name?: string;
1235
+ givenName?: string;
1236
+ middleName?: string;
1237
+ familyName?: string;
1238
+ phone?: string;
1239
+ }, signUpOptions?: {
1240
+ customClaims?: Record<string, any>;
1241
+ templateId?: string;
1242
+ templateOptions?: {
1243
+ [x: string]: string;
1244
+ };
1245
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1246
+ pendingRef: string;
1247
+ redirectUrl: string;
1248
+ image: string;
1249
+ }>>;
1250
+ signIn: (loginId?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1251
+ pendingRef: string;
1252
+ redirectUrl: string;
1253
+ image: string;
1254
+ }>>;
1255
+ waitForSession: (pendingRef: string, config?: {
1256
+ pollingIntervalMs: number;
1257
+ timeoutMs: number;
1258
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1259
+ };
1260
+ password: {
1261
+ signUp: (loginId: string, password: string, user?: {
1262
+ email?: string;
1263
+ name?: string;
1264
+ givenName?: string;
1265
+ middleName?: string;
1266
+ familyName?: string;
1267
+ phone?: string;
1268
+ }, signUpOptions?: {
1269
+ customClaims?: Record<string, any>;
1270
+ templateId?: string;
1271
+ templateOptions?: {
1272
+ [x: string]: string;
1273
+ };
1274
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1275
+ signIn: (loginId: string, password: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1276
+ sendReset: (loginId: string, redirectUrl?: string, templateOptions?: {
1277
+ [x: string]: string;
1278
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1279
+ resetMethod: string;
1280
+ pendingRef?: string;
1281
+ linkId?: string;
1282
+ maskedEmail: string;
1283
+ }>>;
1284
+ update: (loginId: string, newPassword: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1285
+ replace: (loginId: string, oldPassword: string, newPassword: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1286
+ policy: () => Promise<_descope_core_js_sdk.SdkResponse<{
1287
+ minLength: number;
1288
+ lowercase: boolean;
1289
+ uppercase: boolean;
1290
+ number: boolean;
1291
+ nonAlphanumeric: boolean;
1292
+ }>>;
1293
+ };
1294
+ selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1295
+ logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1296
+ me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
1297
+ myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1298
+ tenants: {
1299
+ id: string;
1300
+ name: string;
1301
+ customAttributes?: Record<string, any>;
1302
+ }[];
1303
+ }>>;
1304
+ history: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserHistoryResponse>>;
1305
+ isJwtExpired: (token: string) => boolean;
1306
+ getTenants: (token: string) => string[];
1307
+ getJwtPermissions: (token: string, tenant?: string) => string[];
1308
+ getJwtRoles: (token: string, tenant?: string) => string[];
1309
+ getCurrentTenant: (token: string) => string;
1310
+ httpClient: {
1311
+ get: (path: string, config?: {
1312
+ headers?: HeadersInit;
1313
+ queryParams?: {
1314
+ [key: string]: string;
1315
+ };
1316
+ token?: string;
1317
+ }) => Promise<Response>;
1318
+ post: (path: string, body?: any, config?: {
1319
+ headers?: HeadersInit;
1320
+ queryParams?: {
1321
+ [key: string]: string;
1322
+ };
1323
+ token?: string;
1324
+ }) => Promise<Response>;
1325
+ patch: (path: string, body?: any, config?: {
1326
+ headers?: HeadersInit;
1327
+ queryParams?: {
1328
+ [key: string]: string;
1329
+ };
1330
+ token?: string;
1331
+ }) => Promise<Response>;
1332
+ put: (path: string, body?: any, config?: {
1333
+ headers?: HeadersInit;
1334
+ queryParams?: {
1335
+ [key: string]: string;
1336
+ };
1337
+ token?: string;
1338
+ }) => Promise<Response>;
1339
+ delete: (path: string, config?: {
1340
+ headers?: HeadersInit;
1341
+ queryParams?: {
1342
+ [key: string]: string;
1343
+ };
1344
+ token?: string;
1345
+ }) => Promise<Response>;
1346
+ hooks?: {
1347
+ beforeRequest?: (config: _descope_core_js_sdk.RequestConfig) => _descope_core_js_sdk.RequestConfig;
1348
+ afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
1349
+ transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
1350
+ };
1351
+ buildUrl: (path: string, queryParams?: {
1352
+ [key: string]: string;
1353
+ }) => string;
1354
+ };
1355
+ } | {
1356
+ refresh: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1357
+ logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1358
+ flow: {
1359
+ start: (flowId: string, options?: Pick<{
1360
+ redirectUrl?: string;
1361
+ location?: string;
1362
+ tenant?: string;
1363
+ deviceInfo?: {
1364
+ webAuthnSupport?: boolean;
1365
+ };
1366
+ lastAuth?: {
1367
+ authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
1368
+ oauthProvider?: string;
1369
+ name?: string;
1370
+ loginId?: string;
1371
+ };
1372
+ redirectAuth?: {
1373
+ callbackUrl: string;
1374
+ codeChallenge: string;
1375
+ };
1376
+ oidcIdpStateId?: string;
1377
+ preview?: boolean;
1378
+ samlIdpStateId?: string;
1379
+ samlIdpUsername?: string;
1380
+ ssoAppId?: string;
1381
+ thirdPartyAppId?: string;
1382
+ oidcLoginHint?: string;
1383
+ abTestingKey?: number;
1384
+ startOptionsVersion?: number;
1385
+ client?: Record<string, any>;
1386
+ locale?: string;
1387
+ oidcPrompt?: string;
1388
+ oidcErrorRedirectUri?: string;
1389
+ nativeOptions?: {
1390
+ platform: "ios" | "android";
1391
+ oauthProvider?: string;
1392
+ oauthRedirect?: string;
1393
+ };
1394
+ thirdPartyAppStateId?: string;
1395
+ applicationScopes?: string;
1396
+ }, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes"> & {
1397
+ lastAuth?: Omit<{
1398
+ authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
1399
+ oauthProvider?: string;
1400
+ name?: string;
1401
+ loginId?: string;
1402
+ }, "loginId" | "name">;
1403
+ }, conditionInteractionId?: string, interactionId?: string, componentsVersion?: string, flowVersions?: Record<string, number>, input?: {
1404
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any)[])[])[])[])[])[])[])[])[])[])[];
1405
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
1406
+ next: (executionId: string, stepId: string, interactionId: string, version?: number, componentsVersion?: string, input?: {
1407
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any)[])[])[])[])[])[])[])[])[])[])[];
1408
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
1409
+ };
1410
+ webauthn: {
1411
+ signUp: ((identifier: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
1412
+ start: (loginId: string, origin: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
1413
+ transactionId: string;
1414
+ options: string;
1415
+ create: boolean;
1416
+ }>>;
1417
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1418
+ };
1419
+ signIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
1420
+ start: (loginId: string, origin: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
1421
+ transactionId: string;
1422
+ options: string;
1423
+ create: boolean;
1424
+ }>>;
1425
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1426
+ };
1427
+ signUpOrIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
1428
+ start: (loginId: string, origin: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
1429
+ transactionId: string;
1430
+ options: string;
1431
+ create: boolean;
1432
+ }>>;
1433
+ };
1434
+ update: ((identifier: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
1435
+ start: (loginId: string, origin: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
1436
+ transactionId: string;
1437
+ options: string;
1438
+ create: boolean;
1439
+ }>>;
1440
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
1441
+ };
1442
+ helpers: {
1443
+ create: (options: string) => Promise<string>;
1444
+ get: (options: string) => Promise<string>;
1445
+ isSupported: typeof isSupported;
1446
+ conditional: (options: string, abort: AbortController) => Promise<string>;
1447
+ };
1448
+ };
1449
+ fedcm: {
1450
+ oneTap(provider?: string, oneTapConfig?: OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: (reason?: string) => void, onDismissed?: (reason?: string) => void): Promise<unknown>;
1451
+ launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1452
+ isSupported(): boolean;
1453
+ isLoggedIn(context?: "signin" | "signup" | "use" | "continue"): Promise<boolean>;
1454
+ };
1455
+ oidc: {
1456
+ login: (arg?: oidc_client_ts.CreateSigninRequestArgs, disableNavigation?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1457
+ finishLogin: (url?: string) => Promise<any>;
1458
+ finishLoginIfNeed: (url?: string) => Promise<any>;
1459
+ refreshToken: (refreshToken: string) => Promise<oidc_client_ts.SigninResponse>;
1460
+ logout: (arg?: oidc_client_ts.CreateSignoutRequestArgs, disableNavigation?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
1461
+ };
1462
+ accessKey: {
1463
+ exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
1464
+ };
1465
+ otp: {
1466
+ verify: {
1467
+ sms: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1468
+ voice: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1469
+ whatsapp: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1470
+ email: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1471
+ };
1472
+ signIn: {
1473
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1474
+ maskedPhone: string;
1475
+ }>>;
1476
+ voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1477
+ maskedPhone: string;
1478
+ }>>;
1479
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1480
+ maskedPhone: string;
1481
+ }>>;
1482
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1483
+ maskedEmail: string;
1484
+ }>>;
1485
+ };
1486
+ signUp: {
1487
+ sms: (loginId: string, user?: {
1488
+ email?: string;
1489
+ name?: string;
1490
+ givenName?: string;
1491
+ middleName?: string;
1492
+ familyName?: string;
1493
+ phone?: string;
1494
+ }, signUpOptions?: {
1495
+ customClaims?: Record<string, any>;
1496
+ templateId?: string;
1497
+ templateOptions?: {
1498
+ [x: string]: string;
1499
+ };
1500
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1501
+ maskedPhone: string;
1502
+ }>>;
1503
+ voice: (loginId: string, user?: {
1504
+ email?: string;
1505
+ name?: string;
1506
+ givenName?: string;
1507
+ middleName?: string;
1508
+ familyName?: string;
1509
+ phone?: string;
1510
+ }, signUpOptions?: {
1511
+ customClaims?: Record<string, any>;
1512
+ templateId?: string;
1513
+ templateOptions?: {
1514
+ [x: string]: string;
1515
+ };
1516
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1517
+ maskedPhone: string;
1518
+ }>>;
1519
+ whatsapp: (loginId: string, user?: {
1520
+ email?: string;
1521
+ name?: string;
1522
+ givenName?: string;
1523
+ middleName?: string;
1524
+ familyName?: string;
1525
+ phone?: string;
1526
+ }, signUpOptions?: {
1527
+ customClaims?: Record<string, any>;
1528
+ templateId?: string;
1529
+ templateOptions?: {
1530
+ [x: string]: string;
1531
+ };
1532
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1533
+ maskedPhone: string;
1534
+ }>>;
1535
+ email: (loginId: string, user?: {
1536
+ email?: string;
1537
+ name?: string;
1538
+ givenName?: string;
1539
+ middleName?: string;
1540
+ familyName?: string;
1541
+ phone?: string;
1542
+ }, signUpOptions?: {
1543
+ customClaims?: Record<string, any>;
1544
+ templateId?: string;
1545
+ templateOptions?: {
1546
+ [x: string]: string;
1547
+ };
1548
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1549
+ maskedEmail: string;
1550
+ }>>;
1551
+ };
1552
+ signUpOrIn: {
1553
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1554
+ maskedPhone: string;
1555
+ }>>;
1556
+ voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1557
+ maskedPhone: string;
1558
+ }>>;
1559
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1560
+ maskedPhone: string;
1561
+ }>>;
1562
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1563
+ maskedEmail: string;
1564
+ }>>;
1565
+ };
1566
+ update: {
1567
+ email: <T extends boolean>(loginId: string, email: string, token?: string, updateOptions?: {
1568
+ addToLoginIDs?: T;
1569
+ onMergeUseExisting?: T extends true ? boolean : never;
1570
+ templateOptions?: {
1571
+ [x: string]: string;
1572
+ };
1573
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1574
+ maskedEmail: string;
1575
+ }>>;
1576
+ phone: {
1577
+ sms: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
1578
+ addToLoginIDs?: T_1;
1579
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
1580
+ templateOptions?: {
1581
+ [x: string]: string;
1582
+ };
1583
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1584
+ maskedPhone: string;
1585
+ }>>;
1586
+ voice: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
1587
+ addToLoginIDs?: T_1;
1588
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
1589
+ templateOptions?: {
1590
+ [x: string]: string;
1591
+ };
1592
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1593
+ maskedPhone: string;
1594
+ }>>;
1595
+ whatsapp: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
1596
+ addToLoginIDs?: T_1;
1597
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
1598
+ templateOptions?: {
1599
+ [x: string]: string;
1600
+ };
1601
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1602
+ maskedPhone: string;
1603
+ }>>;
1604
+ };
1605
+ };
1606
+ };
1607
+ magicLink: {
1608
+ verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1609
+ signIn: {
1610
+ sms: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1611
+ maskedPhone: string;
1612
+ }>>;
1613
+ voice: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1614
+ maskedPhone: string;
1615
+ }>>;
1616
+ whatsapp: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1617
+ maskedPhone: string;
1618
+ }>>;
1619
+ email: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1620
+ maskedEmail: string;
1621
+ }>>;
1622
+ };
1623
+ signUp: {
1624
+ sms: (loginId: string, URI: string, user?: {
1625
+ email?: string;
1626
+ name?: string;
1627
+ givenName?: string;
1628
+ middleName?: string;
1629
+ familyName?: string;
1630
+ phone?: string;
1631
+ }, signUpOptions?: {
1632
+ customClaims?: Record<string, any>;
1633
+ templateId?: string;
1634
+ templateOptions?: {
1635
+ [x: string]: string;
1636
+ };
1637
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1638
+ maskedPhone: string;
1639
+ }>>;
1640
+ voice: (loginId: string, URI: string, user?: {
1641
+ email?: string;
1642
+ name?: string;
1643
+ givenName?: string;
1644
+ middleName?: string;
1645
+ familyName?: string;
1646
+ phone?: string;
1647
+ }, signUpOptions?: {
1648
+ customClaims?: Record<string, any>;
1649
+ templateId?: string;
1650
+ templateOptions?: {
1651
+ [x: string]: string;
1652
+ };
1653
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1654
+ maskedPhone: string;
1655
+ }>>;
1656
+ whatsapp: (loginId: string, URI: string, user?: {
1657
+ email?: string;
1658
+ name?: string;
1659
+ givenName?: string;
1660
+ middleName?: string;
1661
+ familyName?: string;
1662
+ phone?: string;
1663
+ }, signUpOptions?: {
1664
+ customClaims?: Record<string, any>;
1665
+ templateId?: string;
1666
+ templateOptions?: {
1667
+ [x: string]: string;
1668
+ };
1669
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1670
+ maskedPhone: string;
1671
+ }>>;
1672
+ email: (loginId: string, URI: string, user?: {
1673
+ email?: string;
1674
+ name?: string;
1675
+ givenName?: string;
1676
+ middleName?: string;
1677
+ familyName?: string;
1678
+ phone?: string;
1679
+ }, signUpOptions?: {
1680
+ customClaims?: Record<string, any>;
1681
+ templateId?: string;
1682
+ templateOptions?: {
1683
+ [x: string]: string;
1684
+ };
1685
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1686
+ maskedEmail: string;
1687
+ }>>;
1688
+ };
1689
+ signUpOrIn: {
1690
+ sms: (loginId: string, URI?: string, signUpOptions?: {
1691
+ customClaims?: Record<string, any>;
1692
+ templateId?: string;
1693
+ templateOptions?: {
1694
+ [x: string]: string;
1695
+ };
1696
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1697
+ maskedPhone: string;
1698
+ }>>;
1699
+ voice: (loginId: string, URI?: string, signUpOptions?: {
1700
+ customClaims?: Record<string, any>;
1701
+ templateId?: string;
1702
+ templateOptions?: {
1703
+ [x: string]: string;
1704
+ };
1705
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1706
+ maskedPhone: string;
1707
+ }>>;
1708
+ whatsapp: (loginId: string, URI?: string, signUpOptions?: {
1709
+ customClaims?: Record<string, any>;
1710
+ templateId?: string;
1711
+ templateOptions?: {
1712
+ [x: string]: string;
1713
+ };
1714
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1715
+ maskedPhone: string;
1716
+ }>>;
1717
+ email: (loginId: string, URI?: string, signUpOptions?: {
1718
+ customClaims?: Record<string, any>;
1719
+ templateId?: string;
1720
+ templateOptions?: {
1721
+ [x: string]: string;
1722
+ };
1723
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1724
+ maskedEmail: string;
1725
+ }>>;
1726
+ };
1727
+ update: {
1728
+ email: <T_2 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
1729
+ addToLoginIDs?: T_2;
1730
+ onMergeUseExisting?: T_2 extends true ? boolean : never;
1731
+ templateOptions?: {
1732
+ [x: string]: string;
1733
+ };
1734
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1735
+ maskedEmail: string;
1736
+ }>>;
1737
+ phone: {
1738
+ sms: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
1739
+ addToLoginIDs?: T_3;
1740
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
1741
+ templateOptions?: {
1742
+ [x: string]: string;
1743
+ };
1744
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1745
+ maskedPhone: string;
1746
+ }>>;
1747
+ voice: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
1748
+ addToLoginIDs?: T_3;
1749
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
1750
+ templateOptions?: {
1751
+ [x: string]: string;
1752
+ };
1753
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1754
+ maskedPhone: string;
1755
+ }>>;
1756
+ whatsapp: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
1757
+ addToLoginIDs?: T_3;
1758
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
1759
+ templateOptions?: {
1760
+ [x: string]: string;
1761
+ };
1762
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1763
+ maskedPhone: string;
1764
+ }>>;
1765
+ };
1766
+ };
1767
+ };
1768
+ enchantedLink: {
1769
+ verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1770
+ signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1771
+ signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
1772
+ customClaims?: Record<string, any>;
1773
+ templateId?: string;
1774
+ templateOptions?: {
1775
+ [x: string]: string;
1776
+ };
1777
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1778
+ signUp: (loginId: string, URI?: string, user?: {
1779
+ email?: string;
1780
+ name?: string;
1781
+ givenName?: string;
1782
+ middleName?: string;
1783
+ familyName?: string;
1784
+ phone?: string;
1785
+ }, signUpOptions?: {
1786
+ customClaims?: Record<string, any>;
1787
+ templateId?: string;
1788
+ templateOptions?: {
1789
+ [x: string]: string;
1790
+ };
1791
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1792
+ waitForSession: (pendingRef: string, config?: {
1793
+ pollingIntervalMs: number;
1794
+ timeoutMs: number;
1795
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1796
+ update: {
1797
+ email: <T_4 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
1798
+ addToLoginIDs?: T_4;
1799
+ onMergeUseExisting?: T_4 extends true ? boolean : never;
1800
+ templateOptions?: {
1801
+ [x: string]: string;
1802
+ };
1803
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1804
+ };
1805
+ };
1806
+ oauth: {
1807
+ start: ((provider: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
1808
+ google: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1809
+ facebook: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1810
+ github: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1811
+ microsoft: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1812
+ gitlab: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1813
+ apple: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1814
+ discord: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1815
+ linkedin: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1816
+ slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1817
+ };
1818
+ exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1819
+ startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
1820
+ finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
1821
+ };
1822
+ saml: {
1823
+ start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, ssoId?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1824
+ exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1825
+ };
1826
+ totp: {
1827
+ signUp: (loginId: string, user?: {
1828
+ email?: string;
1829
+ name?: string;
1830
+ givenName?: string;
1831
+ middleName?: string;
1832
+ familyName?: string;
1833
+ phone?: string;
1834
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
1835
+ verify: (loginId: string, code: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1836
+ update: (loginId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
1837
+ };
1838
+ notp: {
1839
+ signUpOrIn: (loginId?: string, signUpOptions?: {
1840
+ customClaims?: Record<string, any>;
1841
+ templateId?: string;
1842
+ templateOptions?: {
1843
+ [x: string]: string;
1844
+ };
1845
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1846
+ pendingRef: string;
1847
+ redirectUrl: string;
1848
+ image: string;
1849
+ }>>;
1850
+ signUp: (loginId?: string, user?: {
1851
+ email?: string;
1852
+ name?: string;
1853
+ givenName?: string;
1854
+ middleName?: string;
1855
+ familyName?: string;
1856
+ phone?: string;
1857
+ }, signUpOptions?: {
1858
+ customClaims?: Record<string, any>;
1859
+ templateId?: string;
1860
+ templateOptions?: {
1861
+ [x: string]: string;
1862
+ };
1863
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1864
+ pendingRef: string;
1865
+ redirectUrl: string;
1866
+ image: string;
1867
+ }>>;
1868
+ signIn: (loginId?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1869
+ pendingRef: string;
1870
+ redirectUrl: string;
1871
+ image: string;
1872
+ }>>;
1873
+ waitForSession: (pendingRef: string, config?: {
1874
+ pollingIntervalMs: number;
1875
+ timeoutMs: number;
1876
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1877
+ };
1878
+ password: {
1879
+ signUp: (loginId: string, password: string, user?: {
1880
+ email?: string;
1881
+ name?: string;
1882
+ givenName?: string;
1883
+ middleName?: string;
1884
+ familyName?: string;
1885
+ phone?: string;
1886
+ }, signUpOptions?: {
1887
+ customClaims?: Record<string, any>;
1888
+ templateId?: string;
1889
+ templateOptions?: {
1890
+ [x: string]: string;
1891
+ };
1892
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1893
+ signIn: (loginId: string, password: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1894
+ sendReset: (loginId: string, redirectUrl?: string, templateOptions?: {
1895
+ [x: string]: string;
1896
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
1897
+ resetMethod: string;
1898
+ pendingRef?: string;
1899
+ linkId?: string;
1900
+ maskedEmail: string;
1901
+ }>>;
1902
+ update: (loginId: string, newPassword: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1903
+ replace: (loginId: string, oldPassword: string, newPassword: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1904
+ policy: () => Promise<_descope_core_js_sdk.SdkResponse<{
1905
+ minLength: number;
1906
+ lowercase: boolean;
1907
+ uppercase: boolean;
1908
+ number: boolean;
1909
+ nonAlphanumeric: boolean;
1910
+ }>>;
1911
+ };
1912
+ selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1913
+ logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1914
+ me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
1915
+ myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1916
+ tenants: {
1917
+ id: string;
1918
+ name: string;
1919
+ customAttributes?: Record<string, any>;
1920
+ }[];
1921
+ }>>;
1922
+ history: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserHistoryResponse>>;
1923
+ isJwtExpired: (token: string) => boolean;
1924
+ getTenants: (token: string) => string[];
1925
+ getJwtPermissions: (token: string, tenant?: string) => string[];
1926
+ getJwtRoles: (token: string, tenant?: string) => string[];
1927
+ getCurrentTenant: (token: string) => string;
1928
+ httpClient: {
1929
+ get: (path: string, config?: {
1930
+ headers?: HeadersInit;
1931
+ queryParams?: {
1932
+ [key: string]: string;
1933
+ };
1934
+ token?: string;
1935
+ }) => Promise<Response>;
1936
+ post: (path: string, body?: any, config?: {
1937
+ headers?: HeadersInit;
1938
+ queryParams?: {
1939
+ [key: string]: string;
1940
+ };
1941
+ token?: string;
1942
+ }) => Promise<Response>;
1943
+ patch: (path: string, body?: any, config?: {
1944
+ headers?: HeadersInit;
1945
+ queryParams?: {
1946
+ [key: string]: string;
1947
+ };
1948
+ token?: string;
1949
+ }) => Promise<Response>;
1950
+ put: (path: string, body?: any, config?: {
1951
+ headers?: HeadersInit;
1952
+ queryParams?: {
1953
+ [key: string]: string;
1954
+ };
1955
+ token?: string;
1956
+ }) => Promise<Response>;
1957
+ delete: (path: string, config?: {
1958
+ headers?: HeadersInit;
1959
+ queryParams?: {
1960
+ [key: string]: string;
1961
+ };
1962
+ token?: string;
1963
+ }) => Promise<Response>;
1964
+ hooks?: {
1965
+ beforeRequest?: (config: _descope_core_js_sdk.RequestConfig) => _descope_core_js_sdk.RequestConfig;
1966
+ afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
1967
+ transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
1968
+ };
1969
+ buildUrl: (path: string, queryParams?: {
1970
+ [key: string]: string;
1971
+ }) => string;
1972
+ };
1973
+ }) & {
1974
+ onSessionTokenChange: (cb: (data: string) => void) => () => any[];
1975
+ onUserChange: (cb: (data: _descope_core_js_sdk.UserResponse) => void) => () => any[];
1976
+ onIsAuthenticatedChange: (cb: (isAuthenticated: boolean) => void) => () => any[];
1977
+ }) & {
1978
+ getLastUserLoginId: () => string;
1979
+ getLastUserDisplayName: () => string;
1980
+ } : ((({
1981
+ refresh: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1982
+ logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1983
+ flow: {
1984
+ start: (flowId: string, options?: Pick<{
1985
+ redirectUrl?: string;
1986
+ location?: string;
1987
+ tenant?: string;
1988
+ deviceInfo?: {
1989
+ webAuthnSupport?: boolean;
1990
+ };
1991
+ lastAuth?: {
1992
+ authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
1993
+ oauthProvider?: string;
1994
+ name?: string;
1995
+ loginId?: string;
1996
+ };
1997
+ redirectAuth?: {
1998
+ callbackUrl: string;
1999
+ codeChallenge: string;
2000
+ };
2001
+ oidcIdpStateId?: string;
2002
+ preview?: boolean;
2003
+ samlIdpStateId?: string;
2004
+ samlIdpUsername?: string;
2005
+ ssoAppId?: string;
2006
+ thirdPartyAppId?: string;
2007
+ oidcLoginHint?: string;
2008
+ abTestingKey?: number;
2009
+ startOptionsVersion?: number;
2010
+ client?: Record<string, any>;
2011
+ locale?: string;
2012
+ oidcPrompt?: string;
2013
+ oidcErrorRedirectUri?: string;
2014
+ nativeOptions?: {
2015
+ platform: "ios" | "android";
2016
+ oauthProvider?: string;
2017
+ oauthRedirect?: string;
2018
+ };
2019
+ thirdPartyAppStateId?: string;
2020
+ applicationScopes?: string;
2021
+ }, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes"> & {
2022
+ lastAuth?: Omit<{
2023
+ authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
2024
+ oauthProvider?: string;
2025
+ name?: string;
2026
+ loginId?: string;
2027
+ }, "loginId" | "name">;
2028
+ }, conditionInteractionId?: string, interactionId?: string, componentsVersion?: string, flowVersions?: Record<string, number>, input?: {
2029
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any)[])[])[])[])[])[])[])[])[])[])[];
2030
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
2031
+ next: (executionId: string, stepId: string, interactionId: string, version?: number, componentsVersion?: string, input?: {
2032
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any)[])[])[])[])[])[])[])[])[])[])[];
2033
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
2034
+ };
2035
+ webauthn: {
2036
+ signUp: ((identifier: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
2037
+ start: (loginId: string, origin: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
2038
+ transactionId: string;
2039
+ options: string;
2040
+ create: boolean;
2041
+ }>>;
2042
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2043
+ };
2044
+ signIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
2045
+ start: (loginId: string, origin: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
2046
+ transactionId: string;
2047
+ options: string;
2048
+ create: boolean;
2049
+ }>>;
2050
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2051
+ };
2052
+ signUpOrIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
2053
+ start: (loginId: string, origin: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
2054
+ transactionId: string;
2055
+ options: string;
2056
+ create: boolean;
2057
+ }>>;
2058
+ };
2059
+ update: ((identifier: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
2060
+ start: (loginId: string, origin: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
2061
+ transactionId: string;
2062
+ options: string;
2063
+ create: boolean;
2064
+ }>>;
2065
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
2066
+ };
2067
+ helpers: {
2068
+ create: (options: string) => Promise<string>;
2069
+ get: (options: string) => Promise<string>;
2070
+ isSupported: typeof isSupported;
2071
+ conditional: (options: string, abort: AbortController) => Promise<string>;
2072
+ };
2073
+ };
2074
+ fedcm: {
2075
+ oneTap(provider?: string, oneTapConfig?: OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: (reason?: string) => void, onDismissed?: (reason?: string) => void): Promise<unknown>;
2076
+ launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2077
+ isSupported(): boolean;
2078
+ isLoggedIn(context?: "signin" | "signup" | "use" | "continue"): Promise<boolean>;
2079
+ };
2080
+ oidc: {
2081
+ login: (arg?: oidc_client_ts.CreateSigninRequestArgs, disableNavigation?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2082
+ finishLogin: (url?: string) => Promise<any>;
2083
+ finishLoginIfNeed: (url?: string) => Promise<any>;
2084
+ refreshToken: (refreshToken: string) => Promise<oidc_client_ts.SigninResponse>;
2085
+ logout: (arg?: oidc_client_ts.CreateSignoutRequestArgs, disableNavigation?: boolean) => Promise<any>;
2086
+ };
2087
+ accessKey: {
2088
+ exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
2089
+ };
2090
+ otp: {
2091
+ verify: {
2092
+ sms: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2093
+ voice: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2094
+ whatsapp: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2095
+ email: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2096
+ };
2097
+ signIn: {
2098
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2099
+ maskedPhone: string;
2100
+ }>>;
2101
+ voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2102
+ maskedPhone: string;
2103
+ }>>;
2104
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2105
+ maskedPhone: string;
2106
+ }>>;
2107
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2108
+ maskedEmail: string;
2109
+ }>>;
2110
+ };
2111
+ signUp: {
2112
+ sms: (loginId: string, user?: {
2113
+ email?: string;
2114
+ name?: string;
2115
+ givenName?: string;
2116
+ middleName?: string;
2117
+ familyName?: string;
2118
+ phone?: string;
2119
+ }, signUpOptions?: {
2120
+ customClaims?: Record<string, any>;
2121
+ templateId?: string;
2122
+ templateOptions?: {
2123
+ [x: string]: string;
2124
+ };
2125
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2126
+ maskedPhone: string;
2127
+ }>>;
2128
+ voice: (loginId: string, user?: {
2129
+ email?: string;
2130
+ name?: string;
2131
+ givenName?: string;
2132
+ middleName?: string;
2133
+ familyName?: string;
2134
+ phone?: string;
2135
+ }, signUpOptions?: {
2136
+ customClaims?: Record<string, any>;
2137
+ templateId?: string;
2138
+ templateOptions?: {
2139
+ [x: string]: string;
2140
+ };
2141
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2142
+ maskedPhone: string;
2143
+ }>>;
2144
+ whatsapp: (loginId: string, user?: {
2145
+ email?: string;
2146
+ name?: string;
2147
+ givenName?: string;
2148
+ middleName?: string;
2149
+ familyName?: string;
2150
+ phone?: string;
2151
+ }, signUpOptions?: {
2152
+ customClaims?: Record<string, any>;
2153
+ templateId?: string;
2154
+ templateOptions?: {
2155
+ [x: string]: string;
2156
+ };
2157
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2158
+ maskedPhone: string;
2159
+ }>>;
2160
+ email: (loginId: string, user?: {
2161
+ email?: string;
2162
+ name?: string;
2163
+ givenName?: string;
2164
+ middleName?: string;
2165
+ familyName?: string;
2166
+ phone?: string;
2167
+ }, signUpOptions?: {
2168
+ customClaims?: Record<string, any>;
2169
+ templateId?: string;
2170
+ templateOptions?: {
2171
+ [x: string]: string;
2172
+ };
2173
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2174
+ maskedEmail: string;
2175
+ }>>;
2176
+ };
2177
+ signUpOrIn: {
2178
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2179
+ maskedPhone: string;
2180
+ }>>;
2181
+ voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2182
+ maskedPhone: string;
2183
+ }>>;
2184
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2185
+ maskedPhone: string;
2186
+ }>>;
2187
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2188
+ maskedEmail: string;
2189
+ }>>;
2190
+ };
2191
+ update: {
2192
+ email: <T extends boolean>(loginId: string, email: string, token?: string, updateOptions?: {
2193
+ addToLoginIDs?: T;
2194
+ onMergeUseExisting?: T extends true ? boolean : never;
2195
+ templateOptions?: {
2196
+ [x: string]: string;
2197
+ };
2198
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2199
+ maskedEmail: string;
2200
+ }>>;
2201
+ phone: {
2202
+ sms: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
2203
+ addToLoginIDs?: T_1;
2204
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
2205
+ templateOptions?: {
2206
+ [x: string]: string;
2207
+ };
2208
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2209
+ maskedPhone: string;
2210
+ }>>;
2211
+ voice: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
2212
+ addToLoginIDs?: T_1;
2213
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
2214
+ templateOptions?: {
2215
+ [x: string]: string;
2216
+ };
2217
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2218
+ maskedPhone: string;
2219
+ }>>;
2220
+ whatsapp: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
2221
+ addToLoginIDs?: T_1;
2222
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
2223
+ templateOptions?: {
2224
+ [x: string]: string;
2225
+ };
2226
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2227
+ maskedPhone: string;
2228
+ }>>;
2229
+ };
2230
+ };
2231
+ };
2232
+ magicLink: {
2233
+ verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2234
+ signIn: {
2235
+ sms: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2236
+ maskedPhone: string;
2237
+ }>>;
2238
+ voice: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2239
+ maskedPhone: string;
2240
+ }>>;
2241
+ whatsapp: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2242
+ maskedPhone: string;
2243
+ }>>;
2244
+ email: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2245
+ maskedEmail: string;
2246
+ }>>;
2247
+ };
2248
+ signUp: {
2249
+ sms: (loginId: string, URI: string, user?: {
2250
+ email?: string;
2251
+ name?: string;
2252
+ givenName?: string;
2253
+ middleName?: string;
2254
+ familyName?: string;
2255
+ phone?: string;
2256
+ }, signUpOptions?: {
2257
+ customClaims?: Record<string, any>;
2258
+ templateId?: string;
2259
+ templateOptions?: {
2260
+ [x: string]: string;
2261
+ };
2262
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2263
+ maskedPhone: string;
2264
+ }>>;
2265
+ voice: (loginId: string, URI: string, user?: {
2266
+ email?: string;
2267
+ name?: string;
2268
+ givenName?: string;
2269
+ middleName?: string;
2270
+ familyName?: string;
2271
+ phone?: string;
2272
+ }, signUpOptions?: {
2273
+ customClaims?: Record<string, any>;
2274
+ templateId?: string;
2275
+ templateOptions?: {
2276
+ [x: string]: string;
2277
+ };
2278
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2279
+ maskedPhone: string;
2280
+ }>>;
2281
+ whatsapp: (loginId: string, URI: string, user?: {
2282
+ email?: string;
2283
+ name?: string;
2284
+ givenName?: string;
2285
+ middleName?: string;
2286
+ familyName?: string;
2287
+ phone?: string;
2288
+ }, signUpOptions?: {
2289
+ customClaims?: Record<string, any>;
2290
+ templateId?: string;
2291
+ templateOptions?: {
2292
+ [x: string]: string;
2293
+ };
2294
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2295
+ maskedPhone: string;
2296
+ }>>;
2297
+ email: (loginId: string, URI: string, user?: {
2298
+ email?: string;
2299
+ name?: string;
2300
+ givenName?: string;
2301
+ middleName?: string;
2302
+ familyName?: string;
2303
+ phone?: string;
2304
+ }, signUpOptions?: {
2305
+ customClaims?: Record<string, any>;
2306
+ templateId?: string;
2307
+ templateOptions?: {
2308
+ [x: string]: string;
2309
+ };
2310
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2311
+ maskedEmail: string;
2312
+ }>>;
2313
+ };
2314
+ signUpOrIn: {
2315
+ sms: (loginId: string, URI?: string, signUpOptions?: {
2316
+ customClaims?: Record<string, any>;
2317
+ templateId?: string;
2318
+ templateOptions?: {
2319
+ [x: string]: string;
2320
+ };
2321
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2322
+ maskedPhone: string;
2323
+ }>>;
2324
+ voice: (loginId: string, URI?: string, signUpOptions?: {
2325
+ customClaims?: Record<string, any>;
2326
+ templateId?: string;
2327
+ templateOptions?: {
2328
+ [x: string]: string;
2329
+ };
2330
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2331
+ maskedPhone: string;
2332
+ }>>;
2333
+ whatsapp: (loginId: string, URI?: string, signUpOptions?: {
2334
+ customClaims?: Record<string, any>;
2335
+ templateId?: string;
2336
+ templateOptions?: {
2337
+ [x: string]: string;
2338
+ };
2339
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2340
+ maskedPhone: string;
2341
+ }>>;
2342
+ email: (loginId: string, URI?: string, signUpOptions?: {
2343
+ customClaims?: Record<string, any>;
2344
+ templateId?: string;
2345
+ templateOptions?: {
2346
+ [x: string]: string;
2347
+ };
2348
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2349
+ maskedEmail: string;
2350
+ }>>;
2351
+ };
2352
+ update: {
2353
+ email: <T_2 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
2354
+ addToLoginIDs?: T_2;
2355
+ onMergeUseExisting?: T_2 extends true ? boolean : never;
2356
+ templateOptions?: {
2357
+ [x: string]: string;
2358
+ };
2359
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2360
+ maskedEmail: string;
2361
+ }>>;
2362
+ phone: {
2363
+ sms: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
2364
+ addToLoginIDs?: T_3;
2365
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
2366
+ templateOptions?: {
2367
+ [x: string]: string;
2368
+ };
2369
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2370
+ maskedPhone: string;
2371
+ }>>;
2372
+ voice: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
2373
+ addToLoginIDs?: T_3;
2374
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
2375
+ templateOptions?: {
2376
+ [x: string]: string;
2377
+ };
2378
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2379
+ maskedPhone: string;
2380
+ }>>;
2381
+ whatsapp: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
2382
+ addToLoginIDs?: T_3;
2383
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
2384
+ templateOptions?: {
2385
+ [x: string]: string;
2386
+ };
2387
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2388
+ maskedPhone: string;
2389
+ }>>;
2390
+ };
2391
+ };
2392
+ };
2393
+ enchantedLink: {
2394
+ verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
2395
+ signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
2396
+ signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
2397
+ customClaims?: Record<string, any>;
2398
+ templateId?: string;
2399
+ templateOptions?: {
2400
+ [x: string]: string;
2401
+ };
2402
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
2403
+ signUp: (loginId: string, URI?: string, user?: {
2404
+ email?: string;
2405
+ name?: string;
2406
+ givenName?: string;
2407
+ middleName?: string;
2408
+ familyName?: string;
2409
+ phone?: string;
2410
+ }, signUpOptions?: {
2411
+ customClaims?: Record<string, any>;
2412
+ templateId?: string;
2413
+ templateOptions?: {
2414
+ [x: string]: string;
2415
+ };
2416
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
2417
+ waitForSession: (pendingRef: string, config?: {
2418
+ pollingIntervalMs: number;
2419
+ timeoutMs: number;
2420
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2421
+ update: {
2422
+ email: <T_4 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
2423
+ addToLoginIDs?: T_4;
2424
+ onMergeUseExisting?: T_4 extends true ? boolean : never;
2425
+ templateOptions?: {
2426
+ [x: string]: string;
2427
+ };
2428
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
2429
+ };
2430
+ };
2431
+ oauth: {
2432
+ start: ((provider: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
2433
+ google: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2434
+ facebook: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2435
+ github: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2436
+ microsoft: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2437
+ gitlab: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2438
+ apple: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2439
+ discord: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2440
+ linkedin: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2441
+ slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2442
+ };
2443
+ exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2444
+ startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
2445
+ finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
2446
+ };
2447
+ saml: {
2448
+ start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, ssoId?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2449
+ exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2450
+ };
2451
+ totp: {
2452
+ signUp: (loginId: string, user?: {
2453
+ email?: string;
2454
+ name?: string;
2455
+ givenName?: string;
2456
+ middleName?: string;
2457
+ familyName?: string;
2458
+ phone?: string;
2459
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
2460
+ verify: (loginId: string, code: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2461
+ update: (loginId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
2462
+ };
2463
+ notp: {
2464
+ signUpOrIn: (loginId?: string, signUpOptions?: {
2465
+ customClaims?: Record<string, any>;
2466
+ templateId?: string;
2467
+ templateOptions?: {
2468
+ [x: string]: string;
2469
+ };
2470
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2471
+ pendingRef: string;
2472
+ redirectUrl: string;
2473
+ image: string;
2474
+ }>>;
2475
+ signUp: (loginId?: string, user?: {
2476
+ email?: string;
2477
+ name?: string;
2478
+ givenName?: string;
2479
+ middleName?: string;
2480
+ familyName?: string;
2481
+ phone?: string;
2482
+ }, signUpOptions?: {
2483
+ customClaims?: Record<string, any>;
2484
+ templateId?: string;
2485
+ templateOptions?: {
2486
+ [x: string]: string;
2487
+ };
2488
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2489
+ pendingRef: string;
2490
+ redirectUrl: string;
2491
+ image: string;
2492
+ }>>;
2493
+ signIn: (loginId?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2494
+ pendingRef: string;
2495
+ redirectUrl: string;
2496
+ image: string;
2497
+ }>>;
2498
+ waitForSession: (pendingRef: string, config?: {
2499
+ pollingIntervalMs: number;
2500
+ timeoutMs: number;
2501
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2502
+ };
2503
+ password: {
2504
+ signUp: (loginId: string, password: string, user?: {
2505
+ email?: string;
2506
+ name?: string;
2507
+ givenName?: string;
2508
+ middleName?: string;
2509
+ familyName?: string;
2510
+ phone?: string;
2511
+ }, signUpOptions?: {
2512
+ customClaims?: Record<string, any>;
2513
+ templateId?: string;
2514
+ templateOptions?: {
2515
+ [x: string]: string;
2516
+ };
2517
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2518
+ signIn: (loginId: string, password: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2519
+ sendReset: (loginId: string, redirectUrl?: string, templateOptions?: {
2520
+ [x: string]: string;
2521
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2522
+ resetMethod: string;
2523
+ pendingRef?: string;
2524
+ linkId?: string;
2525
+ maskedEmail: string;
2526
+ }>>;
2527
+ update: (loginId: string, newPassword: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
2528
+ replace: (loginId: string, oldPassword: string, newPassword: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2529
+ policy: () => Promise<_descope_core_js_sdk.SdkResponse<{
2530
+ minLength: number;
2531
+ lowercase: boolean;
2532
+ uppercase: boolean;
2533
+ number: boolean;
2534
+ nonAlphanumeric: boolean;
2535
+ }>>;
2536
+ };
2537
+ selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2538
+ logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
2539
+ me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
2540
+ myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2541
+ tenants: {
2542
+ id: string;
2543
+ name: string;
2544
+ customAttributes?: Record<string, any>;
2545
+ }[];
2546
+ }>>;
2547
+ history: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserHistoryResponse>>;
2548
+ isJwtExpired: (token: string) => boolean;
2549
+ getTenants: (token: string) => string[];
2550
+ getJwtPermissions: (token: string, tenant?: string) => string[];
2551
+ getJwtRoles: (token: string, tenant?: string) => string[];
2552
+ getCurrentTenant: (token: string) => string;
2553
+ httpClient: {
2554
+ get: (path: string, config?: {
2555
+ headers?: HeadersInit;
2556
+ queryParams?: {
2557
+ [key: string]: string;
2558
+ };
2559
+ token?: string;
2560
+ }) => Promise<Response>;
2561
+ post: (path: string, body?: any, config?: {
2562
+ headers?: HeadersInit;
2563
+ queryParams?: {
2564
+ [key: string]: string;
2565
+ };
2566
+ token?: string;
2567
+ }) => Promise<Response>;
2568
+ patch: (path: string, body?: any, config?: {
2569
+ headers?: HeadersInit;
2570
+ queryParams?: {
2571
+ [key: string]: string;
2572
+ };
2573
+ token?: string;
2574
+ }) => Promise<Response>;
2575
+ put: (path: string, body?: any, config?: {
2576
+ headers?: HeadersInit;
2577
+ queryParams?: {
2578
+ [key: string]: string;
2579
+ };
2580
+ token?: string;
2581
+ }) => Promise<Response>;
2582
+ delete: (path: string, config?: {
2583
+ headers?: HeadersInit;
2584
+ queryParams?: {
2585
+ [key: string]: string;
2586
+ };
2587
+ token?: string;
2588
+ }) => Promise<Response>;
2589
+ hooks?: {
2590
+ beforeRequest?: (config: _descope_core_js_sdk.RequestConfig) => _descope_core_js_sdk.RequestConfig;
2591
+ afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
2592
+ transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
2593
+ };
2594
+ buildUrl: (path: string, queryParams?: {
2595
+ [key: string]: string;
2596
+ }) => string;
2597
+ };
2598
+ } | {
2599
+ refresh: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2600
+ logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
2601
+ flow: {
2602
+ start: (flowId: string, options?: Pick<{
2603
+ redirectUrl?: string;
2604
+ location?: string;
2605
+ tenant?: string;
2606
+ deviceInfo?: {
2607
+ webAuthnSupport?: boolean;
2608
+ };
2609
+ lastAuth?: {
2610
+ authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
2611
+ oauthProvider?: string;
2612
+ name?: string;
2613
+ loginId?: string;
2614
+ };
2615
+ redirectAuth?: {
2616
+ callbackUrl: string;
2617
+ codeChallenge: string;
2618
+ };
2619
+ oidcIdpStateId?: string;
2620
+ preview?: boolean;
2621
+ samlIdpStateId?: string;
2622
+ samlIdpUsername?: string;
2623
+ ssoAppId?: string;
2624
+ thirdPartyAppId?: string;
2625
+ oidcLoginHint?: string;
2626
+ abTestingKey?: number;
2627
+ startOptionsVersion?: number;
2628
+ client?: Record<string, any>;
2629
+ locale?: string;
2630
+ oidcPrompt?: string;
2631
+ oidcErrorRedirectUri?: string;
2632
+ nativeOptions?: {
2633
+ platform: "ios" | "android";
2634
+ oauthProvider?: string;
2635
+ oauthRedirect?: string;
2636
+ };
2637
+ thirdPartyAppStateId?: string;
2638
+ applicationScopes?: string;
2639
+ }, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes"> & {
2640
+ lastAuth?: Omit<{
2641
+ authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
2642
+ oauthProvider?: string;
2643
+ name?: string;
2644
+ loginId?: string;
2645
+ }, "loginId" | "name">;
2646
+ }, conditionInteractionId?: string, interactionId?: string, componentsVersion?: string, flowVersions?: Record<string, number>, input?: {
2647
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any)[])[])[])[])[])[])[])[])[])[])[];
2648
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
2649
+ next: (executionId: string, stepId: string, interactionId: string, version?: number, componentsVersion?: string, input?: {
2650
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any)[])[])[])[])[])[])[])[])[])[])[];
2651
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
2652
+ };
2653
+ webauthn: {
2654
+ signUp: ((identifier: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
2655
+ start: (loginId: string, origin: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
2656
+ transactionId: string;
2657
+ options: string;
2658
+ create: boolean;
2659
+ }>>;
2660
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2661
+ };
2662
+ signIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
2663
+ start: (loginId: string, origin: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
2664
+ transactionId: string;
2665
+ options: string;
2666
+ create: boolean;
2667
+ }>>;
2668
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2669
+ };
2670
+ signUpOrIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
2671
+ start: (loginId: string, origin: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
2672
+ transactionId: string;
2673
+ options: string;
2674
+ create: boolean;
2675
+ }>>;
2676
+ };
2677
+ update: ((identifier: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
2678
+ start: (loginId: string, origin: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
2679
+ transactionId: string;
2680
+ options: string;
2681
+ create: boolean;
2682
+ }>>;
2683
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
2684
+ };
2685
+ helpers: {
2686
+ create: (options: string) => Promise<string>;
2687
+ get: (options: string) => Promise<string>;
2688
+ isSupported: typeof isSupported;
2689
+ conditional: (options: string, abort: AbortController) => Promise<string>;
2690
+ };
2691
+ };
2692
+ fedcm: {
2693
+ oneTap(provider?: string, oneTapConfig?: OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: (reason?: string) => void, onDismissed?: (reason?: string) => void): Promise<unknown>;
2694
+ launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2695
+ isSupported(): boolean;
2696
+ isLoggedIn(context?: "signin" | "signup" | "use" | "continue"): Promise<boolean>;
2697
+ };
2698
+ oidc: {
2699
+ login: (arg?: oidc_client_ts.CreateSigninRequestArgs, disableNavigation?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2700
+ finishLogin: (url?: string) => Promise<any>;
2701
+ finishLoginIfNeed: (url?: string) => Promise<any>;
2702
+ refreshToken: (refreshToken: string) => Promise<oidc_client_ts.SigninResponse>;
2703
+ logout: (arg?: oidc_client_ts.CreateSignoutRequestArgs, disableNavigation?: boolean) => Promise<any>;
2704
+ };
2705
+ accessKey: {
2706
+ exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
2707
+ };
2708
+ otp: {
2709
+ verify: {
2710
+ sms: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2711
+ voice: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2712
+ whatsapp: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2713
+ email: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2714
+ };
2715
+ signIn: {
2716
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2717
+ maskedPhone: string;
2718
+ }>>;
2719
+ voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2720
+ maskedPhone: string;
2721
+ }>>;
2722
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2723
+ maskedPhone: string;
2724
+ }>>;
2725
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2726
+ maskedEmail: string;
2727
+ }>>;
2728
+ };
2729
+ signUp: {
2730
+ sms: (loginId: string, user?: {
2731
+ email?: string;
2732
+ name?: string;
2733
+ givenName?: string;
2734
+ middleName?: string;
2735
+ familyName?: string;
2736
+ phone?: string;
2737
+ }, signUpOptions?: {
2738
+ customClaims?: Record<string, any>;
2739
+ templateId?: string;
2740
+ templateOptions?: {
2741
+ [x: string]: string;
2742
+ };
2743
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2744
+ maskedPhone: string;
2745
+ }>>;
2746
+ voice: (loginId: string, user?: {
2747
+ email?: string;
2748
+ name?: string;
2749
+ givenName?: string;
2750
+ middleName?: string;
2751
+ familyName?: string;
2752
+ phone?: string;
2753
+ }, signUpOptions?: {
2754
+ customClaims?: Record<string, any>;
2755
+ templateId?: string;
2756
+ templateOptions?: {
2757
+ [x: string]: string;
2758
+ };
2759
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2760
+ maskedPhone: string;
2761
+ }>>;
2762
+ whatsapp: (loginId: string, user?: {
2763
+ email?: string;
2764
+ name?: string;
2765
+ givenName?: string;
2766
+ middleName?: string;
2767
+ familyName?: string;
2768
+ phone?: string;
2769
+ }, signUpOptions?: {
2770
+ customClaims?: Record<string, any>;
2771
+ templateId?: string;
2772
+ templateOptions?: {
2773
+ [x: string]: string;
2774
+ };
2775
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2776
+ maskedPhone: string;
2777
+ }>>;
2778
+ email: (loginId: string, user?: {
2779
+ email?: string;
2780
+ name?: string;
2781
+ givenName?: string;
2782
+ middleName?: string;
2783
+ familyName?: string;
2784
+ phone?: string;
2785
+ }, signUpOptions?: {
2786
+ customClaims?: Record<string, any>;
2787
+ templateId?: string;
2788
+ templateOptions?: {
2789
+ [x: string]: string;
2790
+ };
2791
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2792
+ maskedEmail: string;
2793
+ }>>;
2794
+ };
2795
+ signUpOrIn: {
2796
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2797
+ maskedPhone: string;
2798
+ }>>;
2799
+ voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2800
+ maskedPhone: string;
2801
+ }>>;
2802
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2803
+ maskedPhone: string;
2804
+ }>>;
2805
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2806
+ maskedEmail: string;
2807
+ }>>;
2808
+ };
2809
+ update: {
2810
+ email: <T extends boolean>(loginId: string, email: string, token?: string, updateOptions?: {
2811
+ addToLoginIDs?: T;
2812
+ onMergeUseExisting?: T extends true ? boolean : never;
2813
+ templateOptions?: {
2814
+ [x: string]: string;
2815
+ };
2816
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2817
+ maskedEmail: string;
2818
+ }>>;
2819
+ phone: {
2820
+ sms: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
2821
+ addToLoginIDs?: T_1;
2822
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
2823
+ templateOptions?: {
2824
+ [x: string]: string;
2825
+ };
2826
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2827
+ maskedPhone: string;
2828
+ }>>;
2829
+ voice: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
2830
+ addToLoginIDs?: T_1;
2831
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
2832
+ templateOptions?: {
2833
+ [x: string]: string;
2834
+ };
2835
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2836
+ maskedPhone: string;
2837
+ }>>;
2838
+ whatsapp: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
2839
+ addToLoginIDs?: T_1;
2840
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
2841
+ templateOptions?: {
2842
+ [x: string]: string;
2843
+ };
2844
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2845
+ maskedPhone: string;
2846
+ }>>;
2847
+ };
2848
+ };
2849
+ };
2850
+ magicLink: {
2851
+ verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2852
+ signIn: {
2853
+ sms: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2854
+ maskedPhone: string;
2855
+ }>>;
2856
+ voice: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2857
+ maskedPhone: string;
2858
+ }>>;
2859
+ whatsapp: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2860
+ maskedPhone: string;
2861
+ }>>;
2862
+ email: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2863
+ maskedEmail: string;
2864
+ }>>;
2865
+ };
2866
+ signUp: {
2867
+ sms: (loginId: string, URI: string, user?: {
2868
+ email?: string;
2869
+ name?: string;
2870
+ givenName?: string;
2871
+ middleName?: string;
2872
+ familyName?: string;
2873
+ phone?: string;
2874
+ }, signUpOptions?: {
2875
+ customClaims?: Record<string, any>;
2876
+ templateId?: string;
2877
+ templateOptions?: {
2878
+ [x: string]: string;
2879
+ };
2880
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2881
+ maskedPhone: string;
2882
+ }>>;
2883
+ voice: (loginId: string, URI: string, user?: {
2884
+ email?: string;
2885
+ name?: string;
2886
+ givenName?: string;
2887
+ middleName?: string;
2888
+ familyName?: string;
2889
+ phone?: string;
2890
+ }, signUpOptions?: {
2891
+ customClaims?: Record<string, any>;
2892
+ templateId?: string;
2893
+ templateOptions?: {
2894
+ [x: string]: string;
2895
+ };
2896
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2897
+ maskedPhone: string;
2898
+ }>>;
2899
+ whatsapp: (loginId: string, URI: string, user?: {
2900
+ email?: string;
2901
+ name?: string;
2902
+ givenName?: string;
2903
+ middleName?: string;
2904
+ familyName?: string;
2905
+ phone?: string;
2906
+ }, signUpOptions?: {
2907
+ customClaims?: Record<string, any>;
2908
+ templateId?: string;
2909
+ templateOptions?: {
2910
+ [x: string]: string;
2911
+ };
2912
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2913
+ maskedPhone: string;
2914
+ }>>;
2915
+ email: (loginId: string, URI: string, user?: {
2916
+ email?: string;
2917
+ name?: string;
2918
+ givenName?: string;
2919
+ middleName?: string;
2920
+ familyName?: string;
2921
+ phone?: string;
2922
+ }, signUpOptions?: {
2923
+ customClaims?: Record<string, any>;
2924
+ templateId?: string;
2925
+ templateOptions?: {
2926
+ [x: string]: string;
2927
+ };
2928
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2929
+ maskedEmail: string;
2930
+ }>>;
2931
+ };
2932
+ signUpOrIn: {
2933
+ sms: (loginId: string, URI?: string, signUpOptions?: {
2934
+ customClaims?: Record<string, any>;
2935
+ templateId?: string;
2936
+ templateOptions?: {
2937
+ [x: string]: string;
2938
+ };
2939
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2940
+ maskedPhone: string;
2941
+ }>>;
2942
+ voice: (loginId: string, URI?: string, signUpOptions?: {
2943
+ customClaims?: Record<string, any>;
2944
+ templateId?: string;
2945
+ templateOptions?: {
2946
+ [x: string]: string;
2947
+ };
2948
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2949
+ maskedPhone: string;
2950
+ }>>;
2951
+ whatsapp: (loginId: string, URI?: string, signUpOptions?: {
2952
+ customClaims?: Record<string, any>;
2953
+ templateId?: string;
2954
+ templateOptions?: {
2955
+ [x: string]: string;
2956
+ };
2957
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2958
+ maskedPhone: string;
2959
+ }>>;
2960
+ email: (loginId: string, URI?: string, signUpOptions?: {
2961
+ customClaims?: Record<string, any>;
2962
+ templateId?: string;
2963
+ templateOptions?: {
2964
+ [x: string]: string;
2965
+ };
2966
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2967
+ maskedEmail: string;
2968
+ }>>;
2969
+ };
2970
+ update: {
2971
+ email: <T_2 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
2972
+ addToLoginIDs?: T_2;
2973
+ onMergeUseExisting?: T_2 extends true ? boolean : never;
2974
+ templateOptions?: {
2975
+ [x: string]: string;
2976
+ };
2977
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2978
+ maskedEmail: string;
2979
+ }>>;
2980
+ phone: {
2981
+ sms: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
2982
+ addToLoginIDs?: T_3;
2983
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
2984
+ templateOptions?: {
2985
+ [x: string]: string;
2986
+ };
2987
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2988
+ maskedPhone: string;
2989
+ }>>;
2990
+ voice: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
2991
+ addToLoginIDs?: T_3;
2992
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
2993
+ templateOptions?: {
2994
+ [x: string]: string;
2995
+ };
2996
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
2997
+ maskedPhone: string;
2998
+ }>>;
2999
+ whatsapp: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
3000
+ addToLoginIDs?: T_3;
3001
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
3002
+ templateOptions?: {
3003
+ [x: string]: string;
3004
+ };
3005
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3006
+ maskedPhone: string;
3007
+ }>>;
3008
+ };
3009
+ };
3010
+ };
3011
+ enchantedLink: {
3012
+ verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
3013
+ signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
3014
+ signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
3015
+ customClaims?: Record<string, any>;
3016
+ templateId?: string;
3017
+ templateOptions?: {
3018
+ [x: string]: string;
3019
+ };
3020
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
3021
+ signUp: (loginId: string, URI?: string, user?: {
3022
+ email?: string;
3023
+ name?: string;
3024
+ givenName?: string;
3025
+ middleName?: string;
3026
+ familyName?: string;
3027
+ phone?: string;
3028
+ }, signUpOptions?: {
3029
+ customClaims?: Record<string, any>;
3030
+ templateId?: string;
3031
+ templateOptions?: {
3032
+ [x: string]: string;
3033
+ };
3034
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
3035
+ waitForSession: (pendingRef: string, config?: {
3036
+ pollingIntervalMs: number;
3037
+ timeoutMs: number;
3038
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3039
+ update: {
3040
+ email: <T_4 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
3041
+ addToLoginIDs?: T_4;
3042
+ onMergeUseExisting?: T_4 extends true ? boolean : never;
3043
+ templateOptions?: {
3044
+ [x: string]: string;
3045
+ };
3046
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
3047
+ };
3048
+ };
3049
+ oauth: {
3050
+ start: ((provider: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
3051
+ google: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3052
+ facebook: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3053
+ github: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3054
+ microsoft: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3055
+ gitlab: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3056
+ apple: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3057
+ discord: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3058
+ linkedin: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3059
+ slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3060
+ };
3061
+ exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3062
+ startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
3063
+ finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
3064
+ };
3065
+ saml: {
3066
+ start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, ssoId?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3067
+ exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3068
+ };
3069
+ totp: {
3070
+ signUp: (loginId: string, user?: {
3071
+ email?: string;
3072
+ name?: string;
3073
+ givenName?: string;
3074
+ middleName?: string;
3075
+ familyName?: string;
3076
+ phone?: string;
3077
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
3078
+ verify: (loginId: string, code: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3079
+ update: (loginId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
3080
+ };
3081
+ notp: {
3082
+ signUpOrIn: (loginId?: string, signUpOptions?: {
3083
+ customClaims?: Record<string, any>;
3084
+ templateId?: string;
3085
+ templateOptions?: {
3086
+ [x: string]: string;
3087
+ };
3088
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3089
+ pendingRef: string;
3090
+ redirectUrl: string;
3091
+ image: string;
3092
+ }>>;
3093
+ signUp: (loginId?: string, user?: {
3094
+ email?: string;
3095
+ name?: string;
3096
+ givenName?: string;
3097
+ middleName?: string;
3098
+ familyName?: string;
3099
+ phone?: string;
3100
+ }, signUpOptions?: {
3101
+ customClaims?: Record<string, any>;
3102
+ templateId?: string;
3103
+ templateOptions?: {
3104
+ [x: string]: string;
3105
+ };
3106
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3107
+ pendingRef: string;
3108
+ redirectUrl: string;
3109
+ image: string;
3110
+ }>>;
3111
+ signIn: (loginId?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3112
+ pendingRef: string;
3113
+ redirectUrl: string;
3114
+ image: string;
3115
+ }>>;
3116
+ waitForSession: (pendingRef: string, config?: {
3117
+ pollingIntervalMs: number;
3118
+ timeoutMs: number;
3119
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3120
+ };
3121
+ password: {
3122
+ signUp: (loginId: string, password: string, user?: {
3123
+ email?: string;
3124
+ name?: string;
3125
+ givenName?: string;
3126
+ middleName?: string;
3127
+ familyName?: string;
3128
+ phone?: string;
3129
+ }, signUpOptions?: {
3130
+ customClaims?: Record<string, any>;
3131
+ templateId?: string;
3132
+ templateOptions?: {
3133
+ [x: string]: string;
3134
+ };
3135
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3136
+ signIn: (loginId: string, password: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3137
+ sendReset: (loginId: string, redirectUrl?: string, templateOptions?: {
3138
+ [x: string]: string;
3139
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3140
+ resetMethod: string;
3141
+ pendingRef?: string;
3142
+ linkId?: string;
3143
+ maskedEmail: string;
3144
+ }>>;
3145
+ update: (loginId: string, newPassword: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
3146
+ replace: (loginId: string, oldPassword: string, newPassword: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3147
+ policy: () => Promise<_descope_core_js_sdk.SdkResponse<{
3148
+ minLength: number;
3149
+ lowercase: boolean;
3150
+ uppercase: boolean;
3151
+ number: boolean;
3152
+ nonAlphanumeric: boolean;
3153
+ }>>;
3154
+ };
3155
+ selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3156
+ logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
3157
+ me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
3158
+ myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3159
+ tenants: {
3160
+ id: string;
3161
+ name: string;
3162
+ customAttributes?: Record<string, any>;
3163
+ }[];
3164
+ }>>;
3165
+ history: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserHistoryResponse>>;
3166
+ isJwtExpired: (token: string) => boolean;
3167
+ getTenants: (token: string) => string[];
3168
+ getJwtPermissions: (token: string, tenant?: string) => string[];
3169
+ getJwtRoles: (token: string, tenant?: string) => string[];
3170
+ getCurrentTenant: (token: string) => string;
3171
+ httpClient: {
3172
+ get: (path: string, config?: {
3173
+ headers?: HeadersInit;
3174
+ queryParams?: {
3175
+ [key: string]: string;
3176
+ };
3177
+ token?: string;
3178
+ }) => Promise<Response>;
3179
+ post: (path: string, body?: any, config?: {
3180
+ headers?: HeadersInit;
3181
+ queryParams?: {
3182
+ [key: string]: string;
3183
+ };
3184
+ token?: string;
3185
+ }) => Promise<Response>;
3186
+ patch: (path: string, body?: any, config?: {
3187
+ headers?: HeadersInit;
3188
+ queryParams?: {
3189
+ [key: string]: string;
3190
+ };
3191
+ token?: string;
3192
+ }) => Promise<Response>;
3193
+ put: (path: string, body?: any, config?: {
3194
+ headers?: HeadersInit;
3195
+ queryParams?: {
3196
+ [key: string]: string;
3197
+ };
3198
+ token?: string;
3199
+ }) => Promise<Response>;
3200
+ delete: (path: string, config?: {
3201
+ headers?: HeadersInit;
3202
+ queryParams?: {
3203
+ [key: string]: string;
3204
+ };
3205
+ token?: string;
3206
+ }) => Promise<Response>;
3207
+ hooks?: {
3208
+ beforeRequest?: (config: _descope_core_js_sdk.RequestConfig) => _descope_core_js_sdk.RequestConfig;
3209
+ afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
3210
+ transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
3211
+ };
3212
+ buildUrl: (path: string, queryParams?: {
3213
+ [key: string]: string;
3214
+ }) => string;
3215
+ };
3216
+ } | {
3217
+ refresh: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3218
+ logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
3219
+ flow: {
3220
+ start: (flowId: string, options?: Pick<{
3221
+ redirectUrl?: string;
3222
+ location?: string;
3223
+ tenant?: string;
3224
+ deviceInfo?: {
3225
+ webAuthnSupport?: boolean;
3226
+ };
3227
+ lastAuth?: {
3228
+ authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
3229
+ oauthProvider?: string;
3230
+ name?: string;
3231
+ loginId?: string;
3232
+ };
3233
+ redirectAuth?: {
3234
+ callbackUrl: string;
3235
+ codeChallenge: string;
3236
+ };
3237
+ oidcIdpStateId?: string;
3238
+ preview?: boolean;
3239
+ samlIdpStateId?: string;
3240
+ samlIdpUsername?: string;
3241
+ ssoAppId?: string;
3242
+ thirdPartyAppId?: string;
3243
+ oidcLoginHint?: string;
3244
+ abTestingKey?: number;
3245
+ startOptionsVersion?: number;
3246
+ client?: Record<string, any>;
3247
+ locale?: string;
3248
+ oidcPrompt?: string;
3249
+ oidcErrorRedirectUri?: string;
3250
+ nativeOptions?: {
3251
+ platform: "ios" | "android";
3252
+ oauthProvider?: string;
3253
+ oauthRedirect?: string;
3254
+ };
3255
+ thirdPartyAppStateId?: string;
3256
+ applicationScopes?: string;
3257
+ }, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "thirdPartyAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "nativeOptions" | "thirdPartyAppStateId" | "applicationScopes"> & {
3258
+ lastAuth?: Omit<{
3259
+ authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
3260
+ oauthProvider?: string;
3261
+ name?: string;
3262
+ loginId?: string;
3263
+ }, "loginId" | "name">;
3264
+ }, conditionInteractionId?: string, interactionId?: string, componentsVersion?: string, flowVersions?: Record<string, number>, input?: {
3265
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any)[])[])[])[])[])[])[])[])[])[])[];
3266
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
3267
+ next: (executionId: string, stepId: string, interactionId: string, version?: number, componentsVersion?: string, input?: {
3268
+ [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any)[])[])[])[])[])[])[])[])[])[])[];
3269
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
3270
+ };
3271
+ webauthn: {
3272
+ signUp: ((identifier: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
3273
+ start: (loginId: string, origin: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
3274
+ transactionId: string;
3275
+ options: string;
3276
+ create: boolean;
3277
+ }>>;
3278
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3279
+ };
3280
+ signIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
3281
+ start: (loginId: string, origin: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
3282
+ transactionId: string;
3283
+ options: string;
3284
+ create: boolean;
3285
+ }>>;
3286
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3287
+ };
3288
+ signUpOrIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
3289
+ start: (loginId: string, origin: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
3290
+ transactionId: string;
3291
+ options: string;
3292
+ create: boolean;
3293
+ }>>;
3294
+ };
3295
+ update: ((identifier: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
3296
+ start: (loginId: string, origin: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
3297
+ transactionId: string;
3298
+ options: string;
3299
+ create: boolean;
3300
+ }>>;
3301
+ finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
3302
+ };
3303
+ helpers: {
3304
+ create: (options: string) => Promise<string>;
3305
+ get: (options: string) => Promise<string>;
3306
+ isSupported: typeof isSupported;
3307
+ conditional: (options: string, abort: AbortController) => Promise<string>;
3308
+ };
3309
+ };
3310
+ fedcm: {
3311
+ oneTap(provider?: string, oneTapConfig?: OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: (reason?: string) => void, onDismissed?: (reason?: string) => void): Promise<unknown>;
3312
+ launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3313
+ isSupported(): boolean;
3314
+ isLoggedIn(context?: "signin" | "signup" | "use" | "continue"): Promise<boolean>;
3315
+ };
3316
+ oidc: {
3317
+ login: (arg?: oidc_client_ts.CreateSigninRequestArgs, disableNavigation?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3318
+ finishLogin: (url?: string) => Promise<any>;
3319
+ finishLoginIfNeed: (url?: string) => Promise<any>;
3320
+ refreshToken: (refreshToken: string) => Promise<oidc_client_ts.SigninResponse>;
3321
+ logout: (arg?: oidc_client_ts.CreateSignoutRequestArgs, disableNavigation?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
3322
+ };
3323
+ accessKey: {
3324
+ exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
3325
+ };
3326
+ otp: {
3327
+ verify: {
3328
+ sms: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3329
+ voice: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3330
+ whatsapp: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3331
+ email: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3332
+ };
3333
+ signIn: {
3334
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3335
+ maskedPhone: string;
3336
+ }>>;
3337
+ voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3338
+ maskedPhone: string;
3339
+ }>>;
3340
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3341
+ maskedPhone: string;
3342
+ }>>;
3343
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3344
+ maskedEmail: string;
3345
+ }>>;
3346
+ };
3347
+ signUp: {
3348
+ sms: (loginId: string, user?: {
3349
+ email?: string;
3350
+ name?: string;
3351
+ givenName?: string;
3352
+ middleName?: string;
3353
+ familyName?: string;
3354
+ phone?: string;
3355
+ }, signUpOptions?: {
3356
+ customClaims?: Record<string, any>;
3357
+ templateId?: string;
3358
+ templateOptions?: {
3359
+ [x: string]: string;
3360
+ };
3361
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3362
+ maskedPhone: string;
3363
+ }>>;
3364
+ voice: (loginId: string, user?: {
3365
+ email?: string;
3366
+ name?: string;
3367
+ givenName?: string;
3368
+ middleName?: string;
3369
+ familyName?: string;
3370
+ phone?: string;
3371
+ }, signUpOptions?: {
3372
+ customClaims?: Record<string, any>;
3373
+ templateId?: string;
3374
+ templateOptions?: {
3375
+ [x: string]: string;
3376
+ };
3377
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3378
+ maskedPhone: string;
3379
+ }>>;
3380
+ whatsapp: (loginId: string, user?: {
3381
+ email?: string;
3382
+ name?: string;
3383
+ givenName?: string;
3384
+ middleName?: string;
3385
+ familyName?: string;
3386
+ phone?: string;
3387
+ }, signUpOptions?: {
3388
+ customClaims?: Record<string, any>;
3389
+ templateId?: string;
3390
+ templateOptions?: {
3391
+ [x: string]: string;
3392
+ };
3393
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3394
+ maskedPhone: string;
3395
+ }>>;
3396
+ email: (loginId: string, user?: {
3397
+ email?: string;
3398
+ name?: string;
3399
+ givenName?: string;
3400
+ middleName?: string;
3401
+ familyName?: string;
3402
+ phone?: string;
3403
+ }, signUpOptions?: {
3404
+ customClaims?: Record<string, any>;
3405
+ templateId?: string;
3406
+ templateOptions?: {
3407
+ [x: string]: string;
3408
+ };
3409
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3410
+ maskedEmail: string;
3411
+ }>>;
3412
+ };
3413
+ signUpOrIn: {
3414
+ sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3415
+ maskedPhone: string;
3416
+ }>>;
3417
+ voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3418
+ maskedPhone: string;
3419
+ }>>;
3420
+ whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3421
+ maskedPhone: string;
3422
+ }>>;
3423
+ email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3424
+ maskedEmail: string;
3425
+ }>>;
3426
+ };
3427
+ update: {
3428
+ email: <T extends boolean>(loginId: string, email: string, token?: string, updateOptions?: {
3429
+ addToLoginIDs?: T;
3430
+ onMergeUseExisting?: T extends true ? boolean : never;
3431
+ templateOptions?: {
3432
+ [x: string]: string;
3433
+ };
3434
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3435
+ maskedEmail: string;
3436
+ }>>;
3437
+ phone: {
3438
+ sms: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
3439
+ addToLoginIDs?: T_1;
3440
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
3441
+ templateOptions?: {
3442
+ [x: string]: string;
3443
+ };
3444
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3445
+ maskedPhone: string;
3446
+ }>>;
3447
+ voice: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
3448
+ addToLoginIDs?: T_1;
3449
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
3450
+ templateOptions?: {
3451
+ [x: string]: string;
3452
+ };
3453
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3454
+ maskedPhone: string;
3455
+ }>>;
3456
+ whatsapp: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
3457
+ addToLoginIDs?: T_1;
3458
+ onMergeUseExisting?: T_1 extends true ? boolean : never;
3459
+ templateOptions?: {
3460
+ [x: string]: string;
3461
+ };
3462
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3463
+ maskedPhone: string;
3464
+ }>>;
3465
+ };
3466
+ };
3467
+ };
3468
+ magicLink: {
3469
+ verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3470
+ signIn: {
3471
+ sms: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3472
+ maskedPhone: string;
3473
+ }>>;
3474
+ voice: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3475
+ maskedPhone: string;
3476
+ }>>;
3477
+ whatsapp: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3478
+ maskedPhone: string;
3479
+ }>>;
3480
+ email: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3481
+ maskedEmail: string;
3482
+ }>>;
3483
+ };
3484
+ signUp: {
3485
+ sms: (loginId: string, URI: string, user?: {
3486
+ email?: string;
3487
+ name?: string;
3488
+ givenName?: string;
3489
+ middleName?: string;
3490
+ familyName?: string;
3491
+ phone?: string;
3492
+ }, signUpOptions?: {
3493
+ customClaims?: Record<string, any>;
3494
+ templateId?: string;
3495
+ templateOptions?: {
3496
+ [x: string]: string;
3497
+ };
3498
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3499
+ maskedPhone: string;
3500
+ }>>;
3501
+ voice: (loginId: string, URI: string, user?: {
3502
+ email?: string;
3503
+ name?: string;
3504
+ givenName?: string;
3505
+ middleName?: string;
3506
+ familyName?: string;
3507
+ phone?: string;
3508
+ }, signUpOptions?: {
3509
+ customClaims?: Record<string, any>;
3510
+ templateId?: string;
3511
+ templateOptions?: {
3512
+ [x: string]: string;
3513
+ };
3514
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3515
+ maskedPhone: string;
3516
+ }>>;
3517
+ whatsapp: (loginId: string, URI: string, user?: {
3518
+ email?: string;
3519
+ name?: string;
3520
+ givenName?: string;
3521
+ middleName?: string;
3522
+ familyName?: string;
3523
+ phone?: string;
3524
+ }, signUpOptions?: {
3525
+ customClaims?: Record<string, any>;
3526
+ templateId?: string;
3527
+ templateOptions?: {
3528
+ [x: string]: string;
3529
+ };
3530
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3531
+ maskedPhone: string;
3532
+ }>>;
3533
+ email: (loginId: string, URI: string, user?: {
3534
+ email?: string;
3535
+ name?: string;
3536
+ givenName?: string;
3537
+ middleName?: string;
3538
+ familyName?: string;
3539
+ phone?: string;
3540
+ }, signUpOptions?: {
3541
+ customClaims?: Record<string, any>;
3542
+ templateId?: string;
3543
+ templateOptions?: {
3544
+ [x: string]: string;
3545
+ };
3546
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3547
+ maskedEmail: string;
3548
+ }>>;
3549
+ };
3550
+ signUpOrIn: {
3551
+ sms: (loginId: string, URI?: string, signUpOptions?: {
3552
+ customClaims?: Record<string, any>;
3553
+ templateId?: string;
3554
+ templateOptions?: {
3555
+ [x: string]: string;
3556
+ };
3557
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3558
+ maskedPhone: string;
3559
+ }>>;
3560
+ voice: (loginId: string, URI?: string, signUpOptions?: {
3561
+ customClaims?: Record<string, any>;
3562
+ templateId?: string;
3563
+ templateOptions?: {
3564
+ [x: string]: string;
3565
+ };
3566
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3567
+ maskedPhone: string;
3568
+ }>>;
3569
+ whatsapp: (loginId: string, URI?: string, signUpOptions?: {
3570
+ customClaims?: Record<string, any>;
3571
+ templateId?: string;
3572
+ templateOptions?: {
3573
+ [x: string]: string;
3574
+ };
3575
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3576
+ maskedPhone: string;
3577
+ }>>;
3578
+ email: (loginId: string, URI?: string, signUpOptions?: {
3579
+ customClaims?: Record<string, any>;
3580
+ templateId?: string;
3581
+ templateOptions?: {
3582
+ [x: string]: string;
3583
+ };
3584
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3585
+ maskedEmail: string;
3586
+ }>>;
3587
+ };
3588
+ update: {
3589
+ email: <T_2 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
3590
+ addToLoginIDs?: T_2;
3591
+ onMergeUseExisting?: T_2 extends true ? boolean : never;
3592
+ templateOptions?: {
3593
+ [x: string]: string;
3594
+ };
3595
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3596
+ maskedEmail: string;
3597
+ }>>;
3598
+ phone: {
3599
+ sms: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
3600
+ addToLoginIDs?: T_3;
3601
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
3602
+ templateOptions?: {
3603
+ [x: string]: string;
3604
+ };
3605
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3606
+ maskedPhone: string;
3607
+ }>>;
3608
+ voice: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
3609
+ addToLoginIDs?: T_3;
3610
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
3611
+ templateOptions?: {
3612
+ [x: string]: string;
3613
+ };
3614
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3615
+ maskedPhone: string;
3616
+ }>>;
3617
+ whatsapp: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
3618
+ addToLoginIDs?: T_3;
3619
+ onMergeUseExisting?: T_3 extends true ? boolean : never;
3620
+ templateOptions?: {
3621
+ [x: string]: string;
3622
+ };
3623
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3624
+ maskedPhone: string;
3625
+ }>>;
3626
+ };
3627
+ };
3628
+ };
3629
+ enchantedLink: {
3630
+ verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
3631
+ signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
3632
+ signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
3633
+ customClaims?: Record<string, any>;
3634
+ templateId?: string;
3635
+ templateOptions?: {
3636
+ [x: string]: string;
3637
+ };
3638
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
3639
+ signUp: (loginId: string, URI?: string, user?: {
3640
+ email?: string;
3641
+ name?: string;
3642
+ givenName?: string;
3643
+ middleName?: string;
3644
+ familyName?: string;
3645
+ phone?: string;
3646
+ }, signUpOptions?: {
3647
+ customClaims?: Record<string, any>;
3648
+ templateId?: string;
3649
+ templateOptions?: {
3650
+ [x: string]: string;
3651
+ };
3652
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
3653
+ waitForSession: (pendingRef: string, config?: {
3654
+ pollingIntervalMs: number;
3655
+ timeoutMs: number;
3656
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3657
+ update: {
3658
+ email: <T_4 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
3659
+ addToLoginIDs?: T_4;
3660
+ onMergeUseExisting?: T_4 extends true ? boolean : never;
3661
+ templateOptions?: {
3662
+ [x: string]: string;
3663
+ };
3664
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
3665
+ };
3666
+ };
3667
+ oauth: {
3668
+ start: ((provider: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
3669
+ google: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3670
+ facebook: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3671
+ github: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3672
+ microsoft: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3673
+ gitlab: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3674
+ apple: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3675
+ discord: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3676
+ linkedin: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3677
+ slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3678
+ };
3679
+ exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3680
+ startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
3681
+ finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
3682
+ };
3683
+ saml: {
3684
+ start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, ssoId?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
3685
+ exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3686
+ };
3687
+ totp: {
3688
+ signUp: (loginId: string, user?: {
3689
+ email?: string;
3690
+ name?: string;
3691
+ givenName?: string;
3692
+ middleName?: string;
3693
+ familyName?: string;
3694
+ phone?: string;
3695
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
3696
+ verify: (loginId: string, code: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3697
+ update: (loginId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
3698
+ };
3699
+ notp: {
3700
+ signUpOrIn: (loginId?: string, signUpOptions?: {
3701
+ customClaims?: Record<string, any>;
3702
+ templateId?: string;
3703
+ templateOptions?: {
3704
+ [x: string]: string;
3705
+ };
3706
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3707
+ pendingRef: string;
3708
+ redirectUrl: string;
3709
+ image: string;
3710
+ }>>;
3711
+ signUp: (loginId?: string, user?: {
3712
+ email?: string;
3713
+ name?: string;
3714
+ givenName?: string;
3715
+ middleName?: string;
3716
+ familyName?: string;
3717
+ phone?: string;
3718
+ }, signUpOptions?: {
3719
+ customClaims?: Record<string, any>;
3720
+ templateId?: string;
3721
+ templateOptions?: {
3722
+ [x: string]: string;
3723
+ };
3724
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3725
+ pendingRef: string;
3726
+ redirectUrl: string;
3727
+ image: string;
3728
+ }>>;
3729
+ signIn: (loginId?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3730
+ pendingRef: string;
3731
+ redirectUrl: string;
3732
+ image: string;
3733
+ }>>;
3734
+ waitForSession: (pendingRef: string, config?: {
3735
+ pollingIntervalMs: number;
3736
+ timeoutMs: number;
3737
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3738
+ };
3739
+ password: {
3740
+ signUp: (loginId: string, password: string, user?: {
3741
+ email?: string;
3742
+ name?: string;
3743
+ givenName?: string;
3744
+ middleName?: string;
3745
+ familyName?: string;
3746
+ phone?: string;
3747
+ }, signUpOptions?: {
3748
+ customClaims?: Record<string, any>;
3749
+ templateId?: string;
3750
+ templateOptions?: {
3751
+ [x: string]: string;
3752
+ };
3753
+ }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3754
+ signIn: (loginId: string, password: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3755
+ sendReset: (loginId: string, redirectUrl?: string, templateOptions?: {
3756
+ [x: string]: string;
3757
+ }) => Promise<_descope_core_js_sdk.SdkResponse<{
3758
+ resetMethod: string;
3759
+ pendingRef?: string;
3760
+ linkId?: string;
3761
+ maskedEmail: string;
3762
+ }>>;
3763
+ update: (loginId: string, newPassword: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
3764
+ replace: (loginId: string, oldPassword: string, newPassword: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3765
+ policy: () => Promise<_descope_core_js_sdk.SdkResponse<{
3766
+ minLength: number;
3767
+ lowercase: boolean;
3768
+ uppercase: boolean;
3769
+ number: boolean;
3770
+ nonAlphanumeric: boolean;
3771
+ }>>;
3772
+ };
3773
+ selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3774
+ logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
3775
+ me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
3776
+ myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3777
+ tenants: {
3778
+ id: string;
3779
+ name: string;
3780
+ customAttributes?: Record<string, any>;
3781
+ }[];
3782
+ }>>;
3783
+ history: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserHistoryResponse>>;
3784
+ isJwtExpired: (token: string) => boolean;
3785
+ getTenants: (token: string) => string[];
3786
+ getJwtPermissions: (token: string, tenant?: string) => string[];
3787
+ getJwtRoles: (token: string, tenant?: string) => string[];
3788
+ getCurrentTenant: (token: string) => string;
3789
+ httpClient: {
3790
+ get: (path: string, config?: {
3791
+ headers?: HeadersInit;
3792
+ queryParams?: {
3793
+ [key: string]: string;
3794
+ };
3795
+ token?: string;
3796
+ }) => Promise<Response>;
3797
+ post: (path: string, body?: any, config?: {
3798
+ headers?: HeadersInit;
3799
+ queryParams?: {
3800
+ [key: string]: string;
3801
+ };
3802
+ token?: string;
3803
+ }) => Promise<Response>;
3804
+ patch: (path: string, body?: any, config?: {
3805
+ headers?: HeadersInit;
3806
+ queryParams?: {
3807
+ [key: string]: string;
3808
+ };
3809
+ token?: string;
3810
+ }) => Promise<Response>;
3811
+ put: (path: string, body?: any, config?: {
3812
+ headers?: HeadersInit;
3813
+ queryParams?: {
3814
+ [key: string]: string;
3815
+ };
3816
+ token?: string;
3817
+ }) => Promise<Response>;
3818
+ delete: (path: string, config?: {
3819
+ headers?: HeadersInit;
3820
+ queryParams?: {
3821
+ [key: string]: string;
3822
+ };
3823
+ token?: string;
3824
+ }) => Promise<Response>;
3825
+ hooks?: {
3826
+ beforeRequest?: (config: _descope_core_js_sdk.RequestConfig) => _descope_core_js_sdk.RequestConfig;
3827
+ afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
3828
+ transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
3829
+ };
3830
+ buildUrl: (path: string, queryParams?: {
3831
+ [key: string]: string;
3832
+ }) => string;
3833
+ };
3834
+ }) & {
3835
+ onSessionTokenChange: (cb: (data: string) => void) => () => any[];
3836
+ onUserChange: (cb: (data: _descope_core_js_sdk.UserResponse) => void) => () => any[];
3837
+ onIsAuthenticatedChange: (cb: (isAuthenticated: boolean) => void) => () => any[];
3838
+ }) & {
3839
+ getLastUserLoginId: () => string;
3840
+ getLastUserDisplayName: () => string;
3841
+ }) & {
3842
+ getRefreshToken: () => string;
3843
+ getSessionToken: () => string;
3844
+ getIdToken: () => string;
3845
+ };
3846
+
3847
+ export { type CookieConfig, type OidcConfig, type OneTapConfig, REFRESH_TOKEN_KEY, SESSION_TOKEN_KEY, clearFingerprintData, decoratedCreateSdk as default, ensureFingerprintIds, hasOidcParamsInUrl };