@statsig/js-client 3.15.5 → 3.16.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statsig/js-client",
3
- "version": "3.15.5",
3
+ "version": "3.16.1",
4
4
  "license": "ISC",
5
5
  "homepage": "https://github.com/statsig-io/js-client-monorepo",
6
6
  "repository": {
@@ -9,7 +9,7 @@
9
9
  "directory": "packages/js-client"
10
10
  },
11
11
  "dependencies": {
12
- "@statsig/client-core": "3.15.5"
12
+ "@statsig/client-core": "3.16.1"
13
13
  },
14
14
  "jsdelivr": "./build/statsig-js-client.min.js",
15
15
  "type": "commonjs",
package/src/Network.js CHANGED
@@ -35,7 +35,7 @@ class StatsigNetwork extends client_core_1.NetworkCore {
35
35
  ((_f = (_e = (_d = this._option) === null || _d === void 0 ? void 0 : _d.networkConfig) === null || _e === void 0 ? void 0 : _e.initializeHashAlgorithm) !== null && _f !== void 0 ? _f : 'djb2');
36
36
  data = Object.assign(Object.assign({}, data), { sinceTime: isCacheValidFor204 && !hasHashChanged ? cache.time : 0, previousDerivedFields: 'derived_fields' in cache && isCacheValidFor204
37
37
  ? cache.derived_fields
38
- : {}, deltasResponseRequested: true, full_checksum: cache.full_checksum });
38
+ : {}, deltasResponseRequested: true, full_checksum: cache.full_checksum, partialUserMatchSinceTime: !hasHashChanged ? cache.time : 0 });
39
39
  }
40
40
  return this._fetchEvaluations(sdkKey, cache, data, priority);
41
41
  });
@@ -22,36 +22,27 @@ function _getMappedGateValue(client, param, options) {
22
22
  return param.fail_value;
23
23
  }
24
24
  function _getMappedDynamicConfigValue(client, param, fallback, options) {
25
- const config = client.getDynamicConfig(param.config_name, NO_EXPOSURE_OPT);
25
+ const config = client.getDynamicConfig(param.config_name, _shouldLogExposure(options) ? undefined : NO_EXPOSURE_OPT);
26
26
  const value = config.get(param.param_name);
27
27
  if (_shouldReturnFallback(value, fallback)) {
28
28
  return fallback;
29
29
  }
30
- if (_shouldLogExposure(options)) {
31
- client.getDynamicConfig(param.config_name);
32
- }
33
30
  return value;
34
31
  }
35
32
  function _getMappedExperimentValue(client, param, fallback, options) {
36
- const experiment = client.getExperiment(param.experiment_name, NO_EXPOSURE_OPT);
33
+ const experiment = client.getExperiment(param.experiment_name, _shouldLogExposure(options) ? undefined : NO_EXPOSURE_OPT);
37
34
  const value = experiment.get(param.param_name);
38
35
  if (_shouldReturnFallback(value, fallback)) {
39
36
  return fallback;
40
37
  }
41
- if (_shouldLogExposure(options)) {
42
- client.getExperiment(param.experiment_name);
43
- }
44
38
  return value;
45
39
  }
46
40
  function _getMappedLayerValue(client, param, fallback, options) {
47
- const layer = client.getLayer(param.layer_name, NO_EXPOSURE_OPT);
41
+ const layer = client.getLayer(param.layer_name, _shouldLogExposure(options) ? undefined : NO_EXPOSURE_OPT);
48
42
  const value = layer.get(param.param_name);
49
43
  if (_shouldReturnFallback(value, fallback)) {
50
44
  return fallback;
51
45
  }
52
- if (_shouldLogExposure(options)) {
53
- client.getLayer(param.layer_name).get(param.param_name);
54
- }
55
46
  return value;
56
47
  }
57
48
  function _makeParamStoreGetter(client, config, options) {
@@ -176,6 +176,7 @@ export default class StatsigClient extends StatsigClientBase<EvaluationsDataAdap
176
176
  allocated_experiment_name: string;
177
177
  explicit_parameters: string[];
178
178
  undelegated_secondary_exposures?: string[] | import("@statsig/client-core").SecondaryExposure[] | undefined;
179
+ parameter_rule_ids?: Record<string, string> | undefined;
179
180
  } | null;
180
181
  readonly get: import("@statsig/client-core").TypedGet;
181
182
  };
@@ -239,6 +239,10 @@ class StatsigClient extends client_core_1.StatsigClientBase {
239
239
  metadata,
240
240
  }
241
241
  : eventOrName;
242
+ this.$emt({
243
+ name: 'log_event_called',
244
+ event,
245
+ });
242
246
  this._logger.enqueue(Object.assign(Object.assign({}, event), { user: this._user, time: Date.now() }));
243
247
  }
244
248
  _primeReadyRipcord() {