arky-sdk 0.11.0 → 0.11.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.
package/dist/index.cjs CHANGED
@@ -65,16 +65,14 @@ var createActionApi = (apiConfig, lifecycle) => ({
65
65
  var createStorefrontApi = (apiConfig, updateContactSession, lifecycle) => {
66
66
  const base = "/v1/storefront";
67
67
  function persistIdentification(result) {
68
- const sessionToken = result.token?.token;
68
+ const sessionToken = result.token?.token ?? apiConfig.authStorage.getTokens()?.access_token;
69
69
  if (sessionToken) {
70
70
  updateContactSession(() => ({
71
71
  sessionToken,
72
72
  contact: result.contact
73
73
  }));
74
74
  } else {
75
- updateContactSession(
76
- (current) => current ? { ...current, contact: result.contact } : null
77
- );
75
+ updateContactSession(() => null);
78
76
  }
79
77
  return result;
80
78
  }
@@ -5830,7 +5828,7 @@ function initialize(publishableKey, options = {}) {
5830
5828
  }
5831
5829
 
5832
5830
  // src/index.ts
5833
- var SDK_VERSION = "0.11.0";
5831
+ var SDK_VERSION = "0.11.2";
5834
5832
  var SUPPORTED_FRAMEWORKS = [
5835
5833
  "astro",
5836
5834
  "react",