@saasquatch/squatch-js 2.8.1-0 → 2.8.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.
@@ -1796,11 +1796,11 @@ function _getAutoConfig() {
1796
1796
  _log$3("No _saasquatchExtra param");
1797
1797
  return;
1798
1798
  }
1799
- const config = validateConfig();
1800
- if (!config.domain || !config.tenantAlias) {
1801
- _log$3(
1802
- "domain and tenantAlias must be provided in config to use _saasquatchExtra"
1803
- );
1799
+ const config = validateConfig({
1800
+ tenantAlias: "UNKNOWN"
1801
+ });
1802
+ if (!config.domain) {
1803
+ _log$3("domain must be provided in config to use _saasquatchExtra");
1804
1804
  return;
1805
1805
  }
1806
1806
  let raw;
@@ -1814,7 +1814,8 @@ function _getAutoConfig() {
1814
1814
  return domain.replace(/^https?:\/\//, "");
1815
1815
  }
1816
1816
  const normalizedDomain = normalizeDomain(config.domain);
1817
- const widgetConfig = (_a2 = raw == null ? void 0 : raw[normalizedDomain]) == null ? void 0 : _a2[config.tenantAlias];
1817
+ const tenantAlias = Object.keys((raw == null ? void 0 : raw[normalizedDomain]) || {})[0];
1818
+ const widgetConfig = (_a2 = raw == null ? void 0 : raw[normalizedDomain]) == null ? void 0 : _a2[tenantAlias];
1818
1819
  if (!widgetConfig) {
1819
1820
  _log$3("_saasquatchExtra did not have an expected structure");
1820
1821
  return void 0;
@@ -1828,8 +1829,7 @@ function _getAutoConfig() {
1828
1829
  },
1829
1830
  squatchConfig: {
1830
1831
  ...config,
1831
- domain: config.domain,
1832
- tenantAlias: config.tenantAlias
1832
+ tenantAlias
1833
1833
  }
1834
1834
  };
1835
1835
  }