@statsig/client-core 3.29.1 → 3.30.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statsig/client-core",
3
- "version": "3.29.1",
3
+ "version": "3.30.0",
4
4
  "license": "ISC",
5
5
  "homepage": "https://github.com/statsig-io/js-client-monorepo",
6
6
  "repository": {
@@ -27,10 +27,6 @@ const DEDUPER_WINDOW_DURATION_MS = 600000;
27
27
  const MAX_FAILED_LOGS = 500;
28
28
  const QUICK_FLUSH_WINDOW_MS = 200;
29
29
  const EVENT_LOGGER_MAP = {};
30
- const RetryFailedLogsTrigger = {
31
- Startup: 'startup',
32
- GainedFocus: 'gained_focus',
33
- };
34
30
  class EventLogger {
35
31
  static _safeFlushAndForget(sdkKey) {
36
32
  var _a;
@@ -40,7 +36,7 @@ class EventLogger {
40
36
  }
41
37
  static _safeRetryFailedLogs(sdkKey) {
42
38
  var _a;
43
- (_a = EVENT_LOGGER_MAP[sdkKey]) === null || _a === void 0 ? void 0 : _a._retryFailedLogs(RetryFailedLogsTrigger.GainedFocus);
39
+ (_a = EVENT_LOGGER_MAP[sdkKey]) === null || _a === void 0 ? void 0 : _a._retryFailedLogs();
44
40
  }
45
41
  constructor(_sdkKey, _emitter, _network, _options) {
46
42
  var _a, _b;
@@ -118,7 +114,7 @@ class EventLogger {
118
114
  }
119
115
  });
120
116
  }
121
- this._retryFailedLogs(RetryFailedLogsTrigger.Startup);
117
+ this._retryFailedLogs();
122
118
  this._startBackgroundFlushInterval();
123
119
  }
124
120
  stop() {
@@ -281,7 +277,7 @@ class EventLogger {
281
277
  return [];
282
278
  }
283
279
  }
284
- _retryFailedLogs(trigger) {
280
+ _retryFailedLogs() {
285
281
  const storageKey = this._getStorageKey();
286
282
  (() => __awaiter(this, void 0, void 0, function* () {
287
283
  if (!StorageProvider_1.Storage.isReady()) {
@@ -291,13 +287,8 @@ class EventLogger {
291
287
  if (!events) {
292
288
  return;
293
289
  }
294
- if (trigger === RetryFailedLogsTrigger.Startup) {
295
- StorageProvider_1.Storage.removeItem(storageKey);
296
- }
297
- const isSuccess = yield this._sendEvents(events);
298
- if (isSuccess && trigger === RetryFailedLogsTrigger.GainedFocus) {
299
- StorageProvider_1.Storage.removeItem(storageKey);
300
- }
290
+ StorageProvider_1.Storage.removeItem(storageKey);
291
+ yield this._sendEvents(events);
301
292
  }))().catch(() => {
302
293
  Log_1.Log.warn('Failed to flush stored logs');
303
294
  });
@@ -9,6 +9,8 @@ type SessionReplayFields = {
9
9
  passes_session_recording_targeting?: boolean;
10
10
  session_recording_event_triggers?: Record<string, SessionReplayTrigger>;
11
11
  session_recording_exposure_triggers?: Record<string, SessionReplayTrigger>;
12
+ record_on_gate_check?: boolean;
13
+ record_on_experiment_check?: boolean;
12
14
  };
13
15
  type SessionReplayTrigger = {
14
16
  values?: string[];
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "3.29.1";
1
+ export declare const SDK_VERSION = "3.30.0";
2
2
  export type StatsigMetadata = {
3
3
  readonly [key: string]: string | undefined | null;
4
4
  readonly appVersion?: string;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StatsigMetadataProvider = exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = '3.29.1';
4
+ exports.SDK_VERSION = '3.30.0';
5
5
  let metadata = {
6
6
  sdkVersion: exports.SDK_VERSION,
7
7
  sdkType: 'js-mono', // js-mono is overwritten by Precomp and OnDevice clients
@@ -31,7 +31,7 @@ export type Layer = Flatten<{
31
31
  readonly groupName: string | null;
32
32
  readonly __value: Record<string, unknown>;
33
33
  readonly __evaluation: LayerEvaluation | null;
34
- readonly get: TypedGet;
34
+ get: TypedGet;
35
35
  }>;
36
36
  export type ParameterStore = Flatten<{
37
37
  readonly name: string;