@stytch/vanilla-js 5.44.1 → 5.44.2

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.
@@ -4720,7 +4720,7 @@ var HeadlessOAuthClient = /*#__PURE__*/function (_HeadlessOAuthClient$) {
4720
4720
  _inherits2(HeadlessOAuthClient, _HeadlessOAuthClient$);
4721
4721
  return _createClass2(HeadlessOAuthClient);
4722
4722
  }(HeadlessOAuthClient$1);
4723
- var version = "5.44.1";
4723
+ var version = "5.44.2";
4724
4724
  var NetworkClient = /*#__PURE__*/function () {
4725
4725
  function NetworkClient(_publicToken, _subscriptionDataLayer, _liveAPIURL, _testAPIURL, additionalTelemetryDataFn) {
4726
4726
  _classCallCheck2(this, NetworkClient);
@@ -5925,6 +5925,12 @@ var buildFinalConfig = function buildFinalConfig(clientName) {
5925
5925
  }
5926
5926
  };
5927
5927
  };
5928
+ var hasCustomApiEndpoint = function hasCustomApiEndpoint(token) {
5929
+ var rawOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5930
+ var customBaseUrl = rawOptions.customBaseUrl,
5931
+ endpointOptions = rawOptions.endpointOptions;
5932
+ return isTestPublicToken(token) ? !!(customBaseUrl || (endpointOptions === null || endpointOptions === void 0 ? void 0 : endpointOptions.testApiDomain)) : !!(customBaseUrl || (endpointOptions === null || endpointOptions === void 0 ? void 0 : endpointOptions.apiDomain));
5933
+ };
5928
5934
  function isHandledTokenType(handledTypes, tokenType) {
5929
5935
  return handledTypes.includes(tokenType);
5930
5936
  }
@@ -6022,7 +6028,7 @@ var StytchHeadlessClient = /*#__PURE__*/_createClass2(function StytchHeadlessCli
6022
6028
  checkPublicToken(publicTokenRaw);
6023
6029
  var _PUBLIC_TOKEN = publicTokenRaw !== null && publicTokenRaw !== void 0 ? publicTokenRaw : '';
6024
6030
  var config = buildFinalConfig(this.constructor.name, options);
6025
- var usingCustomApiEndpoint = !!config.endpoints.liveAPIURL;
6031
+ var usingCustomApiEndpoint = hasCustomApiEndpoint(_PUBLIC_TOKEN, options);
6026
6032
  this._dataLayer = getConsumerDataLayer(_PUBLIC_TOKEN, config);
6027
6033
  this._subscriptionService = new ConsumerSubscriptionService(_PUBLIC_TOKEN, this._dataLayer, {
6028
6034
  usingCustomApiEndpoint: usingCustomApiEndpoint