@blotoutio/edgetag-sdk-js 1.10.0 → 1.10.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/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.10.0" ,
924
+ sdkVersion: "1.10.2" ,
925
925
  ...(payload || {}),
926
926
  };
927
927
  let storage = {};
@@ -1099,6 +1099,7 @@ const processTag = (destination, eventName, data = {}, providers, options) => {
1099
1099
  const requestCountry = getSetting(destination, 'geoCountry') || null;
1100
1100
  const requestRegion = getSetting(destination, 'geoRegion') || null;
1101
1101
  const isEURequest = getSetting(destination, 'isEURequest') || false;
1102
+ const sessionId = getSetting(destination, 'sessionId');
1102
1103
  const userId = getUserId$1(destination);
1103
1104
  const providerData = {};
1104
1105
  const consent = getConsent$1(destination);
@@ -1136,6 +1137,7 @@ const processTag = (destination, eventName, data = {}, providers, options) => {
1136
1137
  : data;
1137
1138
  result[variable.tagName] = pkg.tag({
1138
1139
  userId,
1140
+ sessionId,
1139
1141
  eventName,
1140
1142
  eventId,
1141
1143
  data: JSON.parse(JSON.stringify(payload)),
@@ -1621,6 +1623,9 @@ const handleInit = (preferences) => {
1621
1623
  if (dbIndex != null && !isNaN(dbIndex)) {
1622
1624
  url.searchParams.set('storageId', dbIndex.toString());
1623
1625
  }
1626
+ if (preferences.sessionId) {
1627
+ url.searchParams.set('sessionId', preferences.sessionId);
1628
+ }
1624
1629
  url.searchParams.set('pageUrl', getPageUrl(preferences.edgeURL));
1625
1630
  getRequest(url.href)
1626
1631
  .then((result) => {
@@ -1644,6 +1649,7 @@ const handleInit = (preferences) => {
1644
1649
  isNewUser: result.isNewUser,
1645
1650
  consent: getConsent$1(preferences.edgeURL) || result.consent,
1646
1651
  userId: result.userId,
1652
+ sessionId: result.session.sessionId,
1647
1653
  manifest: result.result,
1648
1654
  browserPackages: Object.values(providers),
1649
1655
  storageId: result.storageId,
package/index.d.ts CHANGED
@@ -47,6 +47,7 @@ export type InitPreferences = {
47
47
  providers?: ProviderInit[]
48
48
  afterManifestEvents?: Stub[]
49
49
  skipZeroPurchaseEvent?: boolean
50
+ sessionId?: string
50
51
  }
51
52
 
52
53
  export declare const init: (preferences: InitPreferences) => void
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.10.0" ,
922
+ sdkVersion: "1.10.2" ,
923
923
  ...(payload || {}),
924
924
  };
925
925
  let storage = {};
@@ -1097,6 +1097,7 @@ const processTag = (destination, eventName, data = {}, providers, options) => {
1097
1097
  const requestCountry = getSetting(destination, 'geoCountry') || null;
1098
1098
  const requestRegion = getSetting(destination, 'geoRegion') || null;
1099
1099
  const isEURequest = getSetting(destination, 'isEURequest') || false;
1100
+ const sessionId = getSetting(destination, 'sessionId');
1100
1101
  const userId = getUserId$1(destination);
1101
1102
  const providerData = {};
1102
1103
  const consent = getConsent$1(destination);
@@ -1134,6 +1135,7 @@ const processTag = (destination, eventName, data = {}, providers, options) => {
1134
1135
  : data;
1135
1136
  result[variable.tagName] = pkg.tag({
1136
1137
  userId,
1138
+ sessionId,
1137
1139
  eventName,
1138
1140
  eventId,
1139
1141
  data: JSON.parse(JSON.stringify(payload)),
@@ -1619,6 +1621,9 @@ const handleInit = (preferences) => {
1619
1621
  if (dbIndex != null && !isNaN(dbIndex)) {
1620
1622
  url.searchParams.set('storageId', dbIndex.toString());
1621
1623
  }
1624
+ if (preferences.sessionId) {
1625
+ url.searchParams.set('sessionId', preferences.sessionId);
1626
+ }
1622
1627
  url.searchParams.set('pageUrl', getPageUrl(preferences.edgeURL));
1623
1628
  getRequest(url.href)
1624
1629
  .then((result) => {
@@ -1642,6 +1647,7 @@ const handleInit = (preferences) => {
1642
1647
  isNewUser: result.isNewUser,
1643
1648
  consent: getConsent$1(preferences.edgeURL) || result.consent,
1644
1649
  userId: result.userId,
1650
+ sessionId: result.session.sessionId,
1645
1651
  manifest: result.result,
1646
1652
  browserPackages: Object.values(providers),
1647
1653
  storageId: result.storageId,
package/internal.d.ts CHANGED
@@ -57,6 +57,7 @@ type InitResponse = {
57
57
  isNewUser?: boolean
58
58
  session: {
59
59
  isNewSession: boolean
60
+ sessionId: string | undefined
60
61
  }
61
62
  currency?: {
62
63
  providers: string[]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/edgetag-sdk-js",
3
- "version": "1.10.0",
3
+ "version": "1.10.2",
4
4
  "description": "JS SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",