@blotoutio/edgetag-sdk-js 1.6.1 → 1.7.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.
package/index.cjs.js CHANGED
@@ -921,7 +921,7 @@ const getStandardPayload = (destination, payload) => {
921
921
  referrer: getReferrer(destination),
922
922
  search: getSearch(destination),
923
923
  locale: getLocale(),
924
- sdkVersion: "1.6.1" ,
924
+ sdkVersion: "1.7.1" ,
925
925
  ...(payload || {}),
926
926
  };
927
927
  let storage = {};
@@ -1611,10 +1611,17 @@ const handleInit = (preferences) => {
1611
1611
  if (fallbackId) {
1612
1612
  url.searchParams.set('fallbackUserId', fallbackId);
1613
1613
  }
1614
- const dbIndex = getDataPerKey(preferences.edgeURL, 'local', tagStorage, storageIdKey);
1614
+ let dbIndex;
1615
+ if (preferences.storageId != null) {
1616
+ dbIndex = preferences.storageId;
1617
+ }
1618
+ else {
1619
+ dbIndex = getDataPerKey(preferences.edgeURL, 'local', tagStorage, storageIdKey);
1620
+ }
1615
1621
  if (dbIndex != null && !isNaN(dbIndex)) {
1616
1622
  url.searchParams.set('storageId', dbIndex.toString());
1617
1623
  }
1624
+ url.searchParams.set('pageUrl', getPageUrl(preferences.edgeURL));
1618
1625
  getRequest(url.href)
1619
1626
  .then((result) => {
1620
1627
  var _a;
package/index.d.ts CHANGED
@@ -43,6 +43,7 @@ export type InitPreferences = {
43
43
  disableConsentCheck?: boolean
44
44
  userId?: string
45
45
  fallbackUserId?: string
46
+ storageId?: number
46
47
  providers?: ProviderInit[]
47
48
  afterManifestEvents?: Stub[]
48
49
  skipZeroPurchaseEvent?: boolean
package/index.mjs CHANGED
@@ -919,7 +919,7 @@ const getStandardPayload = (destination, payload) => {
919
919
  referrer: getReferrer(destination),
920
920
  search: getSearch(destination),
921
921
  locale: getLocale(),
922
- sdkVersion: "1.6.1" ,
922
+ sdkVersion: "1.7.1" ,
923
923
  ...(payload || {}),
924
924
  };
925
925
  let storage = {};
@@ -1609,10 +1609,17 @@ const handleInit = (preferences) => {
1609
1609
  if (fallbackId) {
1610
1610
  url.searchParams.set('fallbackUserId', fallbackId);
1611
1611
  }
1612
- const dbIndex = getDataPerKey(preferences.edgeURL, 'local', tagStorage, storageIdKey);
1612
+ let dbIndex;
1613
+ if (preferences.storageId != null) {
1614
+ dbIndex = preferences.storageId;
1615
+ }
1616
+ else {
1617
+ dbIndex = getDataPerKey(preferences.edgeURL, 'local', tagStorage, storageIdKey);
1618
+ }
1613
1619
  if (dbIndex != null && !isNaN(dbIndex)) {
1614
1620
  url.searchParams.set('storageId', dbIndex.toString());
1615
1621
  }
1622
+ url.searchParams.set('pageUrl', getPageUrl(preferences.edgeURL));
1616
1623
  getRequest(url.href)
1617
1624
  .then((result) => {
1618
1625
  var _a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/edgetag-sdk-js",
3
- "version": "1.6.1",
3
+ "version": "1.7.1",
4
4
  "description": "JS SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",