@blotoutio/edgetag-sdk-js 0.46.0 → 0.47.0

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.
Files changed (3) hide show
  1. package/index.cjs.js +15 -3
  2. package/index.mjs +15 -3
  3. package/package.json +1 -1
package/index.cjs.js CHANGED
@@ -373,7 +373,7 @@ const getStandardPayload = (payload) => {
373
373
  referrer: getReferrer(),
374
374
  search: getSearch(),
375
375
  locale: getLocale(),
376
- sdkVersion: "0.46.0" ,
376
+ sdkVersion: "0.47.0" ,
377
377
  ...(payload || {}),
378
378
  };
379
379
  let storage = {};
@@ -839,6 +839,17 @@ const handleConsent = (consent, options) => {
839
839
  });
840
840
  }
841
841
  }
842
+ try {
843
+ window.dispatchEvent(new CustomEvent('edgetag-consent', {
844
+ detail: {
845
+ oldConsent: existingConsent,
846
+ newConsent: consent,
847
+ },
848
+ }));
849
+ }
850
+ catch {
851
+ // do nothing
852
+ }
842
853
  /* Calling Consent for all providers, not on instance level */
843
854
  for (const pkg of Object.values(providerPackages)) {
844
855
  if (!pkg || !pkg.name || !pkg.consent) {
@@ -866,16 +877,17 @@ const saveDataToEdge = (key, value, provider) => {
866
877
  if (!value) {
867
878
  return;
868
879
  }
880
+ let updatedValue = value;
869
881
  if (typeof value !== 'string') {
870
882
  try {
871
- value = JSON.stringify(value);
883
+ updatedValue = JSON.stringify(value);
872
884
  }
873
885
  catch {
874
886
  log('Error stringify value.');
875
887
  return;
876
888
  }
877
889
  }
878
- handleData({ [`${provider}::${key}`]: value });
890
+ handleData({ [`${provider}::${key}`]: updatedValue });
879
891
  };
880
892
  const handleCaptureQuery = (provider, key, persistType, map) => {
881
893
  try {
package/index.mjs CHANGED
@@ -371,7 +371,7 @@ const getStandardPayload = (payload) => {
371
371
  referrer: getReferrer(),
372
372
  search: getSearch(),
373
373
  locale: getLocale(),
374
- sdkVersion: "0.46.0" ,
374
+ sdkVersion: "0.47.0" ,
375
375
  ...(payload || {}),
376
376
  };
377
377
  let storage = {};
@@ -837,6 +837,17 @@ const handleConsent = (consent, options) => {
837
837
  });
838
838
  }
839
839
  }
840
+ try {
841
+ window.dispatchEvent(new CustomEvent('edgetag-consent', {
842
+ detail: {
843
+ oldConsent: existingConsent,
844
+ newConsent: consent,
845
+ },
846
+ }));
847
+ }
848
+ catch {
849
+ // do nothing
850
+ }
840
851
  /* Calling Consent for all providers, not on instance level */
841
852
  for (const pkg of Object.values(providerPackages)) {
842
853
  if (!pkg || !pkg.name || !pkg.consent) {
@@ -864,16 +875,17 @@ const saveDataToEdge = (key, value, provider) => {
864
875
  if (!value) {
865
876
  return;
866
877
  }
878
+ let updatedValue = value;
867
879
  if (typeof value !== 'string') {
868
880
  try {
869
- value = JSON.stringify(value);
881
+ updatedValue = JSON.stringify(value);
870
882
  }
871
883
  catch {
872
884
  log('Error stringify value.');
873
885
  return;
874
886
  }
875
887
  }
876
- handleData({ [`${provider}::${key}`]: value });
888
+ handleData({ [`${provider}::${key}`]: updatedValue });
877
889
  };
878
890
  const handleCaptureQuery = (provider, key, persistType, map) => {
879
891
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/edgetag-sdk-js",
3
- "version": "0.46.0",
3
+ "version": "0.47.0",
4
4
  "description": "JS SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",