@syntrologie/runtime-sdk 2.6.0-canary.4 → 2.6.0-canary.6

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.
@@ -3358,7 +3358,7 @@ function getAntiFlickerSnippet(config = {}) {
3358
3358
  }
3359
3359
 
3360
3360
  // src/version.ts
3361
- var SDK_VERSION = "2.6.0-canary.4";
3361
+ var SDK_VERSION = "2.6.0-canary.6";
3362
3362
 
3363
3363
  // src/types.ts
3364
3364
  var SDK_SCHEMA_VERSION = "2.0";
@@ -9620,15 +9620,10 @@ var StateStore = class {
9620
9620
  __publicField(this, "namespacedStorages", /* @__PURE__ */ new Map());
9621
9621
  var _a2;
9622
9622
  this.namespace = (_a2 = options.namespace) != null ? _a2 : DEFAULT_NAMESPACE;
9623
+ const isUsable = (s) => typeof s === "object" && s !== null && typeof s.setItem === "function";
9623
9624
  if (typeof window !== "undefined") {
9624
- this.session = createBrowserStorage(
9625
- typeof sessionStorage !== "undefined" ? sessionStorage : void 0,
9626
- this.namespace
9627
- );
9628
- this.user = createBrowserStorage(
9629
- typeof localStorage !== "undefined" ? localStorage : void 0,
9630
- this.namespace
9631
- );
9625
+ this.session = isUsable(window.sessionStorage) ? createBrowserStorage(window.sessionStorage, this.namespace) : createMemoryStorage(this.namespace);
9626
+ this.user = isUsable(window.localStorage) ? createBrowserStorage(window.localStorage, this.namespace) : createMemoryStorage(this.namespace);
9632
9627
  } else {
9633
9628
  this.session = createMemoryStorage(this.namespace);
9634
9629
  this.user = createMemoryStorage(this.namespace);
@@ -11368,4 +11363,4 @@ export {
11368
11363
  encodeToken,
11369
11364
  Syntro
11370
11365
  };
11371
- //# sourceMappingURL=chunk-DLW4A4JJ.js.map
11366
+ //# sourceMappingURL=chunk-6KBZVVD3.js.map