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