@uniformdev/context 19.190.1-alpha.3 → 19.190.1-alpha.5

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.
@@ -1,4 +1,4 @@
1
- import { aC as paths$7, N as ManifestV2 } from '../types-o4ZU_qKY.mjs';
1
+ import { aC as paths$7, N as ManifestV2 } from '../types-gG_D1dEo.mjs';
2
2
  import 'mitt';
3
3
 
4
4
  type LimitPolicy = <ReturnValue>(func: () => Promise<ReturnValue>) => Promise<ReturnValue>;
package/dist/api/api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { aC as paths$7, N as ManifestV2 } from '../types-o4ZU_qKY.js';
1
+ import { aC as paths$7, N as ManifestV2 } from '../types-gG_D1dEo.js';
2
2
  import 'mitt';
3
3
 
4
4
  type LimitPolicy = <ReturnValue>(func: () => Promise<ReturnValue>) => Promise<ReturnValue>;
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, g as DevToolsEvents } from './types-o4ZU_qKY.mjs';
2
- export { _ as AggregateDimensionInput, a4 as BehaviorTag, h as CONTEXTUAL_EDITING_TEST_NAME, i as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, n as Context, l as ContextEvents, m as ContextInstance, j as ContextOptions, az as ContextState, aA as ContextStateUpdate, J as CriteriaEvaluatorParameters, I as CriteriaEvaluatorResult, an as DecayOptions, q as DevToolsActions, t as DevToolsDataEvent, r as DevToolsEvent, x as DevToolsForgetEvent, u as DevToolsHelloEvent, s as DevToolsLogEvent, w as DevToolsRawCommandsEvent, p as DevToolsState, o as DevToolsUiVersion, v as DevToolsUpdateEvent, a1 as DimensionMatch, X as EnrichmentCategory, au as EnrichmentData, ax as EventData, aB as GoalStateUpdate, at as Goals, H as GroupCriteriaEvaluator, ag as IdentifyCommand, F as LogMessageGroup, E as LogMessageSingle, y as LogMessages, G as ManifestInstance, N as ManifestV2, M as MessageCategory, B as MessageFunc, ab as ModifyScoreCommand, ac as ModifySessionScoreCommand, Y as NumberMatch, P as PersonalizationEvent, Q as PersonalizationManifest, av as PersonalizeControlVariant, a2 as PersonalizeOptions, aw as PersonalizeVariants, a6 as PersonalizedResult, a5 as PersonalizedVariant, ar as Quirks, al as SERVER_STATE_ID, ak as ServerToClientTransitionState, ad as SetConsentCommand, ah as SetControlGroupCommand, aa as SetGoalCommand, ai as SetPersonalizeVariantControlCommand, ae as SetQuirkCommand, af as SetTestCommand, z as Severity, R as Signal, W as SignalCriteria, U as SignalCriteriaGroup, K as SignalData, a9 as StorageCommand, Z as TestDefinition, k as TestEvent, $ as TestOptions, a8 as TestResult, a7 as TestVariant, as as Tests, am as TransitionDataStoreEvents, aq as VisitorDataStore, ap as VisitorDataStoreEvents, ao as VisitorDataStoreOptions, aj as areCommandsEqual, ay as emptyVisitorData, a3 as personalizeVariations, a0 as testVariations } from './types-o4ZU_qKY.mjs';
1
+ import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, g as DevToolsEvents } from './types-gG_D1dEo.mjs';
2
+ export { _ as AggregateDimensionInput, a4 as BehaviorTag, h as CONTEXTUAL_EDITING_TEST_NAME, i as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, n as Context, l as ContextEvents, m as ContextInstance, j as ContextOptions, az as ContextState, aA as ContextStateUpdate, J as CriteriaEvaluatorParameters, I as CriteriaEvaluatorResult, an as DecayOptions, q as DevToolsActions, t as DevToolsDataEvent, r as DevToolsEvent, x as DevToolsForgetEvent, u as DevToolsHelloEvent, s as DevToolsLogEvent, w as DevToolsRawCommandsEvent, p as DevToolsState, o as DevToolsUiVersion, v as DevToolsUpdateEvent, a1 as DimensionMatch, X as EnrichmentCategory, au as EnrichmentData, ax as EventData, aB as GoalStateUpdate, at as Goals, H as GroupCriteriaEvaluator, ag as IdentifyCommand, F as LogMessageGroup, E as LogMessageSingle, y as LogMessages, G as ManifestInstance, N as ManifestV2, M as MessageCategory, B as MessageFunc, ab as ModifyScoreCommand, ac as ModifySessionScoreCommand, Y as NumberMatch, P as PersonalizationEvent, Q as PersonalizationManifest, av as PersonalizeControlVariant, a2 as PersonalizeOptions, aw as PersonalizeVariants, a6 as PersonalizedResult, a5 as PersonalizedVariant, ar as Quirks, al as SERVER_STATE_ID, ak as ServerToClientTransitionState, ad as SetConsentCommand, ah as SetControlGroupCommand, aa as SetGoalCommand, ai as SetPersonalizeVariantControlCommand, ae as SetQuirkCommand, af as SetTestCommand, z as Severity, R as Signal, W as SignalCriteria, U as SignalCriteriaGroup, K as SignalData, a9 as StorageCommand, Z as TestDefinition, k as TestEvent, $ as TestOptions, a8 as TestResult, a7 as TestVariant, as as Tests, am as TransitionDataStoreEvents, aq as VisitorDataStore, ap as VisitorDataStoreEvents, ao as VisitorDataStoreOptions, aj as areCommandsEqual, ay as emptyVisitorData, a3 as personalizeVariations, a0 as testVariations } from './types-gG_D1dEo.mjs';
3
3
  import Cookies from 'js-cookie';
4
4
  import 'mitt';
5
5
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, g as DevToolsEvents } from './types-o4ZU_qKY.js';
2
- export { _ as AggregateDimensionInput, a4 as BehaviorTag, h as CONTEXTUAL_EDITING_TEST_NAME, i as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, n as Context, l as ContextEvents, m as ContextInstance, j as ContextOptions, az as ContextState, aA as ContextStateUpdate, J as CriteriaEvaluatorParameters, I as CriteriaEvaluatorResult, an as DecayOptions, q as DevToolsActions, t as DevToolsDataEvent, r as DevToolsEvent, x as DevToolsForgetEvent, u as DevToolsHelloEvent, s as DevToolsLogEvent, w as DevToolsRawCommandsEvent, p as DevToolsState, o as DevToolsUiVersion, v as DevToolsUpdateEvent, a1 as DimensionMatch, X as EnrichmentCategory, au as EnrichmentData, ax as EventData, aB as GoalStateUpdate, at as Goals, H as GroupCriteriaEvaluator, ag as IdentifyCommand, F as LogMessageGroup, E as LogMessageSingle, y as LogMessages, G as ManifestInstance, N as ManifestV2, M as MessageCategory, B as MessageFunc, ab as ModifyScoreCommand, ac as ModifySessionScoreCommand, Y as NumberMatch, P as PersonalizationEvent, Q as PersonalizationManifest, av as PersonalizeControlVariant, a2 as PersonalizeOptions, aw as PersonalizeVariants, a6 as PersonalizedResult, a5 as PersonalizedVariant, ar as Quirks, al as SERVER_STATE_ID, ak as ServerToClientTransitionState, ad as SetConsentCommand, ah as SetControlGroupCommand, aa as SetGoalCommand, ai as SetPersonalizeVariantControlCommand, ae as SetQuirkCommand, af as SetTestCommand, z as Severity, R as Signal, W as SignalCriteria, U as SignalCriteriaGroup, K as SignalData, a9 as StorageCommand, Z as TestDefinition, k as TestEvent, $ as TestOptions, a8 as TestResult, a7 as TestVariant, as as Tests, am as TransitionDataStoreEvents, aq as VisitorDataStore, ap as VisitorDataStoreEvents, ao as VisitorDataStoreOptions, aj as areCommandsEqual, ay as emptyVisitorData, a3 as personalizeVariations, a0 as testVariations } from './types-o4ZU_qKY.js';
1
+ import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, g as DevToolsEvents } from './types-gG_D1dEo.js';
2
+ export { _ as AggregateDimensionInput, a4 as BehaviorTag, h as CONTEXTUAL_EDITING_TEST_NAME, i as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, n as Context, l as ContextEvents, m as ContextInstance, j as ContextOptions, az as ContextState, aA as ContextStateUpdate, J as CriteriaEvaluatorParameters, I as CriteriaEvaluatorResult, an as DecayOptions, q as DevToolsActions, t as DevToolsDataEvent, r as DevToolsEvent, x as DevToolsForgetEvent, u as DevToolsHelloEvent, s as DevToolsLogEvent, w as DevToolsRawCommandsEvent, p as DevToolsState, o as DevToolsUiVersion, v as DevToolsUpdateEvent, a1 as DimensionMatch, X as EnrichmentCategory, au as EnrichmentData, ax as EventData, aB as GoalStateUpdate, at as Goals, H as GroupCriteriaEvaluator, ag as IdentifyCommand, F as LogMessageGroup, E as LogMessageSingle, y as LogMessages, G as ManifestInstance, N as ManifestV2, M as MessageCategory, B as MessageFunc, ab as ModifyScoreCommand, ac as ModifySessionScoreCommand, Y as NumberMatch, P as PersonalizationEvent, Q as PersonalizationManifest, av as PersonalizeControlVariant, a2 as PersonalizeOptions, aw as PersonalizeVariants, a6 as PersonalizedResult, a5 as PersonalizedVariant, ar as Quirks, al as SERVER_STATE_ID, ak as ServerToClientTransitionState, ad as SetConsentCommand, ah as SetControlGroupCommand, aa as SetGoalCommand, ai as SetPersonalizeVariantControlCommand, ae as SetQuirkCommand, af as SetTestCommand, z as Severity, R as Signal, W as SignalCriteria, U as SignalCriteriaGroup, K as SignalData, a9 as StorageCommand, Z as TestDefinition, k as TestEvent, $ as TestOptions, a8 as TestResult, a7 as TestVariant, as as Tests, am as TransitionDataStoreEvents, aq as VisitorDataStore, ap as VisitorDataStoreEvents, ao as VisitorDataStoreOptions, aj as areCommandsEqual, ay as emptyVisitorData, a3 as personalizeVariations, a0 as testVariations } from './types-gG_D1dEo.js';
3
3
  import Cookies from 'js-cookie';
4
4
  import 'mitt';
5
5
 
package/dist/index.esm.js CHANGED
@@ -653,9 +653,11 @@ function personalizeVariations({
653
653
  try {
654
654
  const variantMatches = [];
655
655
  const defaultVariants = [];
656
+ const needsConsent = context.requireConsentForPersonalization;
657
+ const canEvaluate = !needsConsent || context.storage.data.consent;
656
658
  for (const variant of variations) {
657
659
  if ((_a = variant.pz) == null ? void 0 : _a.crit.length) {
658
- if (variantMatches.length !== take && evaluateVariantMatch(variant.id, variant.pz, context.scores, onLogMessage)) {
660
+ if (canEvaluate && variantMatches.length !== take && evaluateVariantMatch(variant.id, variant.pz, context.scores, onLogMessage)) {
659
661
  variantMatches.push(variant);
660
662
  }
661
663
  } else {
@@ -1467,7 +1469,7 @@ import { dequal as dequal5 } from "dequal/lite";
1467
1469
  import mitt3 from "mitt";
1468
1470
  var CONTEXTUAL_EDITING_TEST_NAME = "contextual_editing_test";
1469
1471
  var CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID = "contextual_editing_test_selected_variant";
1470
- var _serverTransitionState, _scores, _state, _pzCache, _plugins, _commands, _mitt3, _Context_instances, emitTest_fn, updateGoals_fn, updateComputedScores_fn, calculateScores_fn;
1472
+ var _serverTransitionState, _scores, _state, _pzCache, _plugins, _commands, _requireConsentForPersonalization, _mitt3, _Context_instances, emitTest_fn, updateGoals_fn, updateComputedScores_fn, calculateScores_fn;
1471
1473
  var Context = class {
1472
1474
  constructor(options) {
1473
1475
  __privateAdd(this, _Context_instances);
@@ -1478,6 +1480,7 @@ var Context = class {
1478
1480
  __privateAdd(this, _pzCache, {});
1479
1481
  __privateAdd(this, _plugins);
1480
1482
  __privateAdd(this, _commands);
1483
+ __privateAdd(this, _requireConsentForPersonalization);
1481
1484
  __privateAdd(this, _mitt3, mitt3());
1482
1485
  /**
1483
1486
  * Subscribe to events
@@ -1491,6 +1494,7 @@ var Context = class {
1491
1494
  const { manifest, ...storageOptions } = options;
1492
1495
  __privateSet(this, _state, {});
1493
1496
  __privateSet(this, _plugins, options.plugins);
1497
+ __privateSet(this, _requireConsentForPersonalization, options.requireConsentForPersonalization);
1494
1498
  if (typeof options.transitionStore !== "undefined") {
1495
1499
  __privateSet(this, _commands, []);
1496
1500
  }
@@ -1567,6 +1571,9 @@ var Context = class {
1567
1571
  var _a, _b;
1568
1572
  return (_b = (_a = __privateGet(this, _serverTransitionState)) == null ? void 0 : _a.quirks) != null ? _b : this.storage.data.quirks;
1569
1573
  }
1574
+ get requireConsentForPersonalization() {
1575
+ return __privateGet(this, _requireConsentForPersonalization);
1576
+ }
1570
1577
  /**
1571
1578
  * Updates the Context with new data of any sort, such as
1572
1579
  * new URLs, cookies, quirks, and enrichments.
@@ -1864,6 +1871,7 @@ _state = new WeakMap();
1864
1871
  _pzCache = new WeakMap();
1865
1872
  _plugins = new WeakMap();
1866
1873
  _commands = new WeakMap();
1874
+ _requireConsentForPersonalization = new WeakMap();
1867
1875
  _mitt3 = new WeakMap();
1868
1876
  _Context_instances = new WeakSet();
1869
1877
  emitTest_fn = function(event) {
package/dist/index.js CHANGED
@@ -737,9 +737,11 @@ function personalizeVariations({
737
737
  try {
738
738
  const variantMatches = [];
739
739
  const defaultVariants = [];
740
+ const needsConsent = context.requireConsentForPersonalization;
741
+ const canEvaluate = !needsConsent || context.storage.data.consent;
740
742
  for (const variant of variations) {
741
743
  if ((_a = variant.pz) == null ? void 0 : _a.crit.length) {
742
- if (variantMatches.length !== take && evaluateVariantMatch(variant.id, variant.pz, context.scores, onLogMessage)) {
744
+ if (canEvaluate && variantMatches.length !== take && evaluateVariantMatch(variant.id, variant.pz, context.scores, onLogMessage)) {
743
745
  variantMatches.push(variant);
744
746
  }
745
747
  } else {
@@ -1551,7 +1553,7 @@ var import_lite5 = require("dequal/lite");
1551
1553
  var import_mitt3 = __toESM(require("mitt"));
1552
1554
  var CONTEXTUAL_EDITING_TEST_NAME = "contextual_editing_test";
1553
1555
  var CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID = "contextual_editing_test_selected_variant";
1554
- var _serverTransitionState, _scores, _state, _pzCache, _plugins, _commands, _mitt3, _Context_instances, emitTest_fn, updateGoals_fn, updateComputedScores_fn, calculateScores_fn;
1556
+ var _serverTransitionState, _scores, _state, _pzCache, _plugins, _commands, _requireConsentForPersonalization, _mitt3, _Context_instances, emitTest_fn, updateGoals_fn, updateComputedScores_fn, calculateScores_fn;
1555
1557
  var Context = class {
1556
1558
  constructor(options) {
1557
1559
  __privateAdd(this, _Context_instances);
@@ -1562,6 +1564,7 @@ var Context = class {
1562
1564
  __privateAdd(this, _pzCache, {});
1563
1565
  __privateAdd(this, _plugins);
1564
1566
  __privateAdd(this, _commands);
1567
+ __privateAdd(this, _requireConsentForPersonalization);
1565
1568
  __privateAdd(this, _mitt3, (0, import_mitt3.default)());
1566
1569
  /**
1567
1570
  * Subscribe to events
@@ -1575,6 +1578,7 @@ var Context = class {
1575
1578
  const { manifest, ...storageOptions } = options;
1576
1579
  __privateSet(this, _state, {});
1577
1580
  __privateSet(this, _plugins, options.plugins);
1581
+ __privateSet(this, _requireConsentForPersonalization, options.requireConsentForPersonalization);
1578
1582
  if (typeof options.transitionStore !== "undefined") {
1579
1583
  __privateSet(this, _commands, []);
1580
1584
  }
@@ -1651,6 +1655,9 @@ var Context = class {
1651
1655
  var _a, _b;
1652
1656
  return (_b = (_a = __privateGet(this, _serverTransitionState)) == null ? void 0 : _a.quirks) != null ? _b : this.storage.data.quirks;
1653
1657
  }
1658
+ get requireConsentForPersonalization() {
1659
+ return __privateGet(this, _requireConsentForPersonalization);
1660
+ }
1654
1661
  /**
1655
1662
  * Updates the Context with new data of any sort, such as
1656
1663
  * new URLs, cookies, quirks, and enrichments.
@@ -1948,6 +1955,7 @@ _state = new WeakMap();
1948
1955
  _pzCache = new WeakMap();
1949
1956
  _plugins = new WeakMap();
1950
1957
  _commands = new WeakMap();
1958
+ _requireConsentForPersonalization = new WeakMap();
1951
1959
  _mitt3 = new WeakMap();
1952
1960
  _Context_instances = new WeakSet();
1953
1961
  emitTest_fn = function(event) {
package/dist/index.mjs CHANGED
@@ -653,9 +653,11 @@ function personalizeVariations({
653
653
  try {
654
654
  const variantMatches = [];
655
655
  const defaultVariants = [];
656
+ const needsConsent = context.requireConsentForPersonalization;
657
+ const canEvaluate = !needsConsent || context.storage.data.consent;
656
658
  for (const variant of variations) {
657
659
  if ((_a = variant.pz) == null ? void 0 : _a.crit.length) {
658
- if (variantMatches.length !== take && evaluateVariantMatch(variant.id, variant.pz, context.scores, onLogMessage)) {
660
+ if (canEvaluate && variantMatches.length !== take && evaluateVariantMatch(variant.id, variant.pz, context.scores, onLogMessage)) {
659
661
  variantMatches.push(variant);
660
662
  }
661
663
  } else {
@@ -1467,7 +1469,7 @@ import { dequal as dequal5 } from "dequal/lite";
1467
1469
  import mitt3 from "mitt";
1468
1470
  var CONTEXTUAL_EDITING_TEST_NAME = "contextual_editing_test";
1469
1471
  var CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID = "contextual_editing_test_selected_variant";
1470
- var _serverTransitionState, _scores, _state, _pzCache, _plugins, _commands, _mitt3, _Context_instances, emitTest_fn, updateGoals_fn, updateComputedScores_fn, calculateScores_fn;
1472
+ var _serverTransitionState, _scores, _state, _pzCache, _plugins, _commands, _requireConsentForPersonalization, _mitt3, _Context_instances, emitTest_fn, updateGoals_fn, updateComputedScores_fn, calculateScores_fn;
1471
1473
  var Context = class {
1472
1474
  constructor(options) {
1473
1475
  __privateAdd(this, _Context_instances);
@@ -1478,6 +1480,7 @@ var Context = class {
1478
1480
  __privateAdd(this, _pzCache, {});
1479
1481
  __privateAdd(this, _plugins);
1480
1482
  __privateAdd(this, _commands);
1483
+ __privateAdd(this, _requireConsentForPersonalization);
1481
1484
  __privateAdd(this, _mitt3, mitt3());
1482
1485
  /**
1483
1486
  * Subscribe to events
@@ -1491,6 +1494,7 @@ var Context = class {
1491
1494
  const { manifest, ...storageOptions } = options;
1492
1495
  __privateSet(this, _state, {});
1493
1496
  __privateSet(this, _plugins, options.plugins);
1497
+ __privateSet(this, _requireConsentForPersonalization, options.requireConsentForPersonalization);
1494
1498
  if (typeof options.transitionStore !== "undefined") {
1495
1499
  __privateSet(this, _commands, []);
1496
1500
  }
@@ -1567,6 +1571,9 @@ var Context = class {
1567
1571
  var _a, _b;
1568
1572
  return (_b = (_a = __privateGet(this, _serverTransitionState)) == null ? void 0 : _a.quirks) != null ? _b : this.storage.data.quirks;
1569
1573
  }
1574
+ get requireConsentForPersonalization() {
1575
+ return __privateGet(this, _requireConsentForPersonalization);
1576
+ }
1570
1577
  /**
1571
1578
  * Updates the Context with new data of any sort, such as
1572
1579
  * new URLs, cookies, quirks, and enrichments.
@@ -1864,6 +1871,7 @@ _state = new WeakMap();
1864
1871
  _pzCache = new WeakMap();
1865
1872
  _plugins = new WeakMap();
1866
1873
  _commands = new WeakMap();
1874
+ _requireConsentForPersonalization = new WeakMap();
1867
1875
  _mitt3 = new WeakMap();
1868
1876
  _Context_instances = new WeakSet();
1869
1877
  emitTest_fn = function(event) {
@@ -1021,6 +1021,12 @@ type ContextOptions = {
1021
1021
  * only - don't call scores, update, etc on it. If you need to call these methods immediately, attach your plugin after initialisation.
1022
1022
  */
1023
1023
  plugins?: Array<ContextPlugin>;
1024
+ /**
1025
+ * Only show personalizations if the visitor has given consent.
1026
+ * `false (default)`: personalization can run in memory without visitor granting storage consent
1027
+ * `true`: personalization is not run at all unless storage consent is given
1028
+ */
1029
+ requireConsentForPersonalization?: boolean;
1024
1030
  } & Omit<VisitorDataStoreOptions, 'manifest' | 'onServerTransitionScoresReceived'>;
1025
1031
  /** Emitted when a personalization runs */
1026
1032
  type PersonalizationEvent = {
@@ -1105,6 +1111,7 @@ declare class Context implements ContextInstance {
1105
1111
  get scores(): Readonly<ScoreVector>;
1106
1112
  /** Gets the current visitor's quirks values. */
1107
1113
  get quirks(): Readonly<Quirks>;
1114
+ get requireConsentForPersonalization(): boolean | undefined;
1108
1115
  /**
1109
1116
  * Subscribe to events
1110
1117
  */
@@ -1021,6 +1021,12 @@ type ContextOptions = {
1021
1021
  * only - don't call scores, update, etc on it. If you need to call these methods immediately, attach your plugin after initialisation.
1022
1022
  */
1023
1023
  plugins?: Array<ContextPlugin>;
1024
+ /**
1025
+ * Only show personalizations if the visitor has given consent.
1026
+ * `false (default)`: personalization can run in memory without visitor granting storage consent
1027
+ * `true`: personalization is not run at all unless storage consent is given
1028
+ */
1029
+ requireConsentForPersonalization?: boolean;
1024
1030
  } & Omit<VisitorDataStoreOptions, 'manifest' | 'onServerTransitionScoresReceived'>;
1025
1031
  /** Emitted when a personalization runs */
1026
1032
  type PersonalizationEvent = {
@@ -1105,6 +1111,7 @@ declare class Context implements ContextInstance {
1105
1111
  get scores(): Readonly<ScoreVector>;
1106
1112
  /** Gets the current visitor's quirks values. */
1107
1113
  get quirks(): Readonly<Quirks>;
1114
+ get requireConsentForPersonalization(): boolean | undefined;
1108
1115
  /**
1109
1116
  * Subscribe to events
1110
1117
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/context",
3
- "version": "19.190.1-alpha.3+0f998ae81e",
3
+ "version": "19.190.1-alpha.5+e62509cf6f",
4
4
  "description": "Uniform Context core package",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -68,5 +68,5 @@
68
68
  "publishConfig": {
69
69
  "access": "public"
70
70
  },
71
- "gitHead": "0f998ae81e331076b7d2c7339cdfaf5e82e75bd9"
71
+ "gitHead": "e62509cf6f61000e1fde780921e4ea7ba8103ad5"
72
72
  }