@blotoutio/edgetag-sdk-browser 0.22.0 → 0.22.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.
Files changed (2) hide show
  1. package/index.js +13 -7
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -510,7 +510,7 @@
510
510
  referrer: getReferrer(),
511
511
  search: getSearch(),
512
512
  locale: getLocale(),
513
- sdkVersion: "0.22.0" ,
513
+ sdkVersion: "0.22.2" ,
514
514
  ...(payload || {}),
515
515
  };
516
516
  let storage = {};
@@ -558,12 +558,14 @@
558
558
  setConsent(consent);
559
559
  savePerKey('local', tagStorage, consent, consentKey);
560
560
  };
561
- const handleConsent = (consent) => {
561
+ const handleConsent = (consent, options) => {
562
562
  const payload = {
563
563
  consentString: consent,
564
564
  };
565
565
  saveConsent(consent);
566
- postRequest(getConsentURL(), payload).catch(error);
566
+ if (!(options === null || options === void 0 ? void 0 : options.localSave)) {
567
+ postRequest(getConsentURL(), payload).catch(error);
568
+ }
567
569
  };
568
570
  const setConsent = (newConsent) => {
569
571
  memoryConsent = newConsent;
@@ -858,6 +860,10 @@
858
860
  if (result.userId) {
859
861
  setUserId(result.userId);
860
862
  }
863
+ const consent = getConsent();
864
+ if (result.consent && !consent) {
865
+ saveConsent(result.consent);
866
+ }
861
867
  handleManifest(result.result);
862
868
  })
863
869
  .catch(error);
@@ -909,8 +915,8 @@
909
915
  const tag = (name, data, providers, options) => {
910
916
  handleTag(name, data, providers, options);
911
917
  };
912
- const consent = (consent) => {
913
- handleConsent(consent);
918
+ const consent = (consent, options) => {
919
+ handleConsent(consent, options);
914
920
  };
915
921
  const user = (key, value, providers, options) => {
916
922
  handleUser(key, value, providers, options);
@@ -939,8 +945,8 @@
939
945
  tag(name, data, providers, options);
940
946
  }
941
947
 
942
- consent(consentString) {
943
- consent(consentString);
948
+ consent(consentString, consentOptions) {
949
+ consent(consentString, consentOptions);
944
950
  }
945
951
 
946
952
  user(key, value, providers, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/edgetag-sdk-browser",
3
- "version": "0.22.0",
3
+ "version": "0.22.2",
4
4
  "description": "Browser SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",