@statsig/client-core 0.0.1-beta.30 → 0.0.1-beta.32

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": "0.0.1-beta.30",
3
+ "version": "0.0.1-beta.32",
4
4
  "dependencies": {},
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
@@ -5,7 +5,7 @@ export type StatsigGlobal = {
5
5
  lastInstance?: StatsigClientInterface;
6
6
  acInstances?: Record<string, unknown>;
7
7
  srInstances?: Record<string, unknown>;
8
- instance?: (sdkKey: string) => StatsigClientInterface | undefined;
8
+ instance: (sdkKey?: string) => StatsigClientInterface | undefined;
9
9
  };
10
10
  declare global {
11
11
  let __STATSIG__: StatsigGlobal | undefined;
@@ -14,3 +14,4 @@ declare global {
14
14
  }
15
15
  }
16
16
  export declare const _getStatsigGlobal: () => StatsigGlobal;
17
+ export declare const _getInstance: (sdkKey: string) => StatsigClientInterface | undefined;
@@ -2,16 +2,23 @@
2
2
  /* eslint-disable @typescript-eslint/no-unsafe-assignment */
3
3
  var _a, _b, _c;
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports._getStatsigGlobal = void 0;
5
+ exports._getInstance = exports._getStatsigGlobal = void 0;
6
+ const _getStatsigGlobal = () => {
7
+ return __STATSIG__ !== null && __STATSIG__ !== void 0 ? __STATSIG__ : statsigGlobal;
8
+ };
9
+ exports._getStatsigGlobal = _getStatsigGlobal;
10
+ const _getInstance = (sdkKey) => {
11
+ var _a;
12
+ return sdkKey ? (_a = __STATSIG__ === null || __STATSIG__ === void 0 ? void 0 : __STATSIG__.instances) === null || _a === void 0 ? void 0 : _a[sdkKey] : __STATSIG__ === null || __STATSIG__ === void 0 ? void 0 : __STATSIG__.lastInstance;
13
+ };
14
+ exports._getInstance = _getInstance;
6
15
  const GLOBAL_KEY = '__STATSIG__';
7
16
  const _window = typeof window !== 'undefined' ? window : {};
8
17
  const _global = typeof global !== 'undefined' ? global : {};
9
18
  const _globalThis = typeof globalThis !== 'undefined' ? globalThis : {};
10
- const statsigGlobal = (_c = (_b = (_a = _window[GLOBAL_KEY]) !== null && _a !== void 0 ? _a : _global[GLOBAL_KEY]) !== null && _b !== void 0 ? _b : _globalThis[GLOBAL_KEY]) !== null && _c !== void 0 ? _c : {};
19
+ const statsigGlobal = (_c = (_b = (_a = _window[GLOBAL_KEY]) !== null && _a !== void 0 ? _a : _global[GLOBAL_KEY]) !== null && _b !== void 0 ? _b : _globalThis[GLOBAL_KEY]) !== null && _c !== void 0 ? _c : {
20
+ instance: exports._getInstance,
21
+ };
11
22
  _window[GLOBAL_KEY] = statsigGlobal;
12
23
  _global[GLOBAL_KEY] = statsigGlobal;
13
24
  _globalThis[GLOBAL_KEY] = statsigGlobal;
14
- const _getStatsigGlobal = () => {
15
- return __STATSIG__ !== null && __STATSIG__ !== void 0 ? __STATSIG__ : statsigGlobal;
16
- };
17
- exports._getStatsigGlobal = _getStatsigGlobal;
@@ -1,5 +1,5 @@
1
1
  import { ErrorBoundary } from './ErrorBoundary';
2
- import { DataAdapterResult } from './StatsigDataAdapter';
2
+ import { DataAdapterAsyncOptions, DataAdapterResult } from './StatsigDataAdapter';
3
3
  import { AnyStatsigOptions } from './StatsigOptionsCommon';
4
4
  import { StatsigUser } from './StatsigUser';
5
5
  export declare abstract class DataAdapterCore {
@@ -12,8 +12,6 @@ export declare abstract class DataAdapterCore {
12
12
  protected constructor(_adapterName: string, _cacheSuffix: string);
13
13
  attach(sdkKey: string, _options: AnyStatsigOptions | null): void;
14
14
  getDataSync(user?: StatsigUser | undefined): DataAdapterResult | null;
15
- getDataAsync(current: DataAdapterResult | null, user?: StatsigUser): Promise<DataAdapterResult | null>;
16
- prefetchData(user?: StatsigUser | undefined): Promise<void>;
17
15
  setData(data: string, user?: StatsigUser): void;
18
16
  /**
19
17
  * (Internal Use Only) - Used by \@statsig/react-native-bindings to prime the cache from AsyncStorage
@@ -21,6 +19,8 @@ export declare abstract class DataAdapterCore {
21
19
  * @param {Record<string, DataAdapterResult>} cache The values to merge into _inMemoryCache
22
20
  */
23
21
  __primeInMemoryCache(cache: Record<string, DataAdapterResult>): void;
22
+ protected _getDataAsyncImpl(current: DataAdapterResult | null, user?: StatsigUser, options?: DataAdapterAsyncOptions): Promise<DataAdapterResult | null>;
23
+ protected _prefetchDataImpl(user?: StatsigUser, options?: DataAdapterAsyncOptions): Promise<void>;
24
24
  protected abstract _fetchFromNetwork(current: string | null, user?: StatsigUser): Promise<string | null>;
25
25
  private _fetchLatest;
26
26
  protected _getSdkKey(): string;
@@ -45,31 +45,6 @@ class DataAdapterCore {
45
45
  }
46
46
  return null;
47
47
  }
48
- getDataAsync(current, user) {
49
- var _a;
50
- return __awaiter(this, void 0, void 0, function* () {
51
- const cache = current !== null && current !== void 0 ? current : this.getDataSync(user);
52
- const latest = yield this._fetchLatest((_a = cache === null || cache === void 0 ? void 0 : cache.data) !== null && _a !== void 0 ? _a : null, user);
53
- const cacheKey = this._getCacheKey(user);
54
- if (latest) {
55
- this._addToInMemoryCache(cacheKey, latest);
56
- }
57
- if ((latest === null || latest === void 0 ? void 0 : latest.source) === 'Network' ||
58
- (latest === null || latest === void 0 ? void 0 : latest.source) === 'NetworkNotModified') {
59
- yield this._writeToCache(cacheKey, latest);
60
- }
61
- return latest;
62
- });
63
- }
64
- prefetchData(user) {
65
- return __awaiter(this, void 0, void 0, function* () {
66
- const cacheKey = this._getCacheKey(user);
67
- const result = yield this.getDataAsync(null, user);
68
- if (result) {
69
- this._addToInMemoryCache(cacheKey, Object.assign(Object.assign({}, result), { source: 'Prefetch' }));
70
- }
71
- });
72
- }
73
48
  setData(data, user) {
74
49
  const cacheKey = this._getCacheKey(user);
75
50
  this._addToInMemoryCache(cacheKey, {
@@ -86,6 +61,29 @@ class DataAdapterCore {
86
61
  __primeInMemoryCache(cache) {
87
62
  this._inMemoryCache = Object.assign(Object.assign({}, this._inMemoryCache), cache);
88
63
  }
64
+ _getDataAsyncImpl(current, user, options) {
65
+ var _a;
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ const cache = current !== null && current !== void 0 ? current : this.getDataSync(user);
68
+ const ops = [this._fetchLatest((_a = cache === null || cache === void 0 ? void 0 : cache.data) !== null && _a !== void 0 ? _a : null, user)];
69
+ if (options === null || options === void 0 ? void 0 : options.timeoutMs) {
70
+ ops.push(new Promise((r) => setTimeout(r, options.timeoutMs)).then(() => {
71
+ Log_1.Log.debug('Fetching latest value timed out');
72
+ return null;
73
+ }));
74
+ }
75
+ return yield Promise.race(ops);
76
+ });
77
+ }
78
+ _prefetchDataImpl(user, options) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ const cacheKey = this._getCacheKey(user);
81
+ const result = yield this._getDataAsyncImpl(null, user, options);
82
+ if (result) {
83
+ this._addToInMemoryCache(cacheKey, Object.assign(Object.assign({}, result), { source: 'Prefetch' }));
84
+ }
85
+ });
86
+ }
89
87
  _fetchLatest(current, user) {
90
88
  return __awaiter(this, void 0, void 0, function* () {
91
89
  const latest = yield this._fetchFromNetwork(current, user);
@@ -94,17 +92,24 @@ class DataAdapterCore {
94
92
  return null;
95
93
  }
96
94
  const response = (0, TypedJsonParse_1.typedJsonParse)(latest, 'has_updates', 'Failure while attempting to persist latest value');
97
- if (current && (response === null || response === void 0 ? void 0 : response.has_updates) === false) {
98
- return {
95
+ let result = null;
96
+ if ((response === null || response === void 0 ? void 0 : response.has_updates) === true) {
97
+ result = { source: 'Network', data: latest, receivedAt: Date.now() };
98
+ }
99
+ else if (current && (response === null || response === void 0 ? void 0 : response.has_updates) === false) {
100
+ result = {
99
101
  source: 'NetworkNotModified',
100
102
  data: current,
101
103
  receivedAt: Date.now(),
102
104
  };
103
105
  }
104
- if ((response === null || response === void 0 ? void 0 : response.has_updates) !== true) {
106
+ if (!result) {
105
107
  return null;
106
108
  }
107
- return { source: 'Network', data: latest, receivedAt: Date.now() };
109
+ const cacheKey = this._getCacheKey(user);
110
+ this._addToInMemoryCache(cacheKey, result);
111
+ yield this._writeToCache(cacheKey, result);
112
+ return result;
108
113
  });
109
114
  }
110
115
  _getSdkKey() {
@@ -14,6 +14,7 @@ const Hashing_1 = require("./Hashing");
14
14
  const Log_1 = require("./Log");
15
15
  const NetworkDefaults_1 = require("./NetworkDefaults");
16
16
  const NetworkParams_1 = require("./NetworkParams");
17
+ const SafeJs_1 = require("./SafeJs");
17
18
  const StatsigEvent_1 = require("./StatsigEvent");
18
19
  const StorageProvider_1 = require("./StorageProvider");
19
20
  const TypedJsonParse_1 = require("./TypedJsonParse");
@@ -249,15 +250,7 @@ class EventLogger {
249
250
  if (((_a = this._options) === null || _a === void 0 ? void 0 : _a.includeCurrentPageUrlWithEvents) === false) {
250
251
  return;
251
252
  }
252
- if (typeof window === 'undefined' || typeof window.location !== 'object') {
253
- return;
254
- }
255
- try {
256
- return window.location.href.split(/[?#]/)[0];
257
- }
258
- catch (_b) {
259
- return;
260
- }
253
+ return (0, SafeJs_1._getCurrentPageUrlSafe)();
261
254
  }
262
255
  }
263
256
  exports.EventLogger = EventLogger;
@@ -42,6 +42,9 @@ class NetworkCore {
42
42
  }
43
43
  beacon(args) {
44
44
  return __awaiter(this, void 0, void 0, function* () {
45
+ if (!_ensureValidSdkKey(args)) {
46
+ return false;
47
+ }
45
48
  const url = yield this._getPopulatedURL(args);
46
49
  const body = yield this._getPopulatedBody(args);
47
50
  return navigator.sendBeacon(url, body);
@@ -50,6 +53,9 @@ class NetworkCore {
50
53
  _sendRequest(args) {
51
54
  var _a;
52
55
  return __awaiter(this, void 0, void 0, function* () {
56
+ if (!_ensureValidSdkKey(args)) {
57
+ return null;
58
+ }
53
59
  const { method, body, retries } = args;
54
60
  const controller = new AbortController();
55
61
  const handle = setTimeout(() => controller.abort(`Timeout of ${this._timeout}ms expired.`), this._timeout);
@@ -131,6 +137,13 @@ class NetworkCore {
131
137
  }
132
138
  }
133
139
  exports.NetworkCore = NetworkCore;
140
+ const _ensureValidSdkKey = (args) => {
141
+ if (!args.sdkKey) {
142
+ Log_1.Log.warn('Unable to make request without an SDK key');
143
+ return false;
144
+ }
145
+ return true;
146
+ };
134
147
  function _getErrorMessage(controller, error) {
135
148
  if (controller.signal.aborted &&
136
149
  typeof controller.signal.reason === 'string') {
package/src/SafeJs.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export declare const _getWindowSafe: () => Window | null;
2
2
  export declare const _getDocumentSafe: () => Document | null;
3
+ export declare const _isBrowserEnv: () => boolean;
3
4
  export declare const _addWindowEventListenerSafe: (key: string, listener: () => void) => void;
4
5
  export declare const _addDocumentEventListenerSafe: (key: string, listener: () => void) => void;
6
+ export declare const _getCurrentPageUrlSafe: () => string | undefined;
package/src/SafeJs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._addDocumentEventListenerSafe = exports._addWindowEventListenerSafe = exports._getDocumentSafe = exports._getWindowSafe = void 0;
3
+ exports._getCurrentPageUrlSafe = exports._addDocumentEventListenerSafe = exports._addWindowEventListenerSafe = exports._isBrowserEnv = exports._getDocumentSafe = exports._getWindowSafe = void 0;
4
4
  const _getWindowSafe = () => {
5
5
  return typeof window !== 'undefined' ? window : null;
6
6
  };
@@ -11,6 +11,10 @@ const _getDocumentSafe = () => {
11
11
  return (_a = win === null || win === void 0 ? void 0 : win.document) !== null && _a !== void 0 ? _a : null;
12
12
  };
13
13
  exports._getDocumentSafe = _getDocumentSafe;
14
+ const _isBrowserEnv = () => {
15
+ return (0, exports._getDocumentSafe)() != null;
16
+ };
17
+ exports._isBrowserEnv = _isBrowserEnv;
14
18
  const _addWindowEventListenerSafe = (key, listener) => {
15
19
  const win = (0, exports._getWindowSafe)();
16
20
  if (typeof (win === null || win === void 0 ? void 0 : win.addEventListener) === 'function') {
@@ -25,3 +29,13 @@ const _addDocumentEventListenerSafe = (key, listener) => {
25
29
  }
26
30
  };
27
31
  exports._addDocumentEventListenerSafe = _addDocumentEventListenerSafe;
32
+ const _getCurrentPageUrlSafe = () => {
33
+ var _a;
34
+ try {
35
+ return (_a = (0, exports._getWindowSafe)()) === null || _a === void 0 ? void 0 : _a.location.href.split(/[?#]/)[0];
36
+ }
37
+ catch (_b) {
38
+ return;
39
+ }
40
+ };
41
+ exports._getCurrentPageUrlSafe = _getCurrentPageUrlSafe;
@@ -4,11 +4,11 @@ import { EvaluationOptionsCommon } from './EvaluationOptions';
4
4
  import { EventLogger } from './EventLogger';
5
5
  import { NetworkCore } from './NetworkCore';
6
6
  import { OverrideAdapter } from './OverrideAdapter';
7
- import { StatsigClientEvent, StatsigClientEventCallback, StatsigClientEventEmitterInterface, StatsigClientEventName, StatsigLoadingStatus } from './StatsigClientEventEmitter';
7
+ import { AnyStatsigClientEvent, StatsigClientEventCallback, StatsigClientEventEmitterInterface, StatsigClientEventName, StatsigLoadingStatus } from './StatsigClientEventEmitter';
8
8
  import { DataAdapterResult, EvaluationsDataAdapter, SpecsDataAdapter } from './StatsigDataAdapter';
9
9
  import { StatsigEventInternal } from './StatsigEvent';
10
10
  import { AnyStatsigOptions, StatsigRuntimeMutableOptions } from './StatsigOptionsCommon';
11
- export type StatsigClientEmitEventFunc = (event: StatsigClientEvent) => void;
11
+ export type StatsigClientEmitEventFunc = (event: AnyStatsigClientEvent) => void;
12
12
  export type StatsigContext = {
13
13
  sdkKey: string;
14
14
  options: AnyStatsigOptions;
@@ -60,7 +60,7 @@ export declare abstract class StatsigClientBase<TAdapter extends EvaluationsData
60
60
  */
61
61
  off<T extends StatsigClientEventName>(event: T, listener: StatsigClientEventCallback<T>): void;
62
62
  __on<T extends StatsigClientEventName>(event: T, listener: StatsigClientEventCallback<T>): void;
63
- protected _emit(event: StatsigClientEvent): void;
63
+ protected _emit(event: AnyStatsigClientEvent): void;
64
64
  protected _setStatus(newStatus: StatsigLoadingStatus, values: DataAdapterResult | null): void;
65
65
  protected _enqueueExposure(name: string, exposure: StatsigEventInternal, options?: EvaluationOptionsCommon): void;
66
66
  }
@@ -11,9 +11,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.StatsigClientBase = void 0;
13
13
  require("./$_StatsigGlobal");
14
+ const __StatsigGlobal_1 = require("./$_StatsigGlobal");
14
15
  const ErrorBoundary_1 = require("./ErrorBoundary");
15
16
  const EventLogger_1 = require("./EventLogger");
16
17
  const Log_1 = require("./Log");
18
+ const SafeJs_1 = require("./SafeJs");
17
19
  const SessionID_1 = require("./SessionID");
18
20
  const StableID_1 = require("./StableID");
19
21
  const StorageProvider_1 = require("./StorageProvider");
@@ -34,8 +36,11 @@ class StatsigClientBase {
34
36
  this._emit({ name: 'session_expired' });
35
37
  }, sdkKey);
36
38
  this._errorBoundary = new ErrorBoundary_1.ErrorBoundary(sdkKey);
37
- const statsigGlobal = __STATSIG__ !== null && __STATSIG__ !== void 0 ? __STATSIG__ : {};
39
+ const statsigGlobal = (0, __StatsigGlobal_1._getStatsigGlobal)();
38
40
  const instances = (_c = statsigGlobal.instances) !== null && _c !== void 0 ? _c : {};
41
+ if (instances[sdkKey] != null && (0, SafeJs_1._isBrowserEnv)()) {
42
+ Log_1.Log.warn('Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys.');
43
+ }
39
44
  const inst = this;
40
45
  instances[sdkKey] = inst;
41
46
  statsigGlobal.lastInstance = inst;
@@ -47,16 +47,17 @@ type EventNameToEventDataMap = {
47
47
  *
48
48
  * `layer_evaluation` - Fired when any layer is checked from the Statsig client.
49
49
  */
50
- export type StatsigClientEvent = Flatten<{
50
+ export type AnyStatsigClientEvent = Flatten<{
51
51
  [K in keyof EventNameToEventDataMap]: {
52
52
  name: K;
53
53
  } & EventNameToEventDataMap[K];
54
54
  }[keyof EventNameToEventDataMap]>;
55
- export type AnyStatsigClientEventListener = StatsigClientEventCallback<StatsigClientEventName>;
56
- export type StatsigClientEventName = StatsigClientEvent['name'] | '*';
57
- export type StatsigClientEventCallback<T extends StatsigClientEventName> = (event: T extends '*' ? StatsigClientEvent : Extract<StatsigClientEvent, {
55
+ export type StatsigClientEvent<T> = Extract<AnyStatsigClientEvent, {
58
56
  name: T;
59
- }>) => void;
57
+ }>;
58
+ export type AnyStatsigClientEventListener = StatsigClientEventCallback<StatsigClientEventName>;
59
+ export type StatsigClientEventName = AnyStatsigClientEvent['name'] | '*';
60
+ export type StatsigClientEventCallback<T extends StatsigClientEventName> = (event: T extends '*' ? AnyStatsigClientEvent : StatsigClientEvent<T>) => void;
60
61
  export interface StatsigClientEventEmitterInterface {
61
62
  readonly loadingStatus: StatsigLoadingStatus;
62
63
  on<T extends StatsigClientEventName>(event: T, listener: StatsigClientEventCallback<T>): void;
@@ -1,4 +1,4 @@
1
- import { AnyStatsigOptions } from './StatsigOptionsCommon';
1
+ import type { AnyStatsigOptions, NetworkConfigCommon } from './StatsigOptionsCommon';
2
2
  import { StatsigUser } from './StatsigUser';
3
3
  export type DataSource = 'Uninitialized' | 'Loading' | 'NoValues' | 'Cache' | 'Network' | 'NetworkNotModified' | 'Bootstrap' | 'Prefetch';
4
4
  export type DataAdapterResult = {
@@ -6,12 +6,21 @@ export type DataAdapterResult = {
6
6
  readonly data: string;
7
7
  readonly receivedAt: number;
8
8
  };
9
+ export type DataAdapterAsyncOptions = {
10
+ /**
11
+ * The maximum amount of time (in milliseconds) this operation is permitted to run.
12
+ * If the timeout is hit, null is returned but any in-flight requests are kept alive with results going to cache for future updates.
13
+ *
14
+ * Note: If no timeout is given, the {@link NetworkConfigCommon.networkTimeoutMs|StatsigOptions.networkConfig.networkTimeoutMs} is used.
15
+ */
16
+ readonly timeoutMs?: NetworkConfigCommon['networkTimeoutMs'];
17
+ };
9
18
  export declare const DataAdapterCachePrefix = "statsig.cached";
10
19
  /**
11
20
  * Describes a type that is used during intialize/update operations of a Statsig client.
12
21
  *
13
22
  * See below to find the default adapters, but know that it is possible to create your
14
- * own StatsigDataAdapter and provide it via {@link StatsigOptionsCommon.dataAdapter}.
23
+ * own StatsigDataAdapter and provide it via {@link AnyStatsigOptions.dataAdapter}.
15
24
  *
16
25
  * Defaults:
17
26
  *
@@ -49,13 +58,13 @@ export type EvaluationsDataAdapter = DataAdapterCommon & {
49
58
  * @param {StatsigUser} user The StatsigUser to get data for.
50
59
  * @returns {DataAdapterResult | null} The data that was found for the given StatsigUser.
51
60
  */
52
- readonly getDataAsync: (current: DataAdapterResult | null, user: StatsigUser) => Promise<DataAdapterResult | null>;
61
+ readonly getDataAsync: (current: DataAdapterResult | null, user: StatsigUser, options?: DataAdapterAsyncOptions) => Promise<DataAdapterResult | null>;
53
62
  /**
54
63
  * Manually trigger a fetch for new evaluations data for the given user.
55
64
  *
56
65
  * @param {StatsigUser} user The StatsigUser to get data for.
57
66
  */
58
- readonly prefetchData: (user: StatsigUser) => Promise<void>;
67
+ readonly prefetchData: (user: StatsigUser, options?: DataAdapterAsyncOptions) => Promise<void>;
59
68
  /**
60
69
  * Manually set evaluations data for the given user.
61
70
  *
@@ -76,11 +85,11 @@ export type SpecsDataAdapter = DataAdapterCommon & {
76
85
  * @param {DataAdapterResult | null} current The data that was found synchronously (Cache). Will be used as fallback if getDataAsync fails
77
86
  * @returns {DataAdapterResult | null} The data that was found for the given StatsigUser.
78
87
  */
79
- readonly getDataAsync: (current: DataAdapterResult | null) => Promise<DataAdapterResult | null>;
88
+ readonly getDataAsync: (current: DataAdapterResult | null, options?: DataAdapterAsyncOptions) => Promise<DataAdapterResult | null>;
80
89
  /**
81
90
  * Manually trigger a fetch for new specs data.
82
91
  */
83
- readonly prefetchData: () => Promise<void>;
92
+ readonly prefetchData: (options?: DataAdapterAsyncOptions) => Promise<void>;
84
93
  /**
85
94
  * Manually set specs data (Bootstrap).
86
95
  */
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "0.0.1-beta.30";
1
+ export declare const SDK_VERSION = "0.0.1-beta.32";
2
2
  export type StatsigMetadata = {
3
3
  readonly [key: string]: string | undefined;
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 = '0.0.1-beta.30';
4
+ exports.SDK_VERSION = '0.0.1-beta.32';
5
5
  let metadata = {
6
6
  sdkVersion: exports.SDK_VERSION,
7
7
  sdkType: 'js-mono', // js-mono is overwritten by Precomp and OnDevice clients
@@ -3,12 +3,12 @@ import { OverrideAdapter } from './OverrideAdapter';
3
3
  /** Options that can be set at init and updated during runtime. */
4
4
  export type StatsigRuntimeMutableOptions = {
5
5
  /**
6
- * Prevents writing anything to storage.
7
- * Note: caching will not work if storage is disabled
6
+ * Prevents sending any events over the network.
8
7
  */
9
8
  disableLogging?: boolean;
10
9
  /**
11
10
  * Prevents writing anything to storage.
11
+ *
12
12
  * Note: caching will not work if storage is disabled
13
13
  */
14
14
  disableStorage?: boolean;