@stytch/vanilla-js 2.0.3 → 2.0.4

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.
@@ -1197,15 +1197,15 @@ var V = ["[Stytch]"],
1197
1197
  pkceRequiredForEmailMagicLinks: !1
1198
1198
  }),
1199
1199
  ae = function () {
1200
- function e(t, r, n) {
1201
- var i = this,
1202
- o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : oe,
1203
- a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : function () {
1200
+ function e(t, r, n, i) {
1201
+ var o = this,
1202
+ a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : oe,
1203
+ u = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : function () {
1204
1204
  return Promise.resolve(void 0);
1205
1205
  },
1206
- u = arguments.length > 5 ? arguments[5] : void 0;
1207
- c(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._config = o, this.executeRecaptcha = a, this._dfpProtectedAuth = u, this.retryWithCaptchaAndDFP = function (e, t) {
1208
- return k(i, void 0, void 0, s().mark(function r() {
1206
+ l = arguments.length > 6 ? arguments[6] : void 0;
1207
+ c(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._passwordResetPKCEManager = i, this._config = a, this.executeRecaptcha = u, this._dfpProtectedAuth = l, this.retryWithCaptchaAndDFP = function (e, t) {
1208
+ return k(o, void 0, void 0, s().mark(function r() {
1209
1209
  var n, i;
1210
1210
  return s().wrap(function (r) {
1211
1211
  for (;;) switch (r.prev = r.next) {
@@ -1244,7 +1244,7 @@ var V = ["[Stytch]"],
1244
1244
  }, this.email = {
1245
1245
  loginOrCreate: function loginOrCreate(e) {
1246
1246
  var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
1247
- return k(i, void 0, void 0, s().mark(function r() {
1247
+ return k(o, void 0, void 0, s().mark(function r() {
1248
1248
  var n, i, o, a, c, u, l;
1249
1249
  return s().wrap(function (r) {
1250
1250
  for (;;) switch (r.prev = r.next) {
@@ -1282,7 +1282,7 @@ var V = ["[Stytch]"],
1282
1282
  },
1283
1283
  send: function send(e) {
1284
1284
  var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
1285
- return k(i, void 0, void 0, s().mark(function r() {
1285
+ return k(o, void 0, void 0, s().mark(function r() {
1286
1286
  var n, i, o, a, c, u, l, d, h;
1287
1287
  return s().wrap(function (r) {
1288
1288
  for (;;) switch (r.prev = r.next) {
@@ -1319,37 +1319,57 @@ var V = ["[Stytch]"],
1319
1319
  }));
1320
1320
  }
1321
1321
  }, this.authenticate = function (e, t) {
1322
- return k(i, void 0, void 0, s().mark(function r() {
1323
- var n, i, o;
1322
+ return k(o, void 0, void 0, s().mark(function r() {
1323
+ var n, i;
1324
1324
  return s().wrap(function (r) {
1325
1325
  for (;;) switch (r.prev = r.next) {
1326
1326
  case 0:
1327
- return Z("stytch.magicLinks.authenticate").isString("Token", e).isNumber("session_duration_minutes", t.session_duration_minutes), r.next = 3, this._pkceManager.getPKPair();
1327
+ return Z("stytch.magicLinks.authenticate").isString("Token", e).isNumber("session_duration_minutes", t.session_duration_minutes), r.next = 3, this._passwordResetPKCEManager.getPKPair();
1328
1328
  case 3:
1329
- return n = r.sent, i = Object.assign({
1330
- token: e,
1331
- code_verifier: null == n ? void 0 : n.code_verifier
1332
- }, t), r.next = 7, this._networkClient.fetchSDK({
1333
- url: "/magic_links/authenticate",
1334
- body: i,
1335
- errorMessage: "Failed to authenticate token.",
1336
- method: "POST"
1337
- });
1338
- case 7:
1339
- return o = r.sent, this._pkceManager.clearPKPair(), this._subscriptionService.updateStateAndTokens({
1329
+ if (n = r.sent, i = null, !(null == n ? void 0 : n.code_verifier)) {
1330
+ r.next = 19;
1331
+ break;
1332
+ }
1333
+ return r.prev = 6, r.next = 9, this.handlePKCEForAuthenticate(this._passwordResetPKCEManager, Object.assign(Object.assign({}, t), {
1334
+ token: e
1335
+ }));
1336
+ case 9:
1337
+ i = r.sent, r.next = 19;
1338
+ break;
1339
+ case 12:
1340
+ if (r.prev = 12, r.t0 = r["catch"](6), !r.t0.message.includes("pkce")) {
1341
+ r.next = 18;
1342
+ break;
1343
+ }
1344
+ console.log("Authenticate with passwords pkce namespace failed. Falling back to authenticate with magic_links namespace."), r.next = 19;
1345
+ break;
1346
+ case 18:
1347
+ throw r.t0;
1348
+ case 19:
1349
+ if (i) {
1350
+ r.next = 23;
1351
+ break;
1352
+ }
1353
+ return r.next = 22, this.handlePKCEForAuthenticate(this._pkceManager, Object.assign(Object.assign({}, t), {
1354
+ token: e
1355
+ }));
1356
+ case 22:
1357
+ i = r.sent;
1358
+ case 23:
1359
+ return this._subscriptionService.updateStateAndTokens({
1340
1360
  state: {
1341
- session: o.session,
1342
- user: o.user
1361
+ session: i.session,
1362
+ user: i.user
1343
1363
  },
1344
- session_token: o.session_token,
1345
- session_jwt: o.session_jwt,
1364
+ session_token: i.session_token,
1365
+ session_jwt: i.session_jwt,
1346
1366
  intermediate_session_token: null
1347
- }), r.abrupt("return", ee(o));
1348
- case 11:
1367
+ }), r.abrupt("return", ee(i));
1368
+ case 25:
1349
1369
  case "end":
1350
1370
  return r.stop();
1351
1371
  }
1352
- }, r, this);
1372
+ }, r, this, [[6, 12]]);
1353
1373
  }));
1354
1374
  };
1355
1375
  }
@@ -1419,6 +1439,33 @@ var V = ["[Stytch]"],
1419
1439
  }, e, this);
1420
1440
  }));
1421
1441
  }
1442
+ }, {
1443
+ key: "handlePKCEForAuthenticate",
1444
+ value: function value(e, t) {
1445
+ return k(this, void 0, void 0, s().mark(function r() {
1446
+ var n, i, o;
1447
+ return s().wrap(function (r) {
1448
+ for (;;) switch (r.prev = r.next) {
1449
+ case 0:
1450
+ return r.next = 2, e.getPKPair();
1451
+ case 2:
1452
+ return n = r.sent, i = Object.assign({
1453
+ code_verifier: null == n ? void 0 : n.code_verifier
1454
+ }, t), r.next = 6, this._networkClient.fetchSDK({
1455
+ url: "/magic_links/authenticate",
1456
+ body: i,
1457
+ errorMessage: "Failed to authenticate token.",
1458
+ method: "POST"
1459
+ });
1460
+ case 6:
1461
+ return o = r.sent, e.clearPKPair(), r.abrupt("return", o);
1462
+ case 9:
1463
+ case "end":
1464
+ return r.stop();
1465
+ }
1466
+ }, r, this);
1467
+ }));
1468
+ }
1422
1469
  }]), e;
1423
1470
  }(),
1424
1471
  ce = a(function e(t, r) {
@@ -3339,7 +3386,7 @@ var kt = /*#__PURE__*/function () {
3339
3386
  },
3340
3387
  sdk: {
3341
3388
  identifier: "Stytch.js Javascript SDK",
3342
- version: "2.0.3"
3389
+ version: "2.0.4"
3343
3390
  }
3344
3391
  });
3345
3392
  }
@@ -4190,6 +4237,7 @@ var Ut = /*#__PURE__*/_createClass(function Ut(e, t) {
4190
4237
  };
4191
4238
  var o, a, c, u, l, d, h, p, f, _, v;
4192
4239
  this._dataLayer = It(e, n), this._subscriptionService = new Nt(e, this._dataLayer);
4240
+ var m = new Ot(this._dataLayer, "passwords");
4193
4241
  this._networkClient = new kt(e, this._dataLayer, s.endpoints.sdkBackendURL, function () {
4194
4242
  var e, t, r, n;
4195
4243
  return {
@@ -4197,33 +4245,33 @@ var Ut = /*#__PURE__*/_createClass(function Ut(e, t) {
4197
4245
  stytch_session_id: null === (n = null === (r = _this11._dataLayer.state) || void 0 === r ? void 0 : r.session) || void 0 === n ? void 0 : n.session_id
4198
4246
  };
4199
4247
  });
4200
- var m = new qe(e, this._networkClient, this._dataLayer),
4201
- y = new Ge(m.getAsync()),
4202
- g = new te(e, s.endpoints.dfpBackendURL, m.getAsync()),
4203
- b = new He(s.endpoints.clientsideServicesIframeURL),
4204
- k = new St(e, b),
4205
- w = new Ct(this._networkClient);
4206
- var S, T;
4207
- this.user = new ie(this._networkClient, this._subscriptionService), this.session = new se(this._networkClient, this._subscriptionService), this.magicLinks = new ae(this._networkClient, this._subscriptionService, new Ot(this._dataLayer, "magic_links"), m.getAsync(), y.executeRecaptcha, g), this.otps = new ce(this._networkClient, this._subscriptionService, y.executeRecaptcha), this.oauth = new bt(this._networkClient, this._subscriptionService, new Ot(this._dataLayer, "oauth"), m.getAsync(), {
4248
+ var y = new qe(e, this._networkClient, this._dataLayer),
4249
+ g = new Ge(y.getAsync()),
4250
+ b = new te(e, s.endpoints.dfpBackendURL, y.getAsync()),
4251
+ k = new He(s.endpoints.clientsideServicesIframeURL),
4252
+ w = new St(e, k),
4253
+ S = new Ct(this._networkClient);
4254
+ var T, O;
4255
+ this.user = new ie(this._networkClient, this._subscriptionService), this.session = new se(this._networkClient, this._subscriptionService), this.magicLinks = new ae(this._networkClient, this._subscriptionService, new Ot(this._dataLayer, "magic_links"), m, y.getAsync(), g.executeRecaptcha, b), this.otps = new ce(this._networkClient, this._subscriptionService, g.executeRecaptcha), this.oauth = new bt(this._networkClient, this._subscriptionService, new Ot(this._dataLayer, "oauth"), y.getAsync(), {
4208
4256
  publicToken: e,
4209
4257
  testAPIURL: s.endpoints.testAPIURL,
4210
4258
  liveAPIURL: s.endpoints.liveAPIURL
4211
- }, k), this.cryptoWallets = new le(this._networkClient, this._subscriptionService, y.executeRecaptcha), this.totps = new de(this._networkClient, this._subscriptionService), this.webauthn = new Ie(this._networkClient, this._subscriptionService), this.passwords = new je(this._networkClient, this._subscriptionService, new Ot(this._dataLayer, "passwords"), m.getAsync(), y.executeRecaptcha, g), this._sessionManager = new Ue(this._subscriptionService, this.session), this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
4259
+ }, w), this.cryptoWallets = new le(this._networkClient, this._subscriptionService, g.executeRecaptcha), this.totps = new de(this._networkClient, this._subscriptionService), this.webauthn = new Ie(this._networkClient, this._subscriptionService), this.passwords = new je(this._networkClient, this._subscriptionService, m, y.getAsync(), g.executeRecaptcha, b), this._sessionManager = new Ue(this._subscriptionService, this.session), this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
4212
4260
  name: "sdk_instance_instantiated",
4213
4261
  details: {
4214
4262
  event_callback_registered: !1,
4215
4263
  error_callback_registered: !1,
4216
4264
  success_callback_registered: !1
4217
4265
  }
4218
- }), S = this, T = {
4219
- bootstrap: m,
4220
- clientsideServices: b,
4221
- captcha: y,
4222
- oneTap: k,
4223
- searchManager: w,
4266
+ }), T = this, O = {
4267
+ bootstrap: y,
4268
+ clientsideServices: k,
4269
+ captcha: g,
4270
+ oneTap: w,
4271
+ searchManager: S,
4224
4272
  publicToken: e,
4225
4273
  dataLayer: this._dataLayer,
4226
4274
  networkClient: this._networkClient
4227
- }, Object.assign(S, _defineProperty({}, Ft, T));
4275
+ }, Object.assign(T, _defineProperty({}, Ft, O));
4228
4276
  });
4229
4277
  export { ht as AuthFlowType, pt as B2BOAuthProviders, dt as B2BProducts, lt as BiometricsErrors, st as OAuthProviders, ct as OTPMethods, at as OneTapPositions, it as Products, ft as SDKAPIUnreachableError, ut as StytchEventType, Ut as StytchHeadlessClient, mt as StytchSDKAPIError, yt as StytchSDKNativeError, vt as StytchSDKSchemaError, _t as StytchSDKUsageError, gt as UNRECOVERABLE_ERROR_TYPES, ot as Wallets };
@@ -1202,15 +1202,15 @@ var V = ["[Stytch]"],
1202
1202
  pkceRequiredForEmailMagicLinks: !1
1203
1203
  }),
1204
1204
  ae = function () {
1205
- function e(t, r, n) {
1206
- var i = this,
1207
- o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : oe,
1208
- a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : function () {
1205
+ function e(t, r, n, i) {
1206
+ var o = this,
1207
+ a = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : oe,
1208
+ u = arguments.length > 5 && void 0 !== arguments[5] ? arguments[5] : function () {
1209
1209
  return Promise.resolve(void 0);
1210
1210
  },
1211
- u = arguments.length > 5 ? arguments[5] : void 0;
1212
- c(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._config = o, this.executeRecaptcha = a, this._dfpProtectedAuth = u, this.retryWithCaptchaAndDFP = function (e, t) {
1213
- return k(i, void 0, void 0, s().mark(function r() {
1211
+ l = arguments.length > 6 ? arguments[6] : void 0;
1212
+ c(this, e), this._networkClient = t, this._subscriptionService = r, this._pkceManager = n, this._passwordResetPKCEManager = i, this._config = a, this.executeRecaptcha = u, this._dfpProtectedAuth = l, this.retryWithCaptchaAndDFP = function (e, t) {
1213
+ return k(o, void 0, void 0, s().mark(function r() {
1214
1214
  var n, i;
1215
1215
  return s().wrap(function (r) {
1216
1216
  for (;;) switch (r.prev = r.next) {
@@ -1249,7 +1249,7 @@ var V = ["[Stytch]"],
1249
1249
  }, this.email = {
1250
1250
  loginOrCreate: function loginOrCreate(e) {
1251
1251
  var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
1252
- return k(i, void 0, void 0, s().mark(function r() {
1252
+ return k(o, void 0, void 0, s().mark(function r() {
1253
1253
  var n, i, o, a, c, u, l;
1254
1254
  return s().wrap(function (r) {
1255
1255
  for (;;) switch (r.prev = r.next) {
@@ -1287,7 +1287,7 @@ var V = ["[Stytch]"],
1287
1287
  },
1288
1288
  send: function send(e) {
1289
1289
  var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};
1290
- return k(i, void 0, void 0, s().mark(function r() {
1290
+ return k(o, void 0, void 0, s().mark(function r() {
1291
1291
  var n, i, o, a, c, u, l, d, h;
1292
1292
  return s().wrap(function (r) {
1293
1293
  for (;;) switch (r.prev = r.next) {
@@ -1324,37 +1324,57 @@ var V = ["[Stytch]"],
1324
1324
  }));
1325
1325
  }
1326
1326
  }, this.authenticate = function (e, t) {
1327
- return k(i, void 0, void 0, s().mark(function r() {
1328
- var n, i, o;
1327
+ return k(o, void 0, void 0, s().mark(function r() {
1328
+ var n, i;
1329
1329
  return s().wrap(function (r) {
1330
1330
  for (;;) switch (r.prev = r.next) {
1331
1331
  case 0:
1332
- return Z("stytch.magicLinks.authenticate").isString("Token", e).isNumber("session_duration_minutes", t.session_duration_minutes), r.next = 3, this._pkceManager.getPKPair();
1332
+ return Z("stytch.magicLinks.authenticate").isString("Token", e).isNumber("session_duration_minutes", t.session_duration_minutes), r.next = 3, this._passwordResetPKCEManager.getPKPair();
1333
1333
  case 3:
1334
- return n = r.sent, i = Object.assign({
1335
- token: e,
1336
- code_verifier: null == n ? void 0 : n.code_verifier
1337
- }, t), r.next = 7, this._networkClient.fetchSDK({
1338
- url: "/magic_links/authenticate",
1339
- body: i,
1340
- errorMessage: "Failed to authenticate token.",
1341
- method: "POST"
1342
- });
1343
- case 7:
1344
- return o = r.sent, this._pkceManager.clearPKPair(), this._subscriptionService.updateStateAndTokens({
1334
+ if (n = r.sent, i = null, !(null == n ? void 0 : n.code_verifier)) {
1335
+ r.next = 19;
1336
+ break;
1337
+ }
1338
+ return r.prev = 6, r.next = 9, this.handlePKCEForAuthenticate(this._passwordResetPKCEManager, Object.assign(Object.assign({}, t), {
1339
+ token: e
1340
+ }));
1341
+ case 9:
1342
+ i = r.sent, r.next = 19;
1343
+ break;
1344
+ case 12:
1345
+ if (r.prev = 12, r.t0 = r["catch"](6), !r.t0.message.includes("pkce")) {
1346
+ r.next = 18;
1347
+ break;
1348
+ }
1349
+ console.log("Authenticate with passwords pkce namespace failed. Falling back to authenticate with magic_links namespace."), r.next = 19;
1350
+ break;
1351
+ case 18:
1352
+ throw r.t0;
1353
+ case 19:
1354
+ if (i) {
1355
+ r.next = 23;
1356
+ break;
1357
+ }
1358
+ return r.next = 22, this.handlePKCEForAuthenticate(this._pkceManager, Object.assign(Object.assign({}, t), {
1359
+ token: e
1360
+ }));
1361
+ case 22:
1362
+ i = r.sent;
1363
+ case 23:
1364
+ return this._subscriptionService.updateStateAndTokens({
1345
1365
  state: {
1346
- session: o.session,
1347
- user: o.user
1366
+ session: i.session,
1367
+ user: i.user
1348
1368
  },
1349
- session_token: o.session_token,
1350
- session_jwt: o.session_jwt,
1369
+ session_token: i.session_token,
1370
+ session_jwt: i.session_jwt,
1351
1371
  intermediate_session_token: null
1352
- }), r.abrupt("return", ee(o));
1353
- case 11:
1372
+ }), r.abrupt("return", ee(i));
1373
+ case 25:
1354
1374
  case "end":
1355
1375
  return r.stop();
1356
1376
  }
1357
- }, r, this);
1377
+ }, r, this, [[6, 12]]);
1358
1378
  }));
1359
1379
  };
1360
1380
  }
@@ -1424,6 +1444,33 @@ var V = ["[Stytch]"],
1424
1444
  }, e, this);
1425
1445
  }));
1426
1446
  }
1447
+ }, {
1448
+ key: "handlePKCEForAuthenticate",
1449
+ value: function value(e, t) {
1450
+ return k(this, void 0, void 0, s().mark(function r() {
1451
+ var n, i, o;
1452
+ return s().wrap(function (r) {
1453
+ for (;;) switch (r.prev = r.next) {
1454
+ case 0:
1455
+ return r.next = 2, e.getPKPair();
1456
+ case 2:
1457
+ return n = r.sent, i = Object.assign({
1458
+ code_verifier: null == n ? void 0 : n.code_verifier
1459
+ }, t), r.next = 6, this._networkClient.fetchSDK({
1460
+ url: "/magic_links/authenticate",
1461
+ body: i,
1462
+ errorMessage: "Failed to authenticate token.",
1463
+ method: "POST"
1464
+ });
1465
+ case 6:
1466
+ return o = r.sent, e.clearPKPair(), r.abrupt("return", o);
1467
+ case 9:
1468
+ case "end":
1469
+ return r.stop();
1470
+ }
1471
+ }, r, this);
1472
+ }));
1473
+ }
1427
1474
  }]), e;
1428
1475
  }(),
1429
1476
  ce = a(function e(t, r) {
@@ -3338,7 +3385,7 @@ var lt = /*#__PURE__*/function () {
3338
3385
  },
3339
3386
  sdk: {
3340
3387
  identifier: "Stytch.js Javascript SDK",
3341
- version: "2.0.3"
3388
+ version: "2.0.4"
3342
3389
  }
3343
3390
  });
3344
3391
  }
@@ -4190,6 +4237,7 @@ exports.SDKAPIUnreachableError = it, exports.StytchHeadlessClient = /*#__PURE__*
4190
4237
  };
4191
4238
  var o, a, c, u, l, d, h, p, f, _, v;
4192
4239
  this._dataLayer = St(e, n), this._subscriptionService = new Ct(e, this._dataLayer);
4240
+ var m = new ft(this._dataLayer, "passwords");
4193
4241
  this._networkClient = new lt(e, this._dataLayer, s.endpoints.sdkBackendURL, function () {
4194
4242
  var e, t, r, n;
4195
4243
  return {
@@ -4197,34 +4245,34 @@ exports.SDKAPIUnreachableError = it, exports.StytchHeadlessClient = /*#__PURE__*
4197
4245
  stytch_session_id: null === (n = null === (r = _this11._dataLayer.state) || void 0 === r ? void 0 : r.session) || void 0 === n ? void 0 : n.session_id
4198
4246
  };
4199
4247
  });
4200
- var m = new qe(e, this._networkClient, this._dataLayer),
4201
- y = new Ge(m.getAsync()),
4202
- g = new te(e, s.endpoints.dfpBackendURL, m.getAsync()),
4203
- b = new He(s.endpoints.clientsideServicesIframeURL),
4204
- k = new ht(e, b),
4205
- w = new _t(this._networkClient);
4206
- var S, T;
4207
- this.user = new ie(this._networkClient, this._subscriptionService), this.session = new se(this._networkClient, this._subscriptionService), this.magicLinks = new ae(this._networkClient, this._subscriptionService, new ft(this._dataLayer, "magic_links"), m.getAsync(), y.executeRecaptcha, g), this.otps = new ce(this._networkClient, this._subscriptionService, y.executeRecaptcha), this.oauth = new ut(this._networkClient, this._subscriptionService, new ft(this._dataLayer, "oauth"), m.getAsync(), {
4248
+ var y = new qe(e, this._networkClient, this._dataLayer),
4249
+ g = new Ge(y.getAsync()),
4250
+ b = new te(e, s.endpoints.dfpBackendURL, y.getAsync()),
4251
+ k = new He(s.endpoints.clientsideServicesIframeURL),
4252
+ w = new ht(e, k),
4253
+ S = new _t(this._networkClient);
4254
+ var T, O;
4255
+ this.user = new ie(this._networkClient, this._subscriptionService), this.session = new se(this._networkClient, this._subscriptionService), this.magicLinks = new ae(this._networkClient, this._subscriptionService, new ft(this._dataLayer, "magic_links"), m, y.getAsync(), g.executeRecaptcha, b), this.otps = new ce(this._networkClient, this._subscriptionService, g.executeRecaptcha), this.oauth = new ut(this._networkClient, this._subscriptionService, new ft(this._dataLayer, "oauth"), y.getAsync(), {
4208
4256
  publicToken: e,
4209
4257
  testAPIURL: s.endpoints.testAPIURL,
4210
4258
  liveAPIURL: s.endpoints.liveAPIURL
4211
- }, k), this.cryptoWallets = new le(this._networkClient, this._subscriptionService, y.executeRecaptcha), this.totps = new de(this._networkClient, this._subscriptionService), this.webauthn = new Ie(this._networkClient, this._subscriptionService), this.passwords = new je(this._networkClient, this._subscriptionService, new ft(this._dataLayer, "passwords"), m.getAsync(), y.executeRecaptcha, g), this._sessionManager = new Ue(this._subscriptionService, this.session), this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
4259
+ }, w), this.cryptoWallets = new le(this._networkClient, this._subscriptionService, g.executeRecaptcha), this.totps = new de(this._networkClient, this._subscriptionService), this.webauthn = new Ie(this._networkClient, this._subscriptionService), this.passwords = new je(this._networkClient, this._subscriptionService, m, y.getAsync(), g.executeRecaptcha, b), this._sessionManager = new Ue(this._subscriptionService, this.session), this._dataLayer.readSessionCookie().session_token && this._sessionManager.performBackgroundRefresh(), this._networkClient.logEvent({
4212
4260
  name: "sdk_instance_instantiated",
4213
4261
  details: {
4214
4262
  event_callback_registered: !1,
4215
4263
  error_callback_registered: !1,
4216
4264
  success_callback_registered: !1
4217
4265
  }
4218
- }), S = this, T = {
4219
- bootstrap: m,
4220
- clientsideServices: b,
4221
- captcha: y,
4222
- oneTap: k,
4223
- searchManager: w,
4266
+ }), T = this, O = {
4267
+ bootstrap: y,
4268
+ clientsideServices: k,
4269
+ captcha: g,
4270
+ oneTap: w,
4271
+ searchManager: S,
4224
4272
  publicToken: e,
4225
4273
  dataLayer: this._dataLayer,
4226
4274
  networkClient: this._networkClient
4227
- }, Object.assign(S, _defineProperty({}, Et, T));
4275
+ }, Object.assign(T, _defineProperty({}, Et, O));
4228
4276
  }
4229
4277
  return _createClass(_class);
4230
4278
  }(), exports.StytchSDKAPIError = at, exports.StytchSDKNativeError = ct, exports.StytchSDKSchemaError = ot, exports.StytchSDKUsageError = st, exports.UNRECOVERABLE_ERROR_TYPES = ["unauthorized_credentials", "user_unauthenticated", "invalid_secret_authentication", "session_not_found"];