@stytch/vanilla-js 4.7.8 → 4.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @stytch/vanilla-js
2
2
 
3
+ ## 4.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b007d98: Enable FedCM for use with Google One Tap by default. For users using supported browsers (including Google Chrome and other Chromium-based browsers), Google One Tap will now use [FedCM to provide a sign in experience using native browser prompts](https://developers.google.com/identity/gsi/web/guides/fedcm-migration).
8
+
9
+ Due to changes in Google's One Tap SDK, this affects One Tap using both floating and embedded positioning. Notably, users of Chrome and other Chromium-based browsers will no longer see a embedded One Tap UI by default. Google will begin to remove support for this UI later this year. We recommend adopting the new default behavior, but we have added new position options if you require different behavior:
10
+
11
+ - `floating` remains the default option and uses Google's One Tap SDK's default behavior. It uses FedCM (native browser UI) where available, or renders a floating UI in the top right corner otherwise.
12
+ - `floatingOrEmbedded` uses FedCM where available, or renders an embedded UI in the existing SDK login form otherwise. This is the new default behavior of the `embedded` position, which has been deprecated and renamed for clarity.
13
+ - `embeddedOnly` renders the embedded UI in the existing SDK login form if FedCM is not available, or not at all otherwise. This option is not recommended for new applications. For applications that used `embedded` positioning and do not want to show floating or native browser UI, this option may be useful.
14
+ - `forceLegacyEmbedded` retains the legacy behavior by disabling FedCM support even where it is available. This option is not recommended and will stop being honored by Google in the future, at which time you will need to select a different option.
15
+
16
+ The `embedded` position will still be recognized and treated as `floatingOrEmbedded`, but we recommend updating your configuration to use the new name or a different option.
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [b007d98]
21
+ - @stytch/core@2.12.0
22
+
3
23
  ## 4.7.8
4
24
 
5
25
  ### Patch Changes
@@ -146,7 +146,7 @@ var p, h, m, f, g, _, A;
146
146
  }(h || (h = {})), function (e) {
147
147
  e.Vessel = "Vessel", e.Phantom = "Phantom", e.Metamask = "Metamask", e.Coinbase = "Coinbase", e.Binance = "Binance", e.GenericEthereumWallet = "Other Ethereum Wallet", e.GenericSolanaWallet = "Other Solana Wallet";
148
148
  }(m || (m = {})), function (e) {
149
- e.embedded = "embedded", e.floating = "floating";
149
+ e.embedded = "embedded", e.floating = "floating", e.embeddedOnly = "embeddedOnly", e.floatingOrEmbedded = "floatingOrEmbedded", e.forceLegacyEmbedded = "forceLegacyEmbedded";
150
150
  }(f || (f = {})), function (e) {
151
151
  e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
152
152
  }(g || (g = {})), function (e) {
@@ -4130,7 +4130,7 @@ var wt = /*#__PURE__*/function () {
4130
4130
  },
4131
4131
  sdk: {
4132
4132
  identifier: "Stytch.js Javascript SDK",
4133
- version: "4.7.8"
4133
+ version: "4.8.0"
4134
4134
  }
4135
4135
  });
4136
4136
  }
@@ -140,7 +140,7 @@ var h, p, f, _, m, v, b;
140
140
  }(p || (p = {})), function (e) {
141
141
  e.Vessel = "Vessel", e.Phantom = "Phantom", e.Metamask = "Metamask", e.Coinbase = "Coinbase", e.Binance = "Binance", e.GenericEthereumWallet = "Other Ethereum Wallet", e.GenericSolanaWallet = "Other Solana Wallet";
142
142
  }(f || (f = {})), function (e) {
143
- e.embedded = "embedded", e.floating = "floating";
143
+ e.embedded = "embedded", e.floating = "floating", e.embeddedOnly = "embeddedOnly", e.floatingOrEmbedded = "floatingOrEmbedded", e.forceLegacyEmbedded = "forceLegacyEmbedded";
144
144
  }(_ || (_ = {})), function (e) {
145
145
  e.SMS = "sms", e.WhatsApp = "whatsapp", e.Email = "email";
146
146
  }(m || (m = {})), function (e) {
@@ -4006,7 +4006,7 @@ var yt = /*#__PURE__*/function () {
4006
4006
  },
4007
4007
  sdk: {
4008
4008
  identifier: "Stytch.js Javascript SDK",
4009
- version: "4.7.8"
4009
+ version: "4.8.0"
4010
4010
  }
4011
4011
  });
4012
4012
  }
@@ -137,7 +137,7 @@ function d(e) {
137
137
  var h, p, f, _, m, v, b;
138
138
  Object.defineProperty(exports, "__esModule", {
139
139
  value: !0
140
- }), exports.Products = void 0, (h = exports.Products || (exports.Products = {})).emailMagicLinks = "emailMagicLinks", h.oauth = "oauth", h.otp = "otp", h.crypto = "crypto", h.passwords = "passwords", h.passkeys = "passkeys", exports.OAuthProviders = void 0, (p = exports.OAuthProviders || (exports.OAuthProviders = {})).Google = "google", p.Microsoft = "microsoft", p.Apple = "apple", p.Github = "github", p.GitLab = "gitlab", p.Facebook = "facebook", p.Discord = "discord", p.Salesforce = "salesforce", p.Slack = "slack", p.Amazon = "amazon", p.Bitbucket = "bitbucket", p.LinkedIn = "linkedin", p.Coinbase = "coinbase", p.Twitch = "twitch", p.Twitter = "twitter", p.TikTok = "tiktok", p.Snapchat = "snapchat", p.Figma = "figma", p.Yahoo = "yahoo", exports.Wallets = void 0, (f = exports.Wallets || (exports.Wallets = {})).Vessel = "Vessel", f.Phantom = "Phantom", f.Metamask = "Metamask", f.Coinbase = "Coinbase", f.Binance = "Binance", f.GenericEthereumWallet = "Other Ethereum Wallet", f.GenericSolanaWallet = "Other Solana Wallet", exports.OneTapPositions = void 0, (_ = exports.OneTapPositions || (exports.OneTapPositions = {})).embedded = "embedded", _.floating = "floating", exports.OTPMethods = void 0, (m = exports.OTPMethods || (exports.OTPMethods = {})).SMS = "sms", m.WhatsApp = "whatsapp", m.Email = "email", exports.StytchEventType = void 0, (v = exports.StytchEventType || (exports.StytchEventType = {})).MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", v.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", v.OTPsAuthenticate = "OTP_AUTHENTICATE", v.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", v.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", v.PasswordCreate = "PASSWORD_CREATE", v.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", v.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", v.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", v.PasskeyRegister = "PASSKEY_REGISTER", v.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", v.PasskeySkip = "PASSKEY_SKIP", v.PasskeyDone = "PASSKEY_DONE", v.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", v.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", v.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", v.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", v.B2BSSOStart = "B2B_SSO_START", v.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", v.B2BOAuthAuthenticate = "B2B_OAUTH_AUTHENTICATE", v.B2BOAuthDiscoveryAuthenticate = "B2B_OAUTH_DISCOVERY_AUTHENTICATE", v.B2BDiscoveryOrganizationsCreate = "B2B_DISCOVERY_ORGANIZATIONS_CREATE", v.B2BDiscoveryIntermediateSessionExchange = "B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE", v.B2BPasswordAuthenticate = "B2B_PASSWORD_AUTHENTICATE", v.B2BPasswordResetByEmailStart = "B2B_PASSWORD_RESET_BY_EMAIL_START", v.B2BPasswordResetByEmail = "B2B_PASSWORD_RESET_BY_EMAIL", v.B2BPasswordResetBySession = "B2B_PASSWORD_RESET_BY_SESSION", v.B2BSMSOTPSend = "B2B_SMS_OTP_SEND", v.B2BSMSOTPAuthenticate = "B2B_SMS_OTP_AUTHENTICATE", v.B2BTOTPCreate = "B2B_TOTP_CREATE", v.B2BTOTPAuthenticate = "B2B_TOTP_AUTHENTICATE", v.B2BRecoveryCodesRecover = "B2B_RECOVERY_CODES_RECOVER", exports.RNUIProducts = void 0, (b = exports.RNUIProducts || (exports.RNUIProducts = {}))[b.emailMagicLinks = 0] = "emailMagicLinks", b[b.oauth = 1] = "oauth", b[b.otp = 2] = "otp", b[b.passwords = 3] = "passwords";
140
+ }), exports.Products = void 0, (h = exports.Products || (exports.Products = {})).emailMagicLinks = "emailMagicLinks", h.oauth = "oauth", h.otp = "otp", h.crypto = "crypto", h.passwords = "passwords", h.passkeys = "passkeys", exports.OAuthProviders = void 0, (p = exports.OAuthProviders || (exports.OAuthProviders = {})).Google = "google", p.Microsoft = "microsoft", p.Apple = "apple", p.Github = "github", p.GitLab = "gitlab", p.Facebook = "facebook", p.Discord = "discord", p.Salesforce = "salesforce", p.Slack = "slack", p.Amazon = "amazon", p.Bitbucket = "bitbucket", p.LinkedIn = "linkedin", p.Coinbase = "coinbase", p.Twitch = "twitch", p.Twitter = "twitter", p.TikTok = "tiktok", p.Snapchat = "snapchat", p.Figma = "figma", p.Yahoo = "yahoo", exports.Wallets = void 0, (f = exports.Wallets || (exports.Wallets = {})).Vessel = "Vessel", f.Phantom = "Phantom", f.Metamask = "Metamask", f.Coinbase = "Coinbase", f.Binance = "Binance", f.GenericEthereumWallet = "Other Ethereum Wallet", f.GenericSolanaWallet = "Other Solana Wallet", exports.OneTapPositions = void 0, (_ = exports.OneTapPositions || (exports.OneTapPositions = {})).embedded = "embedded", _.floating = "floating", _.embeddedOnly = "embeddedOnly", _.floatingOrEmbedded = "floatingOrEmbedded", _.forceLegacyEmbedded = "forceLegacyEmbedded", exports.OTPMethods = void 0, (m = exports.OTPMethods || (exports.OTPMethods = {})).SMS = "sms", m.WhatsApp = "whatsapp", m.Email = "email", exports.StytchEventType = void 0, (v = exports.StytchEventType || (exports.StytchEventType = {})).MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", v.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", v.OTPsAuthenticate = "OTP_AUTHENTICATE", v.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", v.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", v.PasswordCreate = "PASSWORD_CREATE", v.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", v.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", v.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", v.PasskeyRegister = "PASSKEY_REGISTER", v.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", v.PasskeySkip = "PASSKEY_SKIP", v.PasskeyDone = "PASSKEY_DONE", v.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", v.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", v.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", v.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", v.B2BSSOStart = "B2B_SSO_START", v.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", v.B2BOAuthAuthenticate = "B2B_OAUTH_AUTHENTICATE", v.B2BOAuthDiscoveryAuthenticate = "B2B_OAUTH_DISCOVERY_AUTHENTICATE", v.B2BDiscoveryOrganizationsCreate = "B2B_DISCOVERY_ORGANIZATIONS_CREATE", v.B2BDiscoveryIntermediateSessionExchange = "B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE", v.B2BPasswordAuthenticate = "B2B_PASSWORD_AUTHENTICATE", v.B2BPasswordResetByEmailStart = "B2B_PASSWORD_RESET_BY_EMAIL_START", v.B2BPasswordResetByEmail = "B2B_PASSWORD_RESET_BY_EMAIL", v.B2BPasswordResetBySession = "B2B_PASSWORD_RESET_BY_SESSION", v.B2BSMSOTPSend = "B2B_SMS_OTP_SEND", v.B2BSMSOTPAuthenticate = "B2B_SMS_OTP_AUTHENTICATE", v.B2BTOTPCreate = "B2B_TOTP_CREATE", v.B2BTOTPAuthenticate = "B2B_TOTP_AUTHENTICATE", v.B2BRecoveryCodesRecover = "B2B_RECOVERY_CODES_RECOVER", exports.RNUIProducts = void 0, (b = exports.RNUIProducts || (exports.RNUIProducts = {}))[b.emailMagicLinks = 0] = "emailMagicLinks", b[b.oauth = 1] = "oauth", b[b.otp = 2] = "otp", b[b.passwords = 3] = "passwords";
141
141
  var g,
142
142
  y,
143
143
  k,
@@ -188,14 +188,14 @@ var g,
188
188
  }
189
189
  return a(t, c(Error)), r(t);
190
190
  }(),
191
- A = function (e) {
191
+ E = function (e) {
192
192
  function t(e) {
193
193
  var r;
194
194
  return i(this, t), r = o(this, t, ["StytchAPIUnreachableError", e]), Object.setPrototypeOf(s(r), t.prototype), r;
195
195
  }
196
196
  return a(t, O), r(t);
197
197
  }(),
198
- E = function (e) {
198
+ A = function (e) {
199
199
  function t(e) {
200
200
  var r;
201
201
  i(this, t);
@@ -498,7 +498,7 @@ function fe() {
498
498
  function l(e, t, r, n) {
499
499
  var o = t && t.prototype instanceof v ? t : v,
500
500
  s = Object.create(o.prototype),
501
- a = new E(n || []);
501
+ a = new A(n || []);
502
502
  return i(s, "_invoke", {
503
503
  value: C(e, r, a)
504
504
  }), s;
@@ -622,11 +622,11 @@ function fe() {
622
622
  };
623
623
  1 in e && (t.catchLoc = e[1]), 2 in e && (t.finallyLoc = e[2], t.afterLoc = e[3]), this.tryEntries.push(t);
624
624
  }
625
- function A(e) {
625
+ function E(e) {
626
626
  var t = e.completion || {};
627
627
  t.type = "normal", delete t.arg, e.completion = t;
628
628
  }
629
- function E(e) {
629
+ function A(e) {
630
630
  this.tryEntries = [{
631
631
  tryLoc: "root"
632
632
  }], e.forEach(O, this), this.reset(!0);
@@ -685,10 +685,10 @@ function fe() {
685
685
  }
686
686
  return e.done = !0, e;
687
687
  };
688
- }, t.values = D, E.prototype = {
689
- constructor: E,
688
+ }, t.values = D, A.prototype = {
689
+ constructor: A,
690
690
  reset: function reset(t) {
691
- if (this.prev = 0, this.next = 0, this.sent = this._sent = e, this.done = !1, this.delegate = null, this.method = "next", this.arg = e, this.tryEntries.forEach(A), !t) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = e);
691
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = e, this.done = !1, this.delegate = null, this.method = "next", this.arg = e, this.tryEntries.forEach(E), !t) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = e);
692
692
  },
693
693
  stop: function stop() {
694
694
  this.done = !0;
@@ -740,7 +740,7 @@ function fe() {
740
740
  finish: function finish(e) {
741
741
  for (var t = this.tryEntries.length - 1; t >= 0; --t) {
742
742
  var r = this.tryEntries[t];
743
- if (r.finallyLoc === e) return this.complete(r.completion, r.afterLoc), A(r), m;
743
+ if (r.finallyLoc === e) return this.complete(r.completion, r.afterLoc), E(r), m;
744
744
  }
745
745
  },
746
746
  "catch": function _catch(e) {
@@ -750,7 +750,7 @@ function fe() {
750
750
  var n = r.completion;
751
751
  if ("throw" === n.type) {
752
752
  var i = n.arg;
753
- A(r);
753
+ E(r);
754
754
  }
755
755
  return i;
756
756
  }
@@ -934,7 +934,7 @@ function Oe(e) {
934
934
  e.next = 13;
935
935
  break;
936
936
  }
937
- throw new A("Unable to contact the Stytch servers. Are you online?");
937
+ throw new E("Unable to contact the Stytch servers. Are you online?");
938
938
  case 13:
939
939
  throw e.t0;
940
940
  case 14:
@@ -946,7 +946,7 @@ function Oe(e) {
946
946
  case 18:
947
947
  return d = e.sent, e.abrupt("return", d.data);
948
948
  case 22:
949
- throw e.prev = 22, e.t1 = e["catch"](15), new A("Invalid JSON response from the Stytch servers.");
949
+ throw e.prev = 22, e.t1 = e["catch"](15), new E("Invalid JSON response from the Stytch servers.");
950
950
  case 25:
951
951
  if (200 === l.status || !(null === (t = l.headers.get("content-type")) || void 0 === t ? void 0 : t.includes("application/json"))) {
952
952
  e.next = 38;
@@ -957,13 +957,13 @@ function Oe(e) {
957
957
  h = e.sent, e.next = 35;
958
958
  break;
959
959
  case 32:
960
- throw e.prev = 32, e.t2 = e["catch"](26), new A("Invalid or no response from server");
960
+ throw e.prev = 32, e.t2 = e["catch"](26), new E("Invalid or no response from server");
961
961
  case 35:
962
962
  if (!("body" in h || "params" in h || "query" in h)) {
963
963
  e.next = 37;
964
964
  break;
965
965
  }
966
- throw new E(h);
966
+ throw new A(h);
967
967
  case 37:
968
968
  throw new D(h);
969
969
  case 38:
@@ -972,7 +972,7 @@ function Oe(e) {
972
972
  p = e.sent, e.next = 47;
973
973
  break;
974
974
  case 44:
975
- throw e.prev = 44, e.t3 = e["catch"](38), new A("Invalid response from the Stytch servers.");
975
+ throw e.prev = 44, e.t3 = e["catch"](38), new E("Invalid response from the Stytch servers.");
976
976
  case 47:
977
977
  if (!p.includes("Captcha required")) {
978
978
  e.next = 49;
@@ -980,7 +980,7 @@ function Oe(e) {
980
980
  }
981
981
  throw new Te(Pe.RequiredCatcha);
982
982
  case 49:
983
- throw new A("Invalid response from the Stytch servers.");
983
+ throw new E("Invalid response from the Stytch servers.");
984
984
  case 50:
985
985
  case "end":
986
986
  return e.stop();
@@ -988,10 +988,10 @@ function Oe(e) {
988
988
  }, e, null, [[3, 9], [15, 22], [26, 32], [38, 44]]);
989
989
  }));
990
990
  }
991
- var Ae = new Uint8Array(16);
992
- function Ee() {
991
+ var Ee = new Uint8Array(16);
992
+ function Ae() {
993
993
  if (!Ce && !(Ce = "undefined" != typeof crypto && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || "undefined" != typeof msCrypto && "function" == typeof msCrypto.getRandomValues && msCrypto.getRandomValues.bind(msCrypto))) throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
994
- return Ce(Ae);
994
+ return Ce(Ee);
995
995
  }
996
996
  var De = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
997
997
  for (var Ie = [], Re = 0; Re < 256; ++Re) Ie.push((Re + 256).toString(16).substr(1));
@@ -1004,7 +1004,7 @@ function Be(e) {
1004
1004
  return r;
1005
1005
  }
1006
1006
  function Me(e, t, r) {
1007
- var n = (e = e || {}).random || (e.rng || Ee)();
1007
+ var n = (e = e || {}).random || (e.rng || Ae)();
1008
1008
  if (n[6] = 15 & n[6] | 64, n[8] = 63 & n[8] | 128, t) {
1009
1009
  r = r || 0;
1010
1010
  for (var i = 0; i < 16; ++i) t[r + i] = n[i];
@@ -1417,9 +1417,9 @@ var Ne,
1417
1417
  case "StytchSDKSchemaError":
1418
1418
  return e.inflate(x, t);
1419
1419
  case "StytchAPIUnreachableError":
1420
- return e.inflate(A, t);
1421
- case "StytchAPISchemaError":
1422
1420
  return e.inflate(E, t);
1421
+ case "StytchAPISchemaError":
1422
+ return e.inflate(A, t);
1423
1423
  case "StytchSDKAPIError":
1424
1424
  return e.inflate(C, t);
1425
1425
  case "StytchAPIError":
@@ -3917,7 +3917,7 @@ var yt = /*#__PURE__*/function () {
3917
3917
  },
3918
3918
  sdk: {
3919
3919
  identifier: "Stytch.js Javascript SDK",
3920
- version: "4.7.8"
3920
+ version: "4.8.0"
3921
3921
  }
3922
3922
  });
3923
3923
  }
@@ -4187,17 +4187,17 @@ var Ct = function Ct(e) {
4187
4187
  Ot = function Ot(e) {
4188
4188
  clearTimeout(Tt.get(e));
4189
4189
  },
4190
- At = function At(e, t, r) {
4190
+ Et = function Et(e, t, r) {
4191
4191
  Ot(e);
4192
4192
  var n = setTimeout(function () {
4193
4193
  void 0 === xt.get(e) && xt.set(e, t, r);
4194
4194
  }, 10);
4195
4195
  return Tt.set(e, n), xt.set(e, t, r);
4196
4196
  };
4197
- var Et = /*#__PURE__*/function () {
4198
- function Et(e, t) {
4197
+ var At = /*#__PURE__*/function () {
4198
+ function At(e, t) {
4199
4199
  var _this4 = this;
4200
- _classCallCheck(this, Et);
4200
+ _classCallCheck(this, At);
4201
4201
  this.browserSessionStorage = {
4202
4202
  getItem: function getItem(e) {
4203
4203
  return sessionStorage.getItem(Ct(_this4.publicToken, e));
@@ -4219,7 +4219,7 @@ var Et = /*#__PURE__*/function () {
4219
4219
  }
4220
4220
  this.state = n;
4221
4221
  }
4222
- _createClass(Et, [{
4222
+ _createClass(At, [{
4223
4223
  key: "opaqueTokenCookieName",
4224
4224
  get: function get() {
4225
4225
  var e;
@@ -4257,14 +4257,14 @@ var Et = /*#__PURE__*/function () {
4257
4257
  var o = e.state,
4258
4258
  s = e.session_token,
4259
4259
  a = e.session_jwt,
4260
- c = Et.generateCookieOpts({
4260
+ c = At.generateCookieOpts({
4261
4261
  expiresAt: null !== (r = null === (t = null == o ? void 0 : o.session) || void 0 === t ? void 0 : t.expires_at) && void 0 !== r ? r : "",
4262
4262
  availableToSubdomains: this._cookieAvailableToSubdomains,
4263
4263
  path: this._cookiePath,
4264
4264
  domain: this._domain
4265
4265
  });
4266
- At(this.opaqueTokenCookieName, s, c), At(this.jwtCookieName, a, c);
4267
- var u = Et.generateCookieOpts({
4266
+ Et(this.opaqueTokenCookieName, s, c), Et(this.jwtCookieName, a, c);
4267
+ var u = At.generateCookieOpts({
4268
4268
  expiresAt: null !== (i = null === (n = null == o ? void 0 : o.session) || void 0 === n ? void 0 : n.expires_at) && void 0 !== i ? i : "",
4269
4269
  availableToSubdomains: !this._cookieAvailableToSubdomains,
4270
4270
  path: this._cookiePath,
@@ -4276,13 +4276,13 @@ var Et = /*#__PURE__*/function () {
4276
4276
  key: "writeIntermediateSessionTokenCookie",
4277
4277
  value: function writeIntermediateSessionTokenCookie(e) {
4278
4278
  var t = new Date(Date.now() + 6e5),
4279
- r = Et.generateCookieOpts({
4279
+ r = At.generateCookieOpts({
4280
4280
  expiresAt: t.toString(),
4281
4281
  availableToSubdomains: this._cookieAvailableToSubdomains,
4282
4282
  path: this._cookiePath,
4283
4283
  domain: this._domain
4284
4284
  });
4285
- At(this.istCookieName, e, r);
4285
+ Et(this.istCookieName, e, r);
4286
4286
  }
4287
4287
  }, {
4288
4288
  key: "removeSessionCookie",
@@ -4301,7 +4301,7 @@ var Et = /*#__PURE__*/function () {
4301
4301
  [!0, !1].forEach(function (t) {
4302
4302
  [_this5._cookiePath, null].forEach(function (r) {
4303
4303
  [_this5._domain, null].forEach(function (n) {
4304
- var i = Et.generateCookieOpts({
4304
+ var i = At.generateCookieOpts({
4305
4305
  expiresAt: new Date(0).toString(),
4306
4306
  availableToSubdomains: t,
4307
4307
  path: r,
@@ -4357,16 +4357,16 @@ var Et = /*#__PURE__*/function () {
4357
4357
  return e && (i.path = e), Boolean("localhost" === window.location.hostname || "[::1]" === window.location.hostname || window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)) ? i.secure = !1 : (r && (i.domain = t || window.location.host), i.secure = !0), i;
4358
4358
  }
4359
4359
  }]);
4360
- return Et;
4360
+ return At;
4361
4361
  }();
4362
- var Dt = /*#__PURE__*/function (_Et) {
4363
- _inherits(Dt, _Et);
4362
+ var Dt = /*#__PURE__*/function (_At) {
4363
+ _inherits(Dt, _At);
4364
4364
  function Dt() {
4365
4365
  _classCallCheck(this, Dt);
4366
4366
  return _callSuper(this, Dt, arguments);
4367
4367
  }
4368
4368
  return _createClass(Dt);
4369
- }(Et);
4369
+ }(At);
4370
4370
  var It = Symbol["for"]("__stytch_b2b_DataLayer"),
4371
4371
  Rt = function Rt(e, t) {
4372
4372
  var r = function () {
@@ -4537,7 +4537,7 @@ var jt = /*#__PURE__*/function (_Ft) {
4537
4537
  return _createClass(jt);
4538
4538
  }(Ft);
4539
4539
  var Lt = Symbol["for"]("stytch__internal_b2b");
4540
- exports.BiometricsFailedError = Q, exports.BiometricsUnavailableError = F, exports.ChallengeSigningFailedError = Y, exports.DeviceCredentialsNotAllowedError = z, exports.FailedCodeChallengeError = $, exports.FailedToDecryptDataError = Z, exports.InternalError = B, exports.InvalidAuthorizationCredentialError = G, exports.InvalidCredentialTypeError = ne, exports.InvalidRedirectSchemeError = te, exports.InvalidStartUrlError = ee, exports.JSONDataNotConvertibleToStringError = oe, exports.KeyInvalidatedError = j, exports.KeystoreUnavailableError = L, exports.MissingAttestationObjectError = ie, exports.MissingAuthorizationCredentialIDTokenError = H, exports.MissingGoogleClientIDError = q, exports.MissingPKCEError = W, exports.MissingPublicKeyError = V, exports.MissingUrlError = re, exports.NoBiometricsEnrolledError = K, exports.NoBiometricsRegistrationError = M, exports.NoCurrentSessionError = R, exports.PasskeysInvalidEncoding = ae, exports.PasskeysMisconfigured = ce, exports.PasskeysUnsupportedError = X, exports.RandomNumberGenerationFailed = se, exports.SDKAPIUnreachableError = S, exports.SDKNotConfiguredError = J, exports.SignInWithAppleMisconfigured = ue, exports.StytchAPIError = D, exports.StytchAPISchemaError = E, exports.StytchAPIUnreachableError = A, exports.StytchB2BHeadlessClient = /*#__PURE__*/function () {
4540
+ exports.BiometricsFailedError = Q, exports.BiometricsUnavailableError = F, exports.ChallengeSigningFailedError = Y, exports.DeviceCredentialsNotAllowedError = z, exports.FailedCodeChallengeError = $, exports.FailedToDecryptDataError = Z, exports.InternalError = B, exports.InvalidAuthorizationCredentialError = G, exports.InvalidCredentialTypeError = ne, exports.InvalidRedirectSchemeError = te, exports.InvalidStartUrlError = ee, exports.JSONDataNotConvertibleToStringError = oe, exports.KeyInvalidatedError = j, exports.KeystoreUnavailableError = L, exports.MissingAttestationObjectError = ie, exports.MissingAuthorizationCredentialIDTokenError = H, exports.MissingGoogleClientIDError = q, exports.MissingPKCEError = W, exports.MissingPublicKeyError = V, exports.MissingUrlError = re, exports.NoBiometricsEnrolledError = K, exports.NoBiometricsRegistrationError = M, exports.NoCurrentSessionError = R, exports.PasskeysInvalidEncoding = ae, exports.PasskeysMisconfigured = ce, exports.PasskeysUnsupportedError = X, exports.RandomNumberGenerationFailed = se, exports.SDKAPIUnreachableError = S, exports.SDKNotConfiguredError = J, exports.SignInWithAppleMisconfigured = ue, exports.StytchAPIError = D, exports.StytchAPISchemaError = A, exports.StytchAPIUnreachableError = E, exports.StytchB2BHeadlessClient = /*#__PURE__*/function () {
4541
4541
  function _class(e, t) {
4542
4542
  var _this9 = this;
4543
4543
  _classCallCheck(this, _class);
package/dist/b2b/index.js CHANGED
@@ -143,7 +143,7 @@ function d(e) {
143
143
  var p, h, m, f, g, _, A;
144
144
  Object.defineProperty(exports, "__esModule", {
145
145
  value: !0
146
- }), exports.Products = void 0, (p = exports.Products || (exports.Products = {})).emailMagicLinks = "emailMagicLinks", p.oauth = "oauth", p.otp = "otp", p.crypto = "crypto", p.passwords = "passwords", p.passkeys = "passkeys", exports.OAuthProviders = void 0, (h = exports.OAuthProviders || (exports.OAuthProviders = {})).Google = "google", h.Microsoft = "microsoft", h.Apple = "apple", h.Github = "github", h.GitLab = "gitlab", h.Facebook = "facebook", h.Discord = "discord", h.Salesforce = "salesforce", h.Slack = "slack", h.Amazon = "amazon", h.Bitbucket = "bitbucket", h.LinkedIn = "linkedin", h.Coinbase = "coinbase", h.Twitch = "twitch", h.Twitter = "twitter", h.TikTok = "tiktok", h.Snapchat = "snapchat", h.Figma = "figma", h.Yahoo = "yahoo", exports.Wallets = void 0, (m = exports.Wallets || (exports.Wallets = {})).Vessel = "Vessel", m.Phantom = "Phantom", m.Metamask = "Metamask", m.Coinbase = "Coinbase", m.Binance = "Binance", m.GenericEthereumWallet = "Other Ethereum Wallet", m.GenericSolanaWallet = "Other Solana Wallet", exports.OneTapPositions = void 0, (f = exports.OneTapPositions || (exports.OneTapPositions = {})).embedded = "embedded", f.floating = "floating", exports.OTPMethods = void 0, (g = exports.OTPMethods || (exports.OTPMethods = {})).SMS = "sms", g.WhatsApp = "whatsapp", g.Email = "email", exports.StytchEventType = void 0, (_ = exports.StytchEventType || (exports.StytchEventType = {})).MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", _.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", _.OTPsAuthenticate = "OTP_AUTHENTICATE", _.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", _.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", _.PasswordCreate = "PASSWORD_CREATE", _.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", _.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", _.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", _.PasskeyRegister = "PASSKEY_REGISTER", _.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", _.PasskeySkip = "PASSKEY_SKIP", _.PasskeyDone = "PASSKEY_DONE", _.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", _.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", _.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", _.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", _.B2BSSOStart = "B2B_SSO_START", _.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", _.B2BOAuthAuthenticate = "B2B_OAUTH_AUTHENTICATE", _.B2BOAuthDiscoveryAuthenticate = "B2B_OAUTH_DISCOVERY_AUTHENTICATE", _.B2BDiscoveryOrganizationsCreate = "B2B_DISCOVERY_ORGANIZATIONS_CREATE", _.B2BDiscoveryIntermediateSessionExchange = "B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE", _.B2BPasswordAuthenticate = "B2B_PASSWORD_AUTHENTICATE", _.B2BPasswordResetByEmailStart = "B2B_PASSWORD_RESET_BY_EMAIL_START", _.B2BPasswordResetByEmail = "B2B_PASSWORD_RESET_BY_EMAIL", _.B2BPasswordResetBySession = "B2B_PASSWORD_RESET_BY_SESSION", _.B2BSMSOTPSend = "B2B_SMS_OTP_SEND", _.B2BSMSOTPAuthenticate = "B2B_SMS_OTP_AUTHENTICATE", _.B2BTOTPCreate = "B2B_TOTP_CREATE", _.B2BTOTPAuthenticate = "B2B_TOTP_AUTHENTICATE", _.B2BRecoveryCodesRecover = "B2B_RECOVERY_CODES_RECOVER", exports.RNUIProducts = void 0, (A = exports.RNUIProducts || (exports.RNUIProducts = {}))[A.emailMagicLinks = 0] = "emailMagicLinks", A[A.oauth = 1] = "oauth", A[A.otp = 2] = "otp", A[A.passwords = 3] = "passwords";
146
+ }), exports.Products = void 0, (p = exports.Products || (exports.Products = {})).emailMagicLinks = "emailMagicLinks", p.oauth = "oauth", p.otp = "otp", p.crypto = "crypto", p.passwords = "passwords", p.passkeys = "passkeys", exports.OAuthProviders = void 0, (h = exports.OAuthProviders || (exports.OAuthProviders = {})).Google = "google", h.Microsoft = "microsoft", h.Apple = "apple", h.Github = "github", h.GitLab = "gitlab", h.Facebook = "facebook", h.Discord = "discord", h.Salesforce = "salesforce", h.Slack = "slack", h.Amazon = "amazon", h.Bitbucket = "bitbucket", h.LinkedIn = "linkedin", h.Coinbase = "coinbase", h.Twitch = "twitch", h.Twitter = "twitter", h.TikTok = "tiktok", h.Snapchat = "snapchat", h.Figma = "figma", h.Yahoo = "yahoo", exports.Wallets = void 0, (m = exports.Wallets || (exports.Wallets = {})).Vessel = "Vessel", m.Phantom = "Phantom", m.Metamask = "Metamask", m.Coinbase = "Coinbase", m.Binance = "Binance", m.GenericEthereumWallet = "Other Ethereum Wallet", m.GenericSolanaWallet = "Other Solana Wallet", exports.OneTapPositions = void 0, (f = exports.OneTapPositions || (exports.OneTapPositions = {})).embedded = "embedded", f.floating = "floating", f.embeddedOnly = "embeddedOnly", f.floatingOrEmbedded = "floatingOrEmbedded", f.forceLegacyEmbedded = "forceLegacyEmbedded", exports.OTPMethods = void 0, (g = exports.OTPMethods || (exports.OTPMethods = {})).SMS = "sms", g.WhatsApp = "whatsapp", g.Email = "email", exports.StytchEventType = void 0, (_ = exports.StytchEventType || (exports.StytchEventType = {})).MagicLinkLoginOrCreateEvent = "MAGIC_LINK_LOGIN_OR_CREATE", _.OTPsLoginOrCreateEvent = "OTP_LOGIN_OR_CREATE", _.OTPsAuthenticate = "OTP_AUTHENTICATE", _.CryptoWalletAuthenticateStart = "CRYPTO_WALLET_AUTHENTICATE_START", _.CryptoWalletAuthenticate = "CRYPTO_WALLET_AUTHENTICATE", _.PasswordCreate = "PASSWORD_CREATE", _.PasswordAuthenticate = "PASSWORD_AUTHENTICATE", _.PasswordResetByEmailStart = "PASSWORD_RESET_BY_EMAIL_START", _.PasswordResetByEmail = "PASSWORD_RESET_BY_EMAIL", _.PasskeyRegister = "PASSKEY_REGISTER", _.PasskeyAuthenticate = "PASSKEY_AUTHENTICATE", _.PasskeySkip = "PASSKEY_SKIP", _.PasskeyDone = "PASSKEY_DONE", _.B2BMagicLinkEmailLoginOrSignup = "B2B_MAGIC_LINK_EMAIL_LOGIN_OR_SIGNUP", _.B2BMagicLinkAuthenticate = "B2B_MAGIC_LINK_AUTHENTICATE", _.B2BMagicLinkEmailDiscoverySend = "B2B_MAGIC_LINK_EMAIL_DISCOVERY_SEND", _.B2BMagicLinkDiscoveryAuthenticate = "B2B_MAGIC_LINK_DISCOVERY_AUTHENTICATE", _.B2BSSOStart = "B2B_SSO_START", _.B2BSSOAuthenticate = "B2B_SSO_AUTHENTICATE", _.B2BOAuthAuthenticate = "B2B_OAUTH_AUTHENTICATE", _.B2BOAuthDiscoveryAuthenticate = "B2B_OAUTH_DISCOVERY_AUTHENTICATE", _.B2BDiscoveryOrganizationsCreate = "B2B_DISCOVERY_ORGANIZATIONS_CREATE", _.B2BDiscoveryIntermediateSessionExchange = "B2B_DISCOVERY_INTERMEDIATE_SESSION_EXCHANGE", _.B2BPasswordAuthenticate = "B2B_PASSWORD_AUTHENTICATE", _.B2BPasswordResetByEmailStart = "B2B_PASSWORD_RESET_BY_EMAIL_START", _.B2BPasswordResetByEmail = "B2B_PASSWORD_RESET_BY_EMAIL", _.B2BPasswordResetBySession = "B2B_PASSWORD_RESET_BY_SESSION", _.B2BSMSOTPSend = "B2B_SMS_OTP_SEND", _.B2BSMSOTPAuthenticate = "B2B_SMS_OTP_AUTHENTICATE", _.B2BTOTPCreate = "B2B_TOTP_CREATE", _.B2BTOTPAuthenticate = "B2B_TOTP_AUTHENTICATE", _.B2BRecoveryCodesRecover = "B2B_RECOVERY_CODES_RECOVER", exports.RNUIProducts = void 0, (A = exports.RNUIProducts || (exports.RNUIProducts = {}))[A.emailMagicLinks = 0] = "emailMagicLinks", A[A.oauth = 1] = "oauth", A[A.otp = 2] = "otp", A[A.passwords = 3] = "passwords";
147
147
  var v,
148
148
  y,
149
149
  b,
@@ -4041,7 +4041,7 @@ var bt = /*#__PURE__*/function () {
4041
4041
  },
4042
4042
  sdk: {
4043
4043
  identifier: "Stytch.js Javascript SDK",
4044
- version: "4.7.8"
4044
+ version: "4.8.0"
4045
4045
  }
4046
4046
  });
4047
4047
  }
package/dist/index.d.ts CHANGED
@@ -24,6 +24,7 @@ type GoogleOneTapOAuthOptions = {
24
24
  signup_redirect_url?: string;
25
25
  /**
26
26
  * An optional callback function that runs when a user explicitly cancels out of the one tap flow.
27
+ * This callback may not be invoked immediately or at all depending on the behavior of the browser and Google's SDK.
27
28
  */
28
29
  onOneTapCancelled?: () => void;
29
30
  };
@@ -24,6 +24,7 @@ type GoogleOneTapOAuthOptions = {
24
24
  signup_redirect_url?: string;
25
25
  /**
26
26
  * An optional callback function that runs when a user explicitly cancels out of the one tap flow.
27
+ * This callback may not be invoked immediately or at all depending on the behavior of the browser and Google's SDK.
27
28
  */
28
29
  onOneTapCancelled?: () => void;
29
30
  };