@descope/web-js-sdk 1.20.0 → 1.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -646,7 +646,6 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
646
646
  selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
647
647
  logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
648
648
  logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
649
- logoutPrevious: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
650
649
  me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
651
650
  myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
652
651
  tenants: {
@@ -1253,7 +1252,6 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
1253
1252
  selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1254
1253
  logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1255
1254
  logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1256
- logoutPrevious: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1257
1255
  me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
1258
1256
  myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1259
1257
  tenants: {
@@ -1312,1230 +1310,16 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
1312
1310
  [key: string]: string;
1313
1311
  }) => string;
1314
1312
  };
1315
- } | {
1316
- refresh: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1317
- flow: {
1318
- start: (flowId: string, options?: Pick<{
1319
- redirectUrl?: string;
1320
- location?: string;
1321
- tenant?: string;
1322
- deviceInfo?: {
1323
- webAuthnSupport?: boolean;
1324
- };
1325
- lastAuth?: {
1326
- authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
1327
- oauthProvider?: string;
1328
- name?: string;
1329
- loginId?: string;
1330
- };
1331
- redirectAuth?: {
1332
- callbackUrl: string;
1333
- codeChallenge: string;
1334
- };
1335
- oidcIdpStateId?: string;
1336
- preview?: boolean;
1337
- samlIdpStateId?: string;
1338
- samlIdpUsername?: string;
1339
- ssoAppId?: string;
1340
- oidcLoginHint?: string;
1341
- abTestingKey?: number;
1342
- startOptionsVersion?: number;
1343
- client?: Record<string, any>;
1344
- locale?: string;
1345
- oidcPrompt?: string;
1346
- oidcErrorRedirectUri?: string;
1347
- nativeOptions?: {
1348
- platform: "ios" | "android";
1349
- oauthProvider?: string;
1350
- oauthRedirect?: string;
1351
- };
1352
- }, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "nativeOptions"> & {
1353
- lastAuth?: Omit<{
1354
- authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
1355
- oauthProvider?: string;
1356
- name?: string;
1357
- loginId?: string;
1358
- }, "loginId" | "name">;
1359
- }, conditionInteractionId?: string, interactionId?: string, componentsVersion?: string, flowVersions?: Record<string, number>, input?: {
1360
- [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)[])[])[])[])[])[])[])[])[])[])[];
1361
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
1362
- next: (executionId: string, stepId: string, interactionId: string, version?: number, componentsVersion?: string, input?: {
1363
- [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)[])[])[])[])[])[])[])[])[])[])[];
1364
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
1365
- };
1366
- webauthn: {
1367
- signUp: ((identifier: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
1368
- start: (loginId: string, origin: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
1369
- transactionId: string;
1370
- options: string;
1371
- create: boolean;
1372
- }>>;
1373
- finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1374
- };
1375
- signIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
1376
- 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<{
1377
- transactionId: string;
1378
- options: string;
1379
- create: boolean;
1380
- }>>;
1381
- finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1382
- };
1383
- signUpOrIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
1384
- start: (loginId: string, origin: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
1385
- transactionId: string;
1386
- options: string;
1387
- create: boolean;
1388
- }>>;
1389
- };
1390
- update: ((identifier: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
1391
- start: (loginId: string, origin: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
1392
- transactionId: string;
1393
- options: string;
1394
- create: boolean;
1395
- }>>;
1396
- finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
1397
- };
1398
- helpers: {
1399
- create: (options: string) => Promise<string>;
1400
- get: (options: string) => Promise<string>;
1401
- isSupported: typeof isSupported;
1402
- conditional: (options: string, abort: AbortController) => Promise<string>;
1403
- };
1404
- };
1405
- fedcm: {
1406
- oneTap(provider?: string, oneTapConfig?: OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
1407
- launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1408
- isSupported(): boolean;
1409
- };
1410
- accessKey: {
1411
- exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
1412
- };
1413
- otp: {
1414
- verify: {
1415
- sms: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1416
- voice: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1417
- whatsapp: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1418
- email: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1419
- };
1420
- signIn: {
1421
- sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1422
- maskedPhone: string;
1423
- }>>;
1424
- voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1425
- maskedPhone: string;
1426
- }>>;
1427
- whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1428
- maskedPhone: string;
1429
- }>>;
1430
- email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1431
- maskedEmail: string;
1432
- }>>;
1433
- };
1434
- signUp: {
1435
- sms: (loginId: string, user?: {
1436
- email?: string;
1437
- name?: string;
1438
- givenName?: string;
1439
- middleName?: string;
1440
- familyName?: string;
1441
- phone?: string;
1442
- }, signUpOptions?: {
1443
- customClaims?: Record<string, any>;
1444
- templateId?: string;
1445
- templateOptions?: {
1446
- [x: string]: string;
1447
- };
1448
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1449
- maskedPhone: string;
1450
- }>>;
1451
- voice: (loginId: string, user?: {
1452
- email?: string;
1453
- name?: string;
1454
- givenName?: string;
1455
- middleName?: string;
1456
- familyName?: string;
1457
- phone?: string;
1458
- }, signUpOptions?: {
1459
- customClaims?: Record<string, any>;
1460
- templateId?: string;
1461
- templateOptions?: {
1462
- [x: string]: string;
1463
- };
1464
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1465
- maskedPhone: string;
1466
- }>>;
1467
- whatsapp: (loginId: string, user?: {
1468
- email?: string;
1469
- name?: string;
1470
- givenName?: string;
1471
- middleName?: string;
1472
- familyName?: string;
1473
- phone?: string;
1474
- }, signUpOptions?: {
1475
- customClaims?: Record<string, any>;
1476
- templateId?: string;
1477
- templateOptions?: {
1478
- [x: string]: string;
1479
- };
1480
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1481
- maskedPhone: string;
1482
- }>>;
1483
- email: (loginId: string, user?: {
1484
- email?: string;
1485
- name?: string;
1486
- givenName?: string;
1487
- middleName?: string;
1488
- familyName?: string;
1489
- phone?: string;
1490
- }, signUpOptions?: {
1491
- customClaims?: Record<string, any>;
1492
- templateId?: string;
1493
- templateOptions?: {
1494
- [x: string]: string;
1495
- };
1496
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1497
- maskedEmail: string;
1498
- }>>;
1499
- };
1500
- signUpOrIn: {
1501
- sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1502
- maskedPhone: string;
1503
- }>>;
1504
- voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1505
- maskedPhone: string;
1506
- }>>;
1507
- whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1508
- maskedPhone: string;
1509
- }>>;
1510
- email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1511
- maskedEmail: string;
1512
- }>>;
1513
- };
1514
- update: {
1515
- email: <T extends boolean>(loginId: string, email: string, token?: string, updateOptions?: {
1516
- addToLoginIDs?: T;
1517
- onMergeUseExisting?: T extends true ? boolean : never;
1518
- templateOptions?: {
1519
- [x: string]: string;
1520
- };
1521
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1522
- maskedEmail: string;
1523
- }>>;
1524
- phone: {
1525
- sms: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
1526
- addToLoginIDs?: T_1;
1527
- onMergeUseExisting?: T_1 extends true ? boolean : never;
1528
- templateOptions?: {
1529
- [x: string]: string;
1530
- };
1531
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1532
- maskedPhone: string;
1533
- }>>;
1534
- voice: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
1535
- addToLoginIDs?: T_1;
1536
- onMergeUseExisting?: T_1 extends true ? boolean : never;
1537
- templateOptions?: {
1538
- [x: string]: string;
1539
- };
1540
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1541
- maskedPhone: string;
1542
- }>>;
1543
- whatsapp: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
1544
- addToLoginIDs?: T_1;
1545
- onMergeUseExisting?: T_1 extends true ? boolean : never;
1546
- templateOptions?: {
1547
- [x: string]: string;
1548
- };
1549
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1550
- maskedPhone: string;
1551
- }>>;
1552
- };
1553
- };
1554
- };
1555
- magicLink: {
1556
- verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1557
- signIn: {
1558
- sms: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1559
- maskedPhone: string;
1560
- }>>;
1561
- voice: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1562
- maskedPhone: string;
1563
- }>>;
1564
- whatsapp: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1565
- maskedPhone: string;
1566
- }>>;
1567
- email: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1568
- maskedEmail: string;
1569
- }>>;
1570
- };
1571
- signUp: {
1572
- sms: (loginId: string, URI: string, user?: {
1573
- email?: string;
1574
- name?: string;
1575
- givenName?: string;
1576
- middleName?: string;
1577
- familyName?: string;
1578
- phone?: string;
1579
- }, signUpOptions?: {
1580
- customClaims?: Record<string, any>;
1581
- templateId?: string;
1582
- templateOptions?: {
1583
- [x: string]: string;
1584
- };
1585
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1586
- maskedPhone: string;
1587
- }>>;
1588
- voice: (loginId: string, URI: string, user?: {
1589
- email?: string;
1590
- name?: string;
1591
- givenName?: string;
1592
- middleName?: string;
1593
- familyName?: string;
1594
- phone?: string;
1595
- }, signUpOptions?: {
1596
- customClaims?: Record<string, any>;
1597
- templateId?: string;
1598
- templateOptions?: {
1599
- [x: string]: string;
1600
- };
1601
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1602
- maskedPhone: string;
1603
- }>>;
1604
- whatsapp: (loginId: string, URI: string, user?: {
1605
- email?: string;
1606
- name?: string;
1607
- givenName?: string;
1608
- middleName?: string;
1609
- familyName?: string;
1610
- phone?: string;
1611
- }, signUpOptions?: {
1612
- customClaims?: Record<string, any>;
1613
- templateId?: string;
1614
- templateOptions?: {
1615
- [x: string]: string;
1616
- };
1617
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1618
- maskedPhone: string;
1619
- }>>;
1620
- email: (loginId: string, URI: string, user?: {
1621
- email?: string;
1622
- name?: string;
1623
- givenName?: string;
1624
- middleName?: string;
1625
- familyName?: string;
1626
- phone?: string;
1627
- }, signUpOptions?: {
1628
- customClaims?: Record<string, any>;
1629
- templateId?: string;
1630
- templateOptions?: {
1631
- [x: string]: string;
1632
- };
1633
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1634
- maskedEmail: string;
1635
- }>>;
1636
- };
1637
- signUpOrIn: {
1638
- sms: (loginId: string, URI?: string, signUpOptions?: {
1639
- customClaims?: Record<string, any>;
1640
- templateId?: string;
1641
- templateOptions?: {
1642
- [x: string]: string;
1643
- };
1644
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1645
- maskedPhone: string;
1646
- }>>;
1647
- voice: (loginId: string, URI?: string, 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, signUpOptions?: {
1657
- customClaims?: Record<string, any>;
1658
- templateId?: string;
1659
- templateOptions?: {
1660
- [x: string]: string;
1661
- };
1662
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1663
- maskedPhone: string;
1664
- }>>;
1665
- email: (loginId: string, URI?: string, signUpOptions?: {
1666
- customClaims?: Record<string, any>;
1667
- templateId?: string;
1668
- templateOptions?: {
1669
- [x: string]: string;
1670
- };
1671
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1672
- maskedEmail: string;
1673
- }>>;
1674
- };
1675
- update: {
1676
- email: <T_2 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
1677
- addToLoginIDs?: T_2;
1678
- onMergeUseExisting?: T_2 extends true ? boolean : never;
1679
- templateOptions?: {
1680
- [x: string]: string;
1681
- };
1682
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1683
- maskedEmail: string;
1684
- }>>;
1685
- phone: {
1686
- sms: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
1687
- addToLoginIDs?: T_3;
1688
- onMergeUseExisting?: T_3 extends true ? boolean : never;
1689
- templateOptions?: {
1690
- [x: string]: string;
1691
- };
1692
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1693
- maskedPhone: string;
1694
- }>>;
1695
- voice: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
1696
- addToLoginIDs?: T_3;
1697
- onMergeUseExisting?: T_3 extends true ? boolean : never;
1698
- templateOptions?: {
1699
- [x: string]: string;
1700
- };
1701
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1702
- maskedPhone: string;
1703
- }>>;
1704
- whatsapp: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
1705
- addToLoginIDs?: T_3;
1706
- onMergeUseExisting?: T_3 extends true ? boolean : never;
1707
- templateOptions?: {
1708
- [x: string]: string;
1709
- };
1710
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1711
- maskedPhone: string;
1712
- }>>;
1713
- };
1714
- };
1715
- };
1716
- enchantedLink: {
1717
- verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1718
- signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1719
- signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
1720
- customClaims?: Record<string, any>;
1721
- templateId?: string;
1722
- templateOptions?: {
1723
- [x: string]: string;
1724
- };
1725
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1726
- signUp: (loginId: string, URI?: string, user?: {
1727
- email?: string;
1728
- name?: string;
1729
- givenName?: string;
1730
- middleName?: string;
1731
- familyName?: string;
1732
- phone?: string;
1733
- }, signUpOptions?: {
1734
- customClaims?: Record<string, any>;
1735
- templateId?: string;
1736
- templateOptions?: {
1737
- [x: string]: string;
1738
- };
1739
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1740
- waitForSession: (pendingRef: string, config?: {
1741
- pollingIntervalMs: number;
1742
- timeoutMs: number;
1743
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1744
- update: {
1745
- email: <T_4 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
1746
- addToLoginIDs?: T_4;
1747
- onMergeUseExisting?: T_4 extends true ? boolean : never;
1748
- templateOptions?: {
1749
- [x: string]: string;
1750
- };
1751
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
1752
- };
1753
- };
1754
- oauth: {
1755
- start: ((provider: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
1756
- google: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1757
- facebook: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1758
- github: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1759
- microsoft: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1760
- gitlab: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1761
- apple: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1762
- discord: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1763
- linkedin: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1764
- slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1765
- };
1766
- exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1767
- startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
1768
- finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
1769
- };
1770
- saml: {
1771
- start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
1772
- exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1773
- };
1774
- totp: {
1775
- signUp: (loginId: string, user?: {
1776
- email?: string;
1777
- name?: string;
1778
- givenName?: string;
1779
- middleName?: string;
1780
- familyName?: string;
1781
- phone?: string;
1782
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
1783
- verify: (loginId: string, code: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1784
- update: (loginId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
1785
- };
1786
- notp: {
1787
- signUpOrIn: (loginId?: string, signUpOptions?: {
1788
- customClaims?: Record<string, any>;
1789
- templateId?: string;
1790
- templateOptions?: {
1791
- [x: string]: string;
1792
- };
1793
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1794
- pendingRef: string;
1795
- redirectUrl: string;
1796
- image: string;
1797
- }>>;
1798
- signUp: (loginId?: string, user?: {
1799
- email?: string;
1800
- name?: string;
1801
- givenName?: string;
1802
- middleName?: string;
1803
- familyName?: string;
1804
- phone?: string;
1805
- }, signUpOptions?: {
1806
- customClaims?: Record<string, any>;
1807
- templateId?: string;
1808
- templateOptions?: {
1809
- [x: string]: string;
1810
- };
1811
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1812
- pendingRef: string;
1813
- redirectUrl: string;
1814
- image: string;
1815
- }>>;
1816
- signIn: (loginId?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1817
- pendingRef: string;
1818
- redirectUrl: string;
1819
- image: string;
1820
- }>>;
1821
- waitForSession: (pendingRef: string, config?: {
1822
- pollingIntervalMs: number;
1823
- timeoutMs: number;
1824
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1825
- };
1826
- password: {
1827
- signUp: (loginId: string, password: string, user?: {
1828
- email?: string;
1829
- name?: string;
1830
- givenName?: string;
1831
- middleName?: string;
1832
- familyName?: string;
1833
- phone?: string;
1834
- }, signUpOptions?: {
1835
- customClaims?: Record<string, any>;
1836
- templateId?: string;
1837
- templateOptions?: {
1838
- [x: string]: string;
1839
- };
1840
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1841
- signIn: (loginId: string, password: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1842
- sendReset: (loginId: string, redirectUrl?: string, templateOptions?: {
1843
- [x: string]: string;
1844
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
1845
- resetMethod: string;
1846
- pendingRef?: string;
1847
- linkId?: string;
1848
- maskedEmail: string;
1849
- }>>;
1850
- update: (loginId: string, newPassword: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1851
- replace: (loginId: string, oldPassword: string, newPassword: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1852
- policy: () => Promise<_descope_core_js_sdk.SdkResponse<{
1853
- minLength: number;
1854
- lowercase: boolean;
1855
- uppercase: boolean;
1856
- number: boolean;
1857
- nonAlphanumeric: boolean;
1858
- }>>;
1859
- };
1860
- selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1861
- logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1862
- logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1863
- logoutPrevious: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
1864
- me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
1865
- myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
1866
- tenants: {
1867
- id: string;
1868
- name: string;
1869
- customAttributes?: Record<string, any>;
1870
- }[];
1871
- }>>;
1872
- history: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserHistoryResponse>>;
1873
- isJwtExpired: (token: string) => boolean;
1874
- getTenants: (token: string) => string[];
1875
- getJwtPermissions: (token: string, tenant?: string) => string[];
1876
- getJwtRoles: (token: string, tenant?: string) => string[];
1877
- httpClient: {
1878
- get: (path: string, config?: {
1879
- headers?: HeadersInit;
1880
- queryParams?: {
1881
- [key: string]: string;
1882
- };
1883
- token?: string;
1884
- }) => Promise<Response>;
1885
- post: (path: string, body?: any, config?: {
1886
- headers?: HeadersInit;
1887
- queryParams?: {
1888
- [key: string]: string;
1889
- };
1890
- token?: string;
1891
- }) => Promise<Response>;
1892
- patch: (path: string, body?: any, config?: {
1893
- headers?: HeadersInit;
1894
- queryParams?: {
1895
- [key: string]: string;
1896
- };
1897
- token?: string;
1898
- }) => Promise<Response>;
1899
- put: (path: string, body?: any, config?: {
1900
- headers?: HeadersInit;
1901
- queryParams?: {
1902
- [key: string]: string;
1903
- };
1904
- token?: string;
1905
- }) => Promise<Response>;
1906
- delete: (path: string, config?: {
1907
- headers?: HeadersInit;
1908
- queryParams?: {
1909
- [key: string]: string;
1910
- };
1911
- token?: string;
1912
- }) => Promise<Response>;
1913
- hooks?: {
1914
- beforeRequest?: (config: _descope_core_js_sdk.RequestConfig) => _descope_core_js_sdk.RequestConfig;
1915
- afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
1916
- transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
1917
- };
1918
- buildUrl: (path: string, queryParams?: {
1919
- [key: string]: string;
1920
- }) => string;
1921
- };
1922
- }) & {
1923
- onSessionTokenChange: (cb: (data: string) => void) => () => any[];
1924
- onUserChange: (cb: (data: _descope_core_js_sdk.UserResponse) => void) => () => any[];
1925
- }) & {
1926
- getLastUserLoginId: () => string;
1927
- getLastUserDisplayName: () => string;
1928
- }) & {
1929
- getRefreshToken: () => string;
1930
- getSessionToken: () => string;
1931
- } : (({
1932
- refresh: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1933
- flow: {
1934
- start: (flowId: string, options?: Pick<{
1935
- redirectUrl?: string;
1936
- location?: string;
1937
- tenant?: string;
1938
- deviceInfo?: {
1939
- webAuthnSupport?: boolean;
1940
- };
1941
- lastAuth?: {
1942
- authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
1943
- oauthProvider?: string;
1944
- name?: string;
1945
- loginId?: string;
1946
- };
1947
- redirectAuth?: {
1948
- callbackUrl: string;
1949
- codeChallenge: string;
1950
- };
1951
- oidcIdpStateId?: string;
1952
- preview?: boolean;
1953
- samlIdpStateId?: string;
1954
- samlIdpUsername?: string;
1955
- ssoAppId?: string;
1956
- oidcLoginHint?: string;
1957
- abTestingKey?: number;
1958
- startOptionsVersion?: number;
1959
- client?: Record<string, any>;
1960
- locale?: string;
1961
- oidcPrompt?: string;
1962
- oidcErrorRedirectUri?: string;
1963
- nativeOptions?: {
1964
- platform: "ios" | "android";
1965
- oauthProvider?: string;
1966
- oauthRedirect?: string;
1967
- };
1968
- }, "tenant" | "redirectUrl" | "redirectAuth" | "oidcIdpStateId" | "samlIdpStateId" | "samlIdpUsername" | "ssoAppId" | "oidcLoginHint" | "preview" | "abTestingKey" | "client" | "locale" | "oidcPrompt" | "oidcErrorRedirectUri" | "nativeOptions"> & {
1969
- lastAuth?: Omit<{
1970
- authMethod?: "webauthn" | "otp" | "oauth" | "saml" | "totp" | "magiclink" | "enchantedlink";
1971
- oauthProvider?: string;
1972
- name?: string;
1973
- loginId?: string;
1974
- }, "loginId" | "name">;
1975
- }, conditionInteractionId?: string, interactionId?: string, componentsVersion?: string, flowVersions?: Record<string, number>, input?: {
1976
- [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)[])[])[])[])[])[])[])[])[])[])[];
1977
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
1978
- next: (executionId: string, stepId: string, interactionId: string, version?: number, componentsVersion?: string, input?: {
1979
- [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)[])[])[])[])[])[])[])[])[])[])[];
1980
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.FlowResponse>>;
1981
- };
1982
- webauthn: {
1983
- signUp: ((identifier: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
1984
- start: (loginId: string, origin: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
1985
- transactionId: string;
1986
- options: string;
1987
- create: boolean;
1988
- }>>;
1989
- finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1990
- };
1991
- signIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
1992
- 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<{
1993
- transactionId: string;
1994
- options: string;
1995
- create: boolean;
1996
- }>>;
1997
- finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
1998
- };
1999
- signUpOrIn: ((identifier: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>) & {
2000
- start: (loginId: string, origin: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
2001
- transactionId: string;
2002
- options: string;
2003
- create: boolean;
2004
- }>>;
2005
- };
2006
- update: ((identifier: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
2007
- start: (loginId: string, origin: string, token: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise<_descope_core_js_sdk.SdkResponse<{
2008
- transactionId: string;
2009
- options: string;
2010
- create: boolean;
2011
- }>>;
2012
- finish: (transactionId: string, response: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
2013
- };
2014
- helpers: {
2015
- create: (options: string) => Promise<string>;
2016
- get: (options: string) => Promise<string>;
2017
- isSupported: typeof isSupported;
2018
- conditional: (options: string, abort: AbortController) => Promise<string>;
2019
- };
2020
- };
2021
- fedcm: {
2022
- oneTap(provider?: string, oneTapConfig?: OneTapConfig, loginOptions?: _descope_core_js_sdk.LoginOptions, onSkip?: () => void): Promise<unknown>;
2023
- launch(context?: "signin" | "signup" | "use" | "continue"): Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2024
- isSupported(): boolean;
2025
- };
2026
- accessKey: {
2027
- exchange: (accessKey: string, loginOptions?: _descope_core_js_sdk.AccessKeyLoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ExchangeAccessKeyResponse>>;
2028
- };
2029
- otp: {
2030
- verify: {
2031
- sms: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2032
- voice: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2033
- whatsapp: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2034
- email: (loginId: string, code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2035
- };
2036
- signIn: {
2037
- sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2038
- maskedPhone: string;
2039
- }>>;
2040
- voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2041
- maskedPhone: string;
2042
- }>>;
2043
- whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2044
- maskedPhone: string;
2045
- }>>;
2046
- email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2047
- maskedEmail: string;
2048
- }>>;
2049
- };
2050
- signUp: {
2051
- sms: (loginId: string, user?: {
2052
- email?: string;
2053
- name?: string;
2054
- givenName?: string;
2055
- middleName?: string;
2056
- familyName?: string;
2057
- phone?: string;
2058
- }, signUpOptions?: {
2059
- customClaims?: Record<string, any>;
2060
- templateId?: string;
2061
- templateOptions?: {
2062
- [x: string]: string;
2063
- };
2064
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2065
- maskedPhone: string;
2066
- }>>;
2067
- voice: (loginId: string, user?: {
2068
- email?: string;
2069
- name?: string;
2070
- givenName?: string;
2071
- middleName?: string;
2072
- familyName?: string;
2073
- phone?: string;
2074
- }, signUpOptions?: {
2075
- customClaims?: Record<string, any>;
2076
- templateId?: string;
2077
- templateOptions?: {
2078
- [x: string]: string;
2079
- };
2080
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2081
- maskedPhone: string;
2082
- }>>;
2083
- whatsapp: (loginId: string, user?: {
2084
- email?: string;
2085
- name?: string;
2086
- givenName?: string;
2087
- middleName?: string;
2088
- familyName?: string;
2089
- phone?: string;
2090
- }, signUpOptions?: {
2091
- customClaims?: Record<string, any>;
2092
- templateId?: string;
2093
- templateOptions?: {
2094
- [x: string]: string;
2095
- };
2096
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2097
- maskedPhone: string;
2098
- }>>;
2099
- email: (loginId: string, user?: {
2100
- email?: string;
2101
- name?: string;
2102
- givenName?: string;
2103
- middleName?: string;
2104
- familyName?: string;
2105
- phone?: string;
2106
- }, signUpOptions?: {
2107
- customClaims?: Record<string, any>;
2108
- templateId?: string;
2109
- templateOptions?: {
2110
- [x: string]: string;
2111
- };
2112
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2113
- maskedEmail: string;
2114
- }>>;
2115
- };
2116
- signUpOrIn: {
2117
- sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2118
- maskedPhone: string;
2119
- }>>;
2120
- voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2121
- maskedPhone: string;
2122
- }>>;
2123
- whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2124
- maskedPhone: string;
2125
- }>>;
2126
- email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2127
- maskedEmail: string;
2128
- }>>;
2129
- };
2130
- update: {
2131
- email: <T extends boolean>(loginId: string, email: string, token?: string, updateOptions?: {
2132
- addToLoginIDs?: T;
2133
- onMergeUseExisting?: T extends true ? boolean : never;
2134
- templateOptions?: {
2135
- [x: string]: string;
2136
- };
2137
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2138
- maskedEmail: string;
2139
- }>>;
2140
- phone: {
2141
- sms: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
2142
- addToLoginIDs?: T_1;
2143
- onMergeUseExisting?: T_1 extends true ? boolean : never;
2144
- templateOptions?: {
2145
- [x: string]: string;
2146
- };
2147
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2148
- maskedPhone: string;
2149
- }>>;
2150
- voice: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
2151
- addToLoginIDs?: T_1;
2152
- onMergeUseExisting?: T_1 extends true ? boolean : never;
2153
- templateOptions?: {
2154
- [x: string]: string;
2155
- };
2156
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2157
- maskedPhone: string;
2158
- }>>;
2159
- whatsapp: <T_1 extends boolean>(loginId: string, phone: string, token?: string, updateOptions?: {
2160
- addToLoginIDs?: T_1;
2161
- onMergeUseExisting?: T_1 extends true ? boolean : never;
2162
- templateOptions?: {
2163
- [x: string]: string;
2164
- };
2165
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2166
- maskedPhone: string;
2167
- }>>;
2168
- };
2169
- };
2170
- };
2171
- magicLink: {
2172
- verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2173
- signIn: {
2174
- sms: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2175
- maskedPhone: string;
2176
- }>>;
2177
- voice: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2178
- maskedPhone: string;
2179
- }>>;
2180
- whatsapp: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2181
- maskedPhone: string;
2182
- }>>;
2183
- email: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2184
- maskedEmail: string;
2185
- }>>;
2186
- };
2187
- signUp: {
2188
- sms: (loginId: string, URI: string, user?: {
2189
- email?: string;
2190
- name?: string;
2191
- givenName?: string;
2192
- middleName?: string;
2193
- familyName?: string;
2194
- phone?: string;
2195
- }, signUpOptions?: {
2196
- customClaims?: Record<string, any>;
2197
- templateId?: string;
2198
- templateOptions?: {
2199
- [x: string]: string;
2200
- };
2201
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2202
- maskedPhone: string;
2203
- }>>;
2204
- voice: (loginId: string, URI: string, user?: {
2205
- email?: string;
2206
- name?: string;
2207
- givenName?: string;
2208
- middleName?: string;
2209
- familyName?: string;
2210
- phone?: string;
2211
- }, signUpOptions?: {
2212
- customClaims?: Record<string, any>;
2213
- templateId?: string;
2214
- templateOptions?: {
2215
- [x: string]: string;
2216
- };
2217
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2218
- maskedPhone: string;
2219
- }>>;
2220
- whatsapp: (loginId: string, URI: string, user?: {
2221
- email?: string;
2222
- name?: string;
2223
- givenName?: string;
2224
- middleName?: string;
2225
- familyName?: string;
2226
- phone?: string;
2227
- }, signUpOptions?: {
2228
- customClaims?: Record<string, any>;
2229
- templateId?: string;
2230
- templateOptions?: {
2231
- [x: string]: string;
2232
- };
2233
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2234
- maskedPhone: string;
2235
- }>>;
2236
- email: (loginId: string, URI: string, user?: {
2237
- email?: string;
2238
- name?: string;
2239
- givenName?: string;
2240
- middleName?: string;
2241
- familyName?: string;
2242
- phone?: string;
2243
- }, signUpOptions?: {
2244
- customClaims?: Record<string, any>;
2245
- templateId?: string;
2246
- templateOptions?: {
2247
- [x: string]: string;
2248
- };
2249
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2250
- maskedEmail: string;
2251
- }>>;
2252
- };
2253
- signUpOrIn: {
2254
- sms: (loginId: string, URI?: string, signUpOptions?: {
2255
- customClaims?: Record<string, any>;
2256
- templateId?: string;
2257
- templateOptions?: {
2258
- [x: string]: string;
2259
- };
2260
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2261
- maskedPhone: string;
2262
- }>>;
2263
- voice: (loginId: string, URI?: string, signUpOptions?: {
2264
- customClaims?: Record<string, any>;
2265
- templateId?: string;
2266
- templateOptions?: {
2267
- [x: string]: string;
2268
- };
2269
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2270
- maskedPhone: string;
2271
- }>>;
2272
- whatsapp: (loginId: string, URI?: string, 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
- email: (loginId: string, URI?: string, signUpOptions?: {
2282
- customClaims?: Record<string, any>;
2283
- templateId?: string;
2284
- templateOptions?: {
2285
- [x: string]: string;
2286
- };
2287
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2288
- maskedEmail: string;
2289
- }>>;
2290
- };
2291
- update: {
2292
- email: <T_2 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
2293
- addToLoginIDs?: T_2;
2294
- onMergeUseExisting?: T_2 extends true ? boolean : never;
2295
- templateOptions?: {
2296
- [x: string]: string;
2297
- };
2298
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2299
- maskedEmail: string;
2300
- }>>;
2301
- phone: {
2302
- sms: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
2303
- addToLoginIDs?: T_3;
2304
- onMergeUseExisting?: T_3 extends true ? boolean : never;
2305
- templateOptions?: {
2306
- [x: string]: string;
2307
- };
2308
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2309
- maskedPhone: string;
2310
- }>>;
2311
- voice: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
2312
- addToLoginIDs?: T_3;
2313
- onMergeUseExisting?: T_3 extends true ? boolean : never;
2314
- templateOptions?: {
2315
- [x: string]: string;
2316
- };
2317
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2318
- maskedPhone: string;
2319
- }>>;
2320
- whatsapp: <T_3 extends boolean>(loginId: string, phone: string, URI?: string, token?: string, updateOptions?: {
2321
- addToLoginIDs?: T_3;
2322
- onMergeUseExisting?: T_3 extends true ? boolean : never;
2323
- templateOptions?: {
2324
- [x: string]: string;
2325
- };
2326
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2327
- maskedPhone: string;
2328
- }>>;
2329
- };
2330
- };
2331
- };
2332
- enchantedLink: {
2333
- verify: (token: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
2334
- signIn: (loginId: string, URI?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
2335
- signUpOrIn: (loginId: string, URI?: string, signUpOptions?: {
2336
- customClaims?: Record<string, any>;
2337
- templateId?: string;
2338
- templateOptions?: {
2339
- [x: string]: string;
2340
- };
2341
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
2342
- signUp: (loginId: string, URI?: string, user?: {
2343
- email?: string;
2344
- name?: string;
2345
- givenName?: string;
2346
- middleName?: string;
2347
- familyName?: string;
2348
- phone?: string;
2349
- }, signUpOptions?: {
2350
- customClaims?: Record<string, any>;
2351
- templateId?: string;
2352
- templateOptions?: {
2353
- [x: string]: string;
2354
- };
2355
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
2356
- waitForSession: (pendingRef: string, config?: {
2357
- pollingIntervalMs: number;
2358
- timeoutMs: number;
2359
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2360
- update: {
2361
- email: <T_4 extends boolean>(loginId: string, email: string, URI?: string, token?: string, updateOptions?: {
2362
- addToLoginIDs?: T_4;
2363
- onMergeUseExisting?: T_4 extends true ? boolean : never;
2364
- templateOptions?: {
2365
- [x: string]: string;
2366
- };
2367
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
2368
- };
2369
- };
2370
- oauth: {
2371
- start: ((provider: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>) & {
2372
- google: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2373
- facebook: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2374
- github: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2375
- microsoft: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2376
- gitlab: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2377
- apple: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2378
- discord: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2379
- linkedin: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2380
- slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2381
- };
2382
- exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2383
- startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
2384
- finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.ResponseData>>;
2385
- };
2386
- saml: {
2387
- start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.URLResponse>>;
2388
- exchange: (code: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2389
- };
2390
- totp: {
2391
- signUp: (loginId: string, user?: {
2392
- email?: string;
2393
- name?: string;
2394
- givenName?: string;
2395
- middleName?: string;
2396
- familyName?: string;
2397
- phone?: string;
2398
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
2399
- verify: (loginId: string, code: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2400
- update: (loginId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.TOTPResponse>>;
2401
- };
2402
- notp: {
2403
- signUpOrIn: (loginId?: string, signUpOptions?: {
2404
- customClaims?: Record<string, any>;
2405
- templateId?: string;
2406
- templateOptions?: {
2407
- [x: string]: string;
2408
- };
2409
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2410
- pendingRef: string;
2411
- redirectUrl: string;
2412
- image: string;
2413
- }>>;
2414
- signUp: (loginId?: string, user?: {
2415
- email?: string;
2416
- name?: string;
2417
- givenName?: string;
2418
- middleName?: string;
2419
- familyName?: string;
2420
- phone?: string;
2421
- }, signUpOptions?: {
2422
- customClaims?: Record<string, any>;
2423
- templateId?: string;
2424
- templateOptions?: {
2425
- [x: string]: string;
2426
- };
2427
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2428
- pendingRef: string;
2429
- redirectUrl: string;
2430
- image: string;
2431
- }>>;
2432
- signIn: (loginId?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2433
- pendingRef: string;
2434
- redirectUrl: string;
2435
- image: string;
2436
- }>>;
2437
- waitForSession: (pendingRef: string, config?: {
2438
- pollingIntervalMs: number;
2439
- timeoutMs: number;
2440
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2441
- };
2442
- password: {
2443
- signUp: (loginId: string, password: string, user?: {
2444
- email?: string;
2445
- name?: string;
2446
- givenName?: string;
2447
- middleName?: string;
2448
- familyName?: string;
2449
- phone?: string;
2450
- }, signUpOptions?: {
2451
- customClaims?: Record<string, any>;
2452
- templateId?: string;
2453
- templateOptions?: {
2454
- [x: string]: string;
2455
- };
2456
- }) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2457
- signIn: (loginId: string, password: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2458
- sendReset: (loginId: string, redirectUrl?: string, templateOptions?: {
2459
- [x: string]: string;
2460
- }) => Promise<_descope_core_js_sdk.SdkResponse<{
2461
- resetMethod: string;
2462
- pendingRef?: string;
2463
- linkId?: string;
2464
- maskedEmail: string;
2465
- }>>;
2466
- update: (loginId: string, newPassword: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
2467
- replace: (loginId: string, oldPassword: string, newPassword: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2468
- policy: () => Promise<_descope_core_js_sdk.SdkResponse<{
2469
- minLength: number;
2470
- lowercase: boolean;
2471
- uppercase: boolean;
2472
- number: boolean;
2473
- nonAlphanumeric: boolean;
2474
- }>>;
2475
- };
2476
- selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2477
- logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
2478
- logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
2479
- logoutPrevious: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
2480
- me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
2481
- myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
2482
- tenants: {
2483
- id: string;
2484
- name: string;
2485
- customAttributes?: Record<string, any>;
2486
- }[];
2487
- }>>;
2488
- history: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserHistoryResponse>>;
2489
- isJwtExpired: (token: string) => boolean;
2490
- getTenants: (token: string) => string[];
2491
- getJwtPermissions: (token: string, tenant?: string) => string[];
2492
- getJwtRoles: (token: string, tenant?: string) => string[];
2493
- httpClient: {
2494
- get: (path: string, config?: {
2495
- headers?: HeadersInit;
2496
- queryParams?: {
2497
- [key: string]: string;
2498
- };
2499
- token?: string;
2500
- }) => Promise<Response>;
2501
- post: (path: string, body?: any, config?: {
2502
- headers?: HeadersInit;
2503
- queryParams?: {
2504
- [key: string]: string;
2505
- };
2506
- token?: string;
2507
- }) => Promise<Response>;
2508
- patch: (path: string, body?: any, config?: {
2509
- headers?: HeadersInit;
2510
- queryParams?: {
2511
- [key: string]: string;
2512
- };
2513
- token?: string;
2514
- }) => Promise<Response>;
2515
- put: (path: string, body?: any, config?: {
2516
- headers?: HeadersInit;
2517
- queryParams?: {
2518
- [key: string]: string;
2519
- };
2520
- token?: string;
2521
- }) => Promise<Response>;
2522
- delete: (path: string, config?: {
2523
- headers?: HeadersInit;
2524
- queryParams?: {
2525
- [key: string]: string;
2526
- };
2527
- token?: string;
2528
- }) => Promise<Response>;
2529
- hooks?: {
2530
- beforeRequest?: (config: _descope_core_js_sdk.RequestConfig) => _descope_core_js_sdk.RequestConfig;
2531
- afterRequest?: (req: _descope_core_js_sdk.RequestConfig, res: Response) => void | Promise<void>;
2532
- transformResponse?: (mutableResponse: _descope_core_js_sdk.ExtendedResponse) => Promise<_descope_core_js_sdk.ExtendedResponse>;
2533
- };
2534
- buildUrl: (path: string, queryParams?: {
2535
- [key: string]: string;
2536
- }) => string;
2537
- };
2538
- } | {
1313
+ }) & {
1314
+ onSessionTokenChange: (cb: (data: string) => void) => () => any[];
1315
+ onUserChange: (cb: (data: _descope_core_js_sdk.UserResponse) => void) => () => any[];
1316
+ }) & {
1317
+ getLastUserLoginId: () => string;
1318
+ getLastUserDisplayName: () => string;
1319
+ }) & {
1320
+ getRefreshToken: () => string;
1321
+ getSessionToken: () => string;
1322
+ } : (({
2539
1323
  refresh: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
2540
1324
  flow: {
2541
1325
  start: (flowId: string, options?: Pick<{
@@ -3083,7 +1867,6 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
3083
1867
  selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3084
1868
  logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
3085
1869
  logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
3086
- logoutPrevious: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
3087
1870
  me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
3088
1871
  myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3089
1872
  tenants: {
@@ -3690,7 +2473,6 @@ declare const decoratedCreateSdk: <A extends boolean>({ persistTokens: isPersist
3690
2473
  selectTenant: (tenantId: string, token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.JWTResponse>>;
3691
2474
  logout: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
3692
2475
  logoutAll: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
3693
- logoutPrevious: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<never>>;
3694
2476
  me: (token?: string) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.UserResponse>>;
3695
2477
  myTenants: (tenants: true | string[], token?: string) => Promise<_descope_core_js_sdk.SdkResponse<{
3696
2478
  tenants: {