@blotoutio/edgetag-sdk-js 0.42.0 → 0.42.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
@@ -364,7 +364,7 @@ const getStandardPayload = (payload) => {
364
364
  referrer: getReferrer(),
365
365
  search: getSearch(),
366
366
  locale: getLocale(),
367
- sdkVersion: "0.42.0" ,
367
+ sdkVersion: "0.42.1" ,
368
368
  ...(payload || {}),
369
369
  };
370
370
  let storage = {};
@@ -791,6 +791,7 @@ const handleConsent = (consent, options) => {
791
791
  getEdgeData: handleGetData,
792
792
  keyName: `${keyPrefix}Store`,
793
793
  executionContext,
794
+ session: null,
794
795
  });
795
796
  }
796
797
  }
@@ -917,10 +918,11 @@ const handleCapture = (provider, params, capture) => {
917
918
  });
918
919
  };
919
920
 
920
- const handleManifest = (manifest, consent) => {
921
+ const handleManifest = (response, consent) => {
921
922
  const providerPackages = getProvidersPackage();
922
923
  const userId = handleGetUserId();
923
924
  const executionContext = new Map();
925
+ const manifest = response.result;
924
926
  manifest.forEach((provider) => {
925
927
  addConfiguredTag(provider.package, provider.tagName);
926
928
  addProviderVariable(provider.package, provider.variables, provider.tagName);
@@ -941,6 +943,7 @@ const handleManifest = (manifest, consent) => {
941
943
  if (hasConsent) {
942
944
  pkg.init({
943
945
  userId,
946
+ session: response.session,
944
947
  baseUrl: getUrl(),
945
948
  manifest: provider,
946
949
  sendTag,
@@ -998,7 +1001,7 @@ const handleInit = (preferences) => {
998
1001
  saveConsent(result.consent);
999
1002
  }
1000
1003
  setIsNewUSer(result.isNewUser);
1001
- handleManifest(result.result, consent || result.consent);
1004
+ handleManifest(result, consent || result.consent);
1002
1005
  try {
1003
1006
  window.dispatchEvent(new CustomEvent('edgetag-initialized', {
1004
1007
  detail: {
@@ -1006,7 +1009,7 @@ const handleInit = (preferences) => {
1006
1009
  isNewUser: result.isNewUser,
1007
1010
  consent: result.consent,
1008
1011
  consentSetting: result.consentSetting,
1009
- isNewSession: result.isNewSession,
1012
+ session: result.session,
1010
1013
  },
1011
1014
  }));
1012
1015
  }
package/index.mjs CHANGED
@@ -362,7 +362,7 @@ const getStandardPayload = (payload) => {
362
362
  referrer: getReferrer(),
363
363
  search: getSearch(),
364
364
  locale: getLocale(),
365
- sdkVersion: "0.42.0" ,
365
+ sdkVersion: "0.42.1" ,
366
366
  ...(payload || {}),
367
367
  };
368
368
  let storage = {};
@@ -789,6 +789,7 @@ const handleConsent = (consent, options) => {
789
789
  getEdgeData: handleGetData,
790
790
  keyName: `${keyPrefix}Store`,
791
791
  executionContext,
792
+ session: null,
792
793
  });
793
794
  }
794
795
  }
@@ -915,10 +916,11 @@ const handleCapture = (provider, params, capture) => {
915
916
  });
916
917
  };
917
918
 
918
- const handleManifest = (manifest, consent) => {
919
+ const handleManifest = (response, consent) => {
919
920
  const providerPackages = getProvidersPackage();
920
921
  const userId = handleGetUserId();
921
922
  const executionContext = new Map();
923
+ const manifest = response.result;
922
924
  manifest.forEach((provider) => {
923
925
  addConfiguredTag(provider.package, provider.tagName);
924
926
  addProviderVariable(provider.package, provider.variables, provider.tagName);
@@ -939,6 +941,7 @@ const handleManifest = (manifest, consent) => {
939
941
  if (hasConsent) {
940
942
  pkg.init({
941
943
  userId,
944
+ session: response.session,
942
945
  baseUrl: getUrl(),
943
946
  manifest: provider,
944
947
  sendTag,
@@ -996,7 +999,7 @@ const handleInit = (preferences) => {
996
999
  saveConsent(result.consent);
997
1000
  }
998
1001
  setIsNewUSer(result.isNewUser);
999
- handleManifest(result.result, consent || result.consent);
1002
+ handleManifest(result, consent || result.consent);
1000
1003
  try {
1001
1004
  window.dispatchEvent(new CustomEvent('edgetag-initialized', {
1002
1005
  detail: {
@@ -1004,7 +1007,7 @@ const handleInit = (preferences) => {
1004
1007
  isNewUser: result.isNewUser,
1005
1008
  consent: result.consent,
1006
1009
  consentSetting: result.consentSetting,
1007
- isNewSession: result.isNewSession,
1010
+ session: result.session,
1008
1011
  },
1009
1012
  }));
1010
1013
  }
package/internal.d.ts CHANGED
@@ -1,4 +1,9 @@
1
- import { Library, ProvidersConfig, UserConsent } from '@blotoutio/cdn/types'
1
+ import {
2
+ ConsentSetting,
3
+ Library,
4
+ ProvidersConfig,
5
+ UserConsent,
6
+ } from '@blotoutio/cdn/types'
2
7
  import { UserKey, Data } from './index'
3
8
 
4
9
  type Navigator = {
@@ -40,3 +45,14 @@ type PostPayload = {
40
45
  data?: Data
41
46
  storage?: Data
42
47
  }
48
+
49
+ type InitResponse = {
50
+ result: Manifest[]
51
+ userId?: string
52
+ consent: UserConsent
53
+ consentSetting: ConsentSetting
54
+ isNewUser?: boolean
55
+ session: {
56
+ isNewSession: boolean
57
+ }
58
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/edgetag-sdk-js",
3
- "version": "0.42.0",
3
+ "version": "0.42.1",
4
4
  "description": "JS SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",