@incodetech/core 0.0.0-dev-20260716-2b4f5edb → 0.0.0-dev-20260717-87fac45b

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 (53) hide show
  1. package/dist/BrowserLazyImportProvider-BhoA957O.esm.js +114 -0
  2. package/dist/IFeatureManagementCapability-ErPJywQ_.d.ts +1121 -0
  3. package/dist/authentication.esm.js +2 -2
  4. package/dist/{authenticationManager-BVMQTy2C.esm.js → authenticationManager-DK8fsUqL.esm.js} +2 -2
  5. package/dist/{authenticationStateMachine-DvFeGMIc.esm.js → authenticationStateMachine-BlT8fkR6.esm.js} +2 -2
  6. package/dist/consent.d.ts +1 -1
  7. package/dist/{consentManager-2h_w6wFc.d.ts → consentManager-CsyToF8t.d.ts} +5 -5
  8. package/dist/{deepsightLoader-BGu6zfoZ.esm.js → deepsightLoader-C7HOhX6C.esm.js} +1 -1
  9. package/dist/document-capture.d.ts +1 -1
  10. package/dist/document-upload.d.ts +4 -4
  11. package/dist/{documentCaptureManager-Biz_PFqs.d.ts → documentCaptureManager-DBqK5ner.d.ts} +65 -65
  12. package/dist/ekyb.esm.js +2 -2
  13. package/dist/{ekybManager--3WIEWS5.esm.js → ekybManager-BMjf8ZNw.esm.js} +1 -1
  14. package/dist/{ekybStateMachine-B870YzwX.esm.js → ekybStateMachine-DfpEPLzD.esm.js} +1 -1
  15. package/dist/extensibility.d.ts +4 -4
  16. package/dist/extensibility.esm.js +6 -6
  17. package/dist/{faceCaptureManagerFactory-CDpqsxiU.esm.js → faceCaptureManagerFactory-BFv1KlL_.esm.js} +1 -1
  18. package/dist/{faceCaptureSetup-BXueiZo8.esm.js → faceCaptureSetup-Bxo1VNVw.esm.js} +2 -2
  19. package/dist/feature-management-Dw96qEMs.esm.js +468 -0
  20. package/dist/feature-management.d.ts +80 -0
  21. package/dist/feature-management.esm.js +2 -0
  22. package/dist/flow.esm.js +1 -1
  23. package/dist/{flowServices-DL7qnTQR.esm.js → flowServices-ymcivfU0.esm.js} +5 -3
  24. package/dist/id.esm.js +2 -2
  25. package/dist/{idCaptureManager-BoLeZff7.esm.js → idCaptureManager-BBfWW9Y0.esm.js} +1 -1
  26. package/dist/{idCaptureStateMachine-D2H3vwwf.esm.js → idCaptureStateMachine-_1pROAbA.esm.js} +5 -5
  27. package/dist/identity-reuse.d.ts +1 -1
  28. package/dist/{identityReuseManager-aTyLyYrr.d.ts → identityReuseManager-D6pD4hcZ.d.ts} +1 -1
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.esm.js +1 -1
  31. package/dist/mandatory-consent.d.ts +1 -1
  32. package/dist/{mandatoryConsentManager-B2gRcE_x.d.ts → mandatoryConsentManager-BR8SLvd1.d.ts} +5 -5
  33. package/dist/{onDeviceFaceResults-4ODIm8fO.esm.js → onDeviceFaceResults-B3oTx-NK.esm.js} +1 -1
  34. package/dist/personhood.esm.js +2 -2
  35. package/dist/{recordingService-CkLJ00Pw.esm.js → recordingService-Comyo6yK.esm.js} +1 -1
  36. package/dist/selfie.esm.js +4 -4
  37. package/dist/{selfieManager-C_ynxeGZ.esm.js → selfieManager-CCR6VpoQ.esm.js} +2 -2
  38. package/dist/{selfieStateMachine-CFqYKJFF.esm.js → selfieStateMachine-D30gwMGq.esm.js} +2 -2
  39. package/dist/session-B9KT6qnE.esm.js +1 -0
  40. package/dist/session.esm.js +2 -2
  41. package/dist/{sessionInitializer-B6n-FYf7.esm.js → sessionInitializer-CrzyJ4Y0.esm.js} +4 -2
  42. package/dist/{setup-CgBvqGWw.d.ts → setup-BBfVpTog.d.ts} +115 -0
  43. package/dist/{setup-CeQfb7bE.esm.js → setup-CBijDJ0d.esm.js} +20 -2
  44. package/dist/src-0Jurt29N.esm.js +4482 -0
  45. package/dist/{tri-N-xlKhZK.esm.js → tri-4RsGrIt6.esm.js} +1 -113
  46. package/dist/tri.esm.js +1 -1
  47. package/dist/video-selfie.esm.js +2 -2
  48. package/dist/wasm.d.ts +1 -1
  49. package/dist/wasm.esm.js +1 -1
  50. package/dist/workflow.d.ts +4 -4
  51. package/dist/workflow.esm.js +7 -5
  52. package/package.json +8 -3
  53. package/dist/session-CThOl8m5.esm.js +0 -1
@@ -0,0 +1,1121 @@
1
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/ParamStoreTypes.d.ts
2
+ type ParamType = 'string' | 'boolean' | 'number' | 'array' | 'object';
3
+ type RefType = 'gate' | 'gated_value' | 'static' | 'layer' | 'dynamic_config' | 'experiment';
4
+ type StaticParam = {
5
+ ref_type: 'static';
6
+ } & ({
7
+ param_type: 'boolean';
8
+ value: boolean;
9
+ } | {
10
+ param_type: 'number';
11
+ value: number;
12
+ } | {
13
+ param_type: 'string';
14
+ value: string;
15
+ } | {
16
+ param_type: 'object';
17
+ value: object;
18
+ } | {
19
+ param_type: 'array';
20
+ value: unknown[];
21
+ });
22
+ type GateParam = {
23
+ ref_type: 'gate';
24
+ gate_name: string;
25
+ } & ({
26
+ param_type: 'boolean';
27
+ pass_value: boolean;
28
+ fail_value: boolean;
29
+ } | {
30
+ param_type: 'number';
31
+ pass_value: number;
32
+ fail_value: number;
33
+ } | {
34
+ param_type: 'string';
35
+ pass_value: string;
36
+ fail_value: string;
37
+ } | {
38
+ param_type: 'object';
39
+ pass_value: object;
40
+ fail_value: object;
41
+ } | {
42
+ param_type: 'array';
43
+ pass_value: unknown[];
44
+ fail_value: unknown[];
45
+ });
46
+ type Param<R extends RefType, T extends ParamType> = {
47
+ ref_type: R;
48
+ param_type: T;
49
+ };
50
+ type LayerParam = Param<'layer', ParamType> & {
51
+ layer_name: string;
52
+ param_name: string;
53
+ };
54
+ type DynamicConfigParam = Param<'dynamic_config', ParamType> & {
55
+ config_name: string;
56
+ param_name: string;
57
+ };
58
+ type ExperimentParam = Param<'experiment', ParamType> & {
59
+ experiment_name: string;
60
+ param_name: string;
61
+ };
62
+ type AnyParam = GateParam | StaticParam | LayerParam | DynamicConfigParam | ExperimentParam;
63
+ type ParamStoreConfig = {
64
+ [param_name: string]: AnyParam | undefined;
65
+ };
66
+ //#endregion
67
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/TypingUtils.d.ts
68
+ type Flatten<T> = { [K in keyof T]: T[K]; } & {};
69
+ //#endregion
70
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StatsigTypes.d.ts
71
+ type TypedGet = <T = unknown>(key: string, fallback?: T) => TypedReturn<T>;
72
+ type TypedReturn<T = unknown> = T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends Array<unknown> ? Array<unknown> : T extends object ? object : unknown;
73
+ type FeatureGate = Flatten<{
74
+ readonly name: string;
75
+ readonly ruleID: string;
76
+ readonly details: EvaluationDetails;
77
+ readonly value: boolean;
78
+ readonly idType: string | null;
79
+ readonly __evaluation: GateEvaluation | null;
80
+ }>;
81
+ type Experiment = Flatten<{
82
+ readonly name: string;
83
+ readonly ruleID: string;
84
+ readonly details: EvaluationDetails;
85
+ readonly value: Record<string, unknown>;
86
+ readonly groupName: string | null;
87
+ readonly idType: string | null;
88
+ readonly __evaluation: ExperimentEvaluation | null;
89
+ readonly get: TypedGet;
90
+ }>;
91
+ type DynamicConfig = Flatten<Omit<Experiment, 'groupName'>>;
92
+ type Layer = Flatten<{
93
+ readonly name: string;
94
+ readonly ruleID: string;
95
+ readonly details: EvaluationDetails;
96
+ readonly groupName: string | null;
97
+ readonly __value: Record<string, unknown>;
98
+ readonly __evaluation: LayerEvaluation | null;
99
+ get: TypedGet;
100
+ }>;
101
+ type ParameterStore = Flatten<{
102
+ readonly name: string;
103
+ readonly details: EvaluationDetails;
104
+ readonly get: TypedGet;
105
+ readonly __configuration: ParamStoreConfig | null;
106
+ }>;
107
+ //#endregion
108
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/Log.d.ts
109
+ declare const LogLevel: {
110
+ readonly None: 0;
111
+ readonly Error: 1;
112
+ readonly Warn: 2;
113
+ readonly Info: 3;
114
+ readonly Debug: 4;
115
+ };
116
+ type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
117
+ //#endregion
118
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/NetworkConfig.d.ts
119
+ declare const Endpoint: {
120
+ readonly _initialize: "initialize";
121
+ readonly _rgstr: "rgstr";
122
+ readonly _download_config_specs: "download_config_specs";
123
+ };
124
+ type Endpoint = (typeof Endpoint)[keyof typeof Endpoint];
125
+ type NetworkPriority = 'high' | 'low' | 'auto';
126
+ type NetworkArgs = RequestInit & {
127
+ priority?: NetworkPriority;
128
+ };
129
+ //#endregion
130
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/EvaluationOptions.d.ts
131
+ type EvaluationOptionsCommon = {
132
+ /**
133
+ * Prevents an exposure log being created for this check.
134
+ *
135
+ * default: `false`
136
+ */
137
+ disableExposureLog?: boolean;
138
+ };
139
+ type FeatureGateEvaluationOptions = EvaluationOptionsCommon & {};
140
+ type DynamicConfigEvaluationOptions = EvaluationOptionsCommon & {};
141
+ type ExperimentEvaluationOptions = EvaluationOptionsCommon & {
142
+ /**
143
+ * Provide a map of values to be used across checks
144
+ *
145
+ * @requires {@link @statsig/js-user-persisted-storage}
146
+ * @see {@link https://docs.statsig.com/client/concepts/persistent_assignment#example-usage}
147
+ */
148
+ userPersistedValues?: unknown;
149
+ };
150
+ type LayerEvaluationOptions = EvaluationOptionsCommon & {
151
+ /**
152
+ * Provide a map of values to be used across checks
153
+ *
154
+ * @requires {@link @statsig/js-user-persisted-storage}
155
+ * @see {@link https://docs.statsig.com/client/concepts/persistent_assignment#example-usage}
156
+ */
157
+ userPersistedValues?: unknown;
158
+ };
159
+ type ParameterStoreEvaluationOptions = EvaluationOptionsCommon & {};
160
+ //#endregion
161
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/OverrideAdapter.d.ts
162
+ type OverrideAdapter = {
163
+ getGateOverride?(current: FeatureGate, user: StatsigUser, options?: FeatureGateEvaluationOptions): FeatureGate | null;
164
+ getDynamicConfigOverride?(current: DynamicConfig, user: StatsigUser, options?: DynamicConfigEvaluationOptions): DynamicConfig | null;
165
+ getExperimentOverride?(current: Experiment, user: StatsigUser, options?: ExperimentEvaluationOptions): Experiment | null;
166
+ getLayerOverride?(current: Layer, user: StatsigUser, options?: LayerEvaluationOptions): Layer | null;
167
+ getParamStoreOverride?(current: ParameterStore, options?: ParameterStoreEvaluationOptions): {
168
+ config: ParamStoreConfig;
169
+ details: EvaluationDetails;
170
+ } | null;
171
+ loadFromStorage?(): void | Promise<void>;
172
+ };
173
+ //#endregion
174
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StorageProvider.d.ts
175
+ type StorageProvider = {
176
+ isReady: () => boolean;
177
+ isReadyResolver: () => Promise<void> | null;
178
+ getProviderName: () => string;
179
+ getItem: (key: string) => string | null;
180
+ setItem: (key: string, value: string) => void;
181
+ removeItem: (key: string) => void;
182
+ getAllKeys: () => readonly string[];
183
+ };
184
+ //#endregion
185
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StatsigOptionsCommon.d.ts
186
+ /** Options that can be set at init and updated during runtime. */
187
+ type StatsigRuntimeMutableOptions = {
188
+ /**
189
+ * Prevents sending any events over the network.
190
+ * @deprecated Set {@link StatsigRuntimeMutableOptions.loggingEnabled} to "disabled" instead
191
+ */
192
+ disableLogging?: boolean;
193
+ /**
194
+ * Controls when to enable or disable logging:
195
+ * - "disabled": Prevents sending any events over the network.
196
+ * - "browser-only": Only sends events in browser environments.
197
+ * - "always": Skip browser checks and always logs events
198
+ *
199
+ * @default "browser-only"
200
+ */
201
+ loggingEnabled?: LoggingEnabledOption;
202
+ /**
203
+ * Prevents writing anything to storage.
204
+ *
205
+ * Note: caching will not work if storage is disabled
206
+ */
207
+ disableStorage?: boolean;
208
+ /**
209
+ * @deprecated Use `logEventCompressionMode` instead.
210
+ * Whether or not Statsig should compress JSON bodies for network requests where possible.
211
+ *
212
+ * default: `false`
213
+ */
214
+ disableCompression?: boolean;
215
+ /**
216
+ * Opt in cookie usage.
217
+ */
218
+ enableCookies?: boolean;
219
+ /**
220
+ * Controls JSON body compression for network requests.
221
+ * - `disabled`: Never compress
222
+ * - `enabled`: Compress unless using a proxy
223
+ * - `forced`: Always compress, even with a proxy
224
+ *
225
+ * default: `enabled`
226
+ */
227
+ logEventCompressionMode?: LogEventCompressionMode;
228
+ };
229
+ type NetworkConfigCommon = {
230
+ /**
231
+ * The API to use for all SDK network requests. You should not need to override this
232
+ * unless you have a custom API that implements the Statsig endpoints.
233
+ */
234
+ api?: string;
235
+ /**
236
+ * The URL used to flush queued events via a POST request. Takes precedence over {@link StatsigOptionsCommon.api}.
237
+ *
238
+ * default: `https://prodregistryv2.org/v1/rgstr`
239
+ */
240
+ logEventUrl?: string;
241
+ /**
242
+ * The URL used to report SDK exceptions via a POST request.
243
+ *
244
+ * default: `https://statsigapi.net/v1/sdk_exception`
245
+ */
246
+ sdkExceptionUrl?: string;
247
+ /**
248
+ * A list of URLs to try if the primary logEventUrl fails.
249
+ */
250
+ logEventFallbackUrls?: string[];
251
+ /**
252
+ * Overrides the default networking layer used by the Statsig client.
253
+ * By default, the client use `fetch`, but overriding this
254
+ * you could use `axios` or raw `XMLHttpRequest`
255
+ *
256
+ * default: `Fetch API`
257
+ *
258
+ * @param {string} url Where the request is going.
259
+ * @param {NetworkArgs} args Configuration for the network request.
260
+ * @returns {Response}
261
+ */
262
+ networkOverrideFunc?: (url: string, args: NetworkArgs) => Promise<Response>;
263
+ /**
264
+ * The maximum amount of time (in milliseconds) that any network request can take
265
+ * before timing out.
266
+ *
267
+ * default: `10,000 ms` (10 seconds)
268
+ */
269
+ networkTimeoutMs?: number;
270
+ /**
271
+ * Intended for testing purposes. Prevents any network requests being made.
272
+ */
273
+ preventAllNetworkTraffic?: boolean;
274
+ };
275
+ /** Options for configuring a Statsig client. */
276
+ type StatsigOptionsCommon<NetworkConfig extends NetworkConfigCommon> = StatsigRuntimeMutableOptions & {
277
+ /**
278
+ * When true, the SDK will not generate a stableID for the user. Useful when bootstrapping from a server without a StableID.
279
+ *
280
+ * default: `false`
281
+ */
282
+ disableStableID?: boolean;
283
+ /**
284
+ * Whether or not Statsig should use raw JSON for network requests where possible.
285
+ *
286
+ * default: `false`
287
+ */
288
+ disableStatsigEncoding?: boolean;
289
+ /**
290
+ * An object you can use to set environment variables that apply to all of your users
291
+ * in the same session.
292
+ */
293
+ environment?: StatsigEnvironment;
294
+ /**
295
+ * (Web only) Should the 'current page' url be included with logged events.
296
+ *
297
+ * default: true
298
+ */
299
+ includeCurrentPageUrlWithEvents?: boolean;
300
+ /**
301
+ * How much information is allowed to be printed to the console.
302
+ *
303
+ * default: {@link LogLevel.Warn}
304
+ */
305
+ logLevel?: LogLevel;
306
+ /**
307
+ * The maximum number of events to batch before flushing logs to Statsig.
308
+ *
309
+ * default: `100`
310
+ */
311
+ loggingBufferMaxSize?: number;
312
+ /**
313
+ * @deprecated The event logger now has built in flush timing.
314
+ */
315
+ loggingIntervalMs?: number;
316
+ /**
317
+ * Allows for fine grained control over which api or urls are hit for specific Statsig network requests.
318
+ *
319
+ * For defaults see {@link StatsigClientUrlOverrideOptions}
320
+ */
321
+ networkConfig?: NetworkConfig;
322
+ /**
323
+ * An implementor of {@link OverrideAdapter}, used to alter evaluations before its
324
+ * returned to the caller of a check api (checkGate/getExperiment etc).
325
+ */
326
+ overrideAdapter?: OverrideAdapter;
327
+ /**
328
+ * Overrides the auto-generated SessionID with the provided string.
329
+ *
330
+ * Note: Sessions still expire and will be replaced with an auto-generated SessionID.
331
+ */
332
+ initialSessionID?: string;
333
+ /**
334
+ * Swaps out the storage layer used by the SDK.
335
+ *
336
+ * default: `window.localStorage` on Web. `@react-native-async-storage/async-storage` on Mobile.
337
+ */
338
+ storageProvider?: StorageProvider;
339
+ /**
340
+ * Disables all memoization of the core evaluation functions.
341
+ *
342
+ * default: `false`
343
+ */
344
+ disableEvaluationMemoization?: boolean;
345
+ };
346
+ type AnyStatsigOptions = StatsigOptionsCommon<NetworkConfigCommon>;
347
+ type StatsigEnvironment = {
348
+ tier?: string;
349
+ [key: string]: string | undefined;
350
+ };
351
+ declare const LogEventCompressionMode: {
352
+ /** Do not compress request bodies */
353
+ readonly Disabled: "d";
354
+ /** Compress request bodies unless a network proxy is configured */
355
+ readonly Enabled: "e";
356
+ /** Always compress request bodies, even when a proxy is configured */
357
+ readonly Forced: "f";
358
+ };
359
+ type LogEventCompressionMode = (typeof LogEventCompressionMode)[keyof typeof LogEventCompressionMode];
360
+ declare const LoggingEnabledOption: {
361
+ readonly disabled: "disabled";
362
+ readonly browserOnly: "browser-only";
363
+ readonly always: "always";
364
+ };
365
+ type LoggingEnabledOption = (typeof LoggingEnabledOption)[keyof typeof LoggingEnabledOption];
366
+ //#endregion
367
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StatsigUser.d.ts
368
+ type StatsigUserPrimitives = string | number | boolean | Array<string> | undefined;
369
+ type StatsigUser = {
370
+ userID?: string;
371
+ customIDs?: {
372
+ [key: string]: string | undefined;
373
+ stableID?: string;
374
+ };
375
+ email?: string;
376
+ ip?: string;
377
+ userAgent?: string;
378
+ country?: string;
379
+ locale?: string;
380
+ appVersion?: string;
381
+ custom?: Record<string, StatsigUserPrimitives>;
382
+ privateAttributes?: Record<string, StatsigUserPrimitives> | null;
383
+ analyticsOnlyMetadata?: Record<string, string | number | boolean>;
384
+ };
385
+ //#endregion
386
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StatsigEvent.d.ts
387
+ type StatsigEvent = {
388
+ eventName: string;
389
+ value?: string | number | null;
390
+ metadata?: {
391
+ [key: string]: string | undefined;
392
+ } | null;
393
+ };
394
+ type BootstrapMetadata = {
395
+ generatorSDKInfo?: Record<string, string>;
396
+ lcut?: number;
397
+ user?: Record<string, unknown>;
398
+ };
399
+ //#endregion
400
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/EvaluationTypes.d.ts
401
+ type EvaluationBase<T> = {
402
+ id_type: string;
403
+ name: string;
404
+ rule_id: string;
405
+ secondary_exposures: SecondaryExposure[] | string[];
406
+ value: T;
407
+ version?: string;
408
+ };
409
+ type SecondaryExposure = {
410
+ gate: string;
411
+ gateValue: string;
412
+ ruleID: string;
413
+ };
414
+ type GateEvaluation = EvaluationBase<boolean>;
415
+ type ExperimentEvaluation = Flatten<EvaluationBase<Record<string, unknown>> & {
416
+ group_name?: string;
417
+ group: string;
418
+ id_type: string;
419
+ is_device_based: boolean;
420
+ is_experiment_active?: boolean;
421
+ is_user_in_experiment?: boolean;
422
+ passed?: boolean;
423
+ is_in_layer?: boolean;
424
+ explicit_parameters?: string[];
425
+ }>;
426
+ type DynamicConfigEvaluation = ExperimentEvaluation;
427
+ type LayerEvaluation = Flatten<Omit<ExperimentEvaluation, 'id_type'> & {
428
+ allocated_experiment_name: string;
429
+ explicit_parameters: string[];
430
+ undelegated_secondary_exposures?: SecondaryExposure[] | string[];
431
+ parameter_rule_ids?: Record<string, string>;
432
+ }>;
433
+ type EvaluationDetails = {
434
+ reason: string;
435
+ lcut?: number;
436
+ receivedAt?: number;
437
+ warnings?: StatsigWarnings[];
438
+ bootstrapMetadata?: BootstrapMetadata;
439
+ };
440
+ type StatsigWarnings = 'PartialUserMatch' | 'StableIDMismatch' | 'MultipleInitializations' | 'NoCachedValues';
441
+ //#endregion
442
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/EvaluationTypesV2.d.ts
443
+ type GateEvaluationV2 = {
444
+ v?: true;
445
+ r?: string | null;
446
+ i?: string;
447
+ s?: string[];
448
+ };
449
+ type ExperimentEvaluationV2 = {
450
+ r: string;
451
+ v: string;
452
+ gn?: string | null;
453
+ i?: string;
454
+ s?: string[];
455
+ ue?: true;
456
+ ea?: true;
457
+ p?: true;
458
+ };
459
+ type DynamicConfigEvaluationV2 = ExperimentEvaluationV2;
460
+ type LayerEvaluationV2 = {
461
+ r: string;
462
+ v: string;
463
+ gn?: string | null;
464
+ i?: string;
465
+ s?: string[];
466
+ us?: string[];
467
+ ue?: true;
468
+ ea?: true;
469
+ ep?: string[];
470
+ ae?: string;
471
+ pr?: Record<string, string>;
472
+ };
473
+ //#endregion
474
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/InitializeResponse.d.ts
475
+ type SessionReplayFields = {
476
+ can_record_session?: boolean;
477
+ recording_blocked?: boolean;
478
+ session_recording_rate?: number;
479
+ passes_session_recording_targeting?: boolean;
480
+ session_recording_event_triggers?: Record<string, SessionReplayTrigger>;
481
+ session_recording_exposure_triggers?: Record<string, SessionReplayTrigger>;
482
+ session_recording_privacy_settings?: SessionReplayPrivacySettings;
483
+ };
484
+ type SessionReplayTrigger = {
485
+ values?: string[];
486
+ passes_sampling?: boolean;
487
+ };
488
+ type SessionReplayPrivacySettings = {
489
+ privacy_mode?: 'min' | 'input' | 'max';
490
+ unmasked_elements?: string[];
491
+ masked_elements?: string[];
492
+ blocked_elements?: string[];
493
+ };
494
+ type AutoCaptureFields = {
495
+ auto_capture_settings?: {
496
+ disabled_events: Record<string, boolean>;
497
+ };
498
+ };
499
+ type InitResponseCommon = SessionReplayFields & AutoCaptureFields & {
500
+ param_stores?: Record<string, ParamStoreConfig>;
501
+ time: number;
502
+ has_updates: true;
503
+ hash_used: 'none' | 'sha256' | 'djb2';
504
+ user: StatsigUser;
505
+ sdkInfo?: Record<string, string>;
506
+ sdkParams?: Record<string, unknown>;
507
+ generator?: string;
508
+ evaluated_keys?: Record<string, unknown>;
509
+ pa_hash?: string;
510
+ derived_fields?: Record<string, unknown>;
511
+ sdk_flags?: Record<string, boolean>;
512
+ full_checksum?: string;
513
+ exposures?: Record<string, SecondaryExposure>;
514
+ };
515
+ type InitializeResponseV1WithUpdates = InitResponseCommon & {
516
+ feature_gates: Record<string, GateEvaluation>;
517
+ dynamic_configs: Record<string, DynamicConfigEvaluation>;
518
+ layer_configs: Record<string, LayerEvaluation>;
519
+ response_format?: 'init-v1' | null | undefined;
520
+ };
521
+ type InitializeResponseV2 = InitResponseCommon & {
522
+ feature_gates: Record<string, GateEvaluationV2>;
523
+ dynamic_configs: Record<string, DynamicConfigEvaluationV2>;
524
+ layer_configs: Record<string, LayerEvaluationV2>;
525
+ values: Record<string, Record<string, unknown>>;
526
+ response_format: 'init-v2';
527
+ };
528
+ type ClientInitializeResponseOptions = {
529
+ hash?: 'none' | 'sha256' | 'djb2';
530
+ clientSDKKey?: string;
531
+ };
532
+ type AnyInitializeResponse = InitializeResponseV1WithUpdates | InitializeResponseV2;
533
+ //#endregion
534
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/DownloadConfigSpecsResponse.d.ts
535
+ type SessionReplayTriggerSpec = {
536
+ values?: string[];
537
+ sampling_rate?: number;
538
+ };
539
+ type SessionReplayInfoSpec = {
540
+ recording_blocked?: boolean;
541
+ sampling_rate?: number;
542
+ targeting_gate?: string;
543
+ session_recording_event_triggers?: Record<string, SessionReplayTriggerSpec>;
544
+ session_recording_exposure_triggers?: Record<string, SessionReplayTriggerSpec>;
545
+ session_recording_privacy_settings?: SessionReplayPrivacySettings;
546
+ };
547
+ type SpecCondition = {
548
+ type: string;
549
+ targetValue: unknown;
550
+ operator: string | null;
551
+ field: string | null;
552
+ additionalValues: Record<string, unknown> | null;
553
+ idType: string;
554
+ };
555
+ type SpecRule = {
556
+ name: string;
557
+ passPercentage: number;
558
+ conditions: SpecCondition[];
559
+ returnValue: unknown;
560
+ id: string;
561
+ salt: string;
562
+ idType: string;
563
+ configDelegate: string | null;
564
+ isExperimentGroup?: boolean;
565
+ groupName?: string;
566
+ };
567
+ type Spec = {
568
+ name: string;
569
+ type: string;
570
+ salt: string;
571
+ defaultValue: unknown;
572
+ enabled: boolean;
573
+ idType: string;
574
+ rules: SpecRule[];
575
+ entity: string;
576
+ explicitParameters: string[] | null;
577
+ hasSharedParams: boolean;
578
+ isActive?: boolean;
579
+ targetAppIDs?: string[];
580
+ version?: number;
581
+ };
582
+ type ParamStore = {
583
+ targetAppIDs?: string[];
584
+ parameters: ParamStoreConfig;
585
+ };
586
+ type DownloadConfigSpecsResponse = {
587
+ feature_gates: Spec[];
588
+ dynamic_configs: Spec[];
589
+ layer_configs: Spec[];
590
+ param_stores?: Record<string, ParamStore>;
591
+ layers?: Record<string, string[]>;
592
+ time: number;
593
+ has_updates: boolean;
594
+ sdkInfo?: Record<string, string>;
595
+ user?: StatsigUser;
596
+ default_environment?: string;
597
+ sdk_keys_to_app_ids?: Record<string, string>;
598
+ hashed_sdk_keys_to_app_ids?: Record<string, string>;
599
+ hashed_sdk_keys_to_entities?: Record<string, {
600
+ gates: string[];
601
+ configs: string[];
602
+ experiments: string[];
603
+ }>;
604
+ app_id?: string;
605
+ session_replay_info?: SessionReplayInfoSpec;
606
+ };
607
+ //#endregion
608
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/UrlConfiguration.d.ts
609
+ type EndpointDnsKey = 'i' | 'e' | 'd';
610
+ declare class UrlConfiguration {
611
+ readonly endpoint: Endpoint;
612
+ readonly endpointDnsKey: EndpointDnsKey;
613
+ readonly defaultUrl: string;
614
+ readonly customUrl: string | null;
615
+ readonly fallbackUrls: string[] | null;
616
+ constructor(endpoint: Endpoint, customUrl: string | undefined | null, customApi: string | undefined | null, fallbackUrls: string[] | undefined | null);
617
+ getUrl(): string;
618
+ getChecksum(): string;
619
+ }
620
+ //#endregion
621
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/NetworkCore.d.ts
622
+ type RequestArgs = {
623
+ sdkKey: string;
624
+ urlConfig: UrlConfiguration;
625
+ priority?: NetworkPriority;
626
+ retries?: number;
627
+ attempt?: number;
628
+ preserveFailedStatusCode?: boolean;
629
+ params?: Record<string, string>;
630
+ headers?: Record<string, string>;
631
+ credentials?: RequestCredentials;
632
+ };
633
+ type DataFlags = {
634
+ isStatsigEncodable?: boolean;
635
+ isCompressable?: boolean;
636
+ };
637
+ type RequestArgsWithData = Flatten<RequestArgs & {
638
+ data: Record<string, unknown>;
639
+ } & DataFlags>;
640
+ type RequestFailureInfo = {
641
+ path?: string;
642
+ errorMessage?: string;
643
+ diagnosticBucket?: string;
644
+ diagnosticMetadata?: Record<string, string>;
645
+ };
646
+ type BeaconRequestArgs = Pick<RequestArgsWithData, 'data' | 'sdkKey' | 'urlConfig' | 'params' | 'isCompressable' | 'attempt'>;
647
+ type NetworkResponse = {
648
+ body: string | null;
649
+ code: number;
650
+ };
651
+ declare class NetworkCore {
652
+ private _emitter?;
653
+ protected _errorBoundary: ErrorBoundary | null;
654
+ private readonly _timeout;
655
+ private readonly _netConfig;
656
+ private readonly _options;
657
+ private readonly _fallbackResolver;
658
+ private _leakyBucket;
659
+ private _lastUsedInitUrl;
660
+ constructor(options: AnyStatsigOptions | null, _emitter?: StatsigClientEmitEventFunc | undefined);
661
+ setLogEventCompressionMode(mode: LogEventCompressionMode): void;
662
+ setErrorBoundary(errorBoundary: ErrorBoundary): void;
663
+ isBeaconSupported(): boolean;
664
+ getLastUsedInitUrlAndReset(): string | null;
665
+ beacon(args: BeaconRequestArgs, failureInfo?: RequestFailureInfo): boolean;
666
+ post(args: RequestArgsWithData, failureInfo?: RequestFailureInfo): Promise<NetworkResponse | null>;
667
+ get(args: RequestArgs): Promise<NetworkResponse | null>;
668
+ private _sendRequest;
669
+ private _getLogEventCompressionMode;
670
+ private _isRateLimited;
671
+ private _getPopulatedURL;
672
+ private _tryEncodeBody;
673
+ private _tryToCompressBody;
674
+ private _getInternalRequestArgs;
675
+ }
676
+ //#endregion
677
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StatsigDataAdapter.d.ts
678
+ type DataSource = 'Uninitialized' | 'Loading' | 'NoValues' | 'Cache' | 'Network' | 'NetworkNotModified' | 'Bootstrap' | 'Prefetch';
679
+ type DataAdapterResult = {
680
+ readonly source: DataSource;
681
+ readonly data: string;
682
+ readonly receivedAt: number;
683
+ readonly stableID: string | null;
684
+ readonly fullUserHash: string | null;
685
+ };
686
+ type DataAdapterAsyncOptions = {
687
+ /**
688
+ * The maximum amount of time (in milliseconds) this operation is permitted to run.
689
+ * If the timeout is hit, null is returned but any in-flight requests are kept alive with results going to cache for future updates.
690
+ *
691
+ * Note: If no timeout is given, the {@link NetworkConfigCommon.networkTimeoutMs|StatsigOptions.networkConfig.networkTimeoutMs} is used.
692
+ */
693
+ readonly timeoutMs?: NetworkConfigCommon['networkTimeoutMs'];
694
+ /**
695
+ * The priority that should be applied to the Http request that is fired.
696
+ *
697
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/fetch#priority
698
+ *
699
+ * default: 'auto'
700
+ */
701
+ readonly priority?: NetworkPriority;
702
+ };
703
+ /**
704
+ * Describes a type that is used during intialize/update operations of a Statsig client.
705
+ *
706
+ * See below to find the default adapters, but know that it is possible to create your
707
+ * own StatsigDataAdapter and provide it via `StatsigOptions.dataAdapter`.
708
+ *
709
+ * defaults:
710
+ *
711
+ * - {@link StatsigClient} uses {@link EvaluationsDataAdapter}
712
+ *
713
+ * - {@link StatsigOnDeviceEvalClient} uses {@link SpecsDataAdapter}
714
+ */
715
+ type DataAdapterCommon = {
716
+ /**
717
+ * Called when the StatsigDataAdapter is attached to the Statsig client instance during construction.
718
+ * @param {string} sdkKey The SDK key being used by the Statsig client.
719
+ * @param {StatsigOptionsCommon | null} options The StatsigOptions being used by the Statsig client.
720
+ */
721
+ readonly attach: (sdkKey: string, options: AnyStatsigOptions | null, network: NetworkCore) => void;
722
+ };
723
+ type EvaluationsDataAdapter = DataAdapterCommon & {
724
+ /**
725
+ * Synchronously get evaluation data for the given user. Called during initializeSync and/or updateUserSync.
726
+ *
727
+ * It is also called during async update operations before StatsigDataAdapter.getDataAsync is called.
728
+ * @param {StatsigUser} user The StatsigUser to get data for.
729
+ * @returns {DataAdapterResult | null} The data that was found for the given StatsigUser.
730
+ */
731
+ readonly getDataSync: (user: StatsigUser) => DataAdapterResult | null;
732
+ /**
733
+ * Asynchronously get evaluation data for the given user. Called during initializeAsync and/or updateUserAsync.
734
+ *
735
+ * @param {DataAdapterResult | null} current The data that was found synchronously (Cache). Will be used as fallback if getDataAsync fails
736
+ * @param {StatsigUser} user The StatsigUser to get data for.
737
+ * @returns {DataAdapterResult | null} The data that was found for the given StatsigUser.
738
+ */
739
+ readonly getDataAsync: (current: DataAdapterResult | null, user: StatsigUser, options?: DataAdapterAsyncOptions) => Promise<DataAdapterResult | null>;
740
+ /**
741
+ * Manually trigger a fetch for new evaluations data for the given user.
742
+ *
743
+ * @param {StatsigUser} user The StatsigUser to get data for.
744
+ */
745
+ readonly prefetchData: (user: StatsigUser, options?: DataAdapterAsyncOptions) => Promise<void>;
746
+ /**
747
+ * Manually set the evaluations data from a JSON string.
748
+ *
749
+ * Statsig Server SDKs supported:
750
+ * - node-js-server-sdk\@5.20.0
751
+ * - java-server-sdk\@1.18.0
752
+ * - python-sdk\@0.32.0
753
+ * - ruby-sdk\@1.34.0
754
+ * - dotnet-sdk\@1.25.0
755
+ * - php-sdk\@3.2.0
756
+ *
757
+ * Note: You can use {@link EvaluationsDataAdapter.setDataLegacy} if your server is running an older Statsig Server SDK.
758
+ */
759
+ readonly setData: (data: string) => void;
760
+ /**
761
+ * Manually set evaluations data for the given user.
762
+ *
763
+ * @param {StatsigUser} user The StatsigUser this data is for.
764
+ *
765
+ * @deprecated This method is provided only to support older versions of Statsig server SDKs.
766
+ * Newer SDKs include the StatsigUser as part of the data string, and can be used with the {@link EvaluationsDataAdapter.setData} method instead.
767
+ */
768
+ readonly setDataLegacy: (data: string, user: StatsigUser) => void;
769
+ };
770
+ type SpecsDataAdapter = DataAdapterCommon & {
771
+ /**
772
+ * Synchronously get specs data. Called during initializeSync and/or updateUserSync.
773
+ * It is also called during async update operations before StatsigDataAdapter.getDataAsync is called.
774
+ * @returns {DataAdapterResult | null} The data that was found for the given StatsigUser.
775
+ */
776
+ readonly getDataSync: () => DataAdapterResult | null;
777
+ /**
778
+ * Asynchronously get specs data. Called during initializeAsync and/or updateUserAsync.
779
+ *
780
+ * @param {DataAdapterResult | null} current The data that was found synchronously (Cache). Will be used as fallback if getDataAsync fails
781
+ * @returns {DataAdapterResult | null} The data that was found for the given StatsigUser.
782
+ */
783
+ readonly getDataAsync: (current: DataAdapterResult | null, options?: DataAdapterAsyncOptions) => Promise<DataAdapterResult | null>;
784
+ /**
785
+ * Manually trigger a fetch for new specs data.
786
+ */
787
+ readonly prefetchData: (options?: DataAdapterAsyncOptions) => Promise<void>;
788
+ /**
789
+ * Manually set specs data (Bootstrap).
790
+ */
791
+ readonly setData: (data: string) => void;
792
+ };
793
+ //#endregion
794
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StatsigClientEventEmitter.d.ts
795
+ type StatsigLoadingStatus = 'Uninitialized' | 'Loading' | 'Ready';
796
+ declare const ErrorTag: {
797
+ readonly NetworkError: "NetworkError";
798
+ };
799
+ type ErrorTag = (typeof ErrorTag)[keyof typeof ErrorTag];
800
+ type ErrorEventData = {
801
+ error: unknown;
802
+ tag: ErrorTag | string;
803
+ } | {
804
+ error: unknown;
805
+ tag: 'NetworkError';
806
+ requestArgs: Record<string, unknown>;
807
+ };
808
+ type EventNameToEventDataMap = {
809
+ values_updated: {
810
+ status: StatsigLoadingStatus;
811
+ values: DataAdapterResult | null;
812
+ };
813
+ session_expired: object;
814
+ error: ErrorEventData;
815
+ pre_logs_flushed: {
816
+ events: Record<string, unknown>[];
817
+ };
818
+ logs_flushed: {
819
+ events: Record<string, unknown>[];
820
+ };
821
+ pre_shutdown: object;
822
+ initialization_failure: object;
823
+ gate_evaluation: {
824
+ gate: FeatureGate;
825
+ };
826
+ dynamic_config_evaluation: {
827
+ dynamicConfig: DynamicConfig;
828
+ };
829
+ experiment_evaluation: {
830
+ experiment: Experiment;
831
+ };
832
+ layer_evaluation: {
833
+ layer: Layer;
834
+ };
835
+ log_event_called: {
836
+ event: StatsigEvent;
837
+ };
838
+ };
839
+ /**
840
+ * Type representing various events emitted by a Statsig client.
841
+ *
842
+ * `values_updated` - When the Statsig clients internal values change as the result of an initialize/update operation.
843
+ *
844
+ * `session_expired` - When the current session has expired.
845
+ *
846
+ * `error` - When an unexpected error occurs within the Statsig client.
847
+ *
848
+ * `pre_logs_flushed` - Fired just before queued StatsigEvents are flushed to Statsig servers.
849
+ *
850
+ * `logs_flushed` - When queued StatsigEvents are flushed to Statsig servers.
851
+ *
852
+ * `pre_shutdown` - Fired just before the SDK is shutdown
853
+ *
854
+ * `initialization_failure` - Fired when the client fails to initialize.
855
+ *
856
+ * `gate_evaluation` - Fired when any gate is checked from the Statsig client.
857
+ *
858
+ * `dynamic_config_evaluation` - Fired when any dyanamic config is checked from the Statsig client.
859
+ *
860
+ * `experiment_evaluation` - Fired when any experiment is checked from the Statsig client.
861
+ *
862
+ * `layer_evaluation` - Fired when any layer is checked from the Statsig client.
863
+ *
864
+ * `log_event_called` - Fired when log event is called.
865
+ */
866
+ type AnyStatsigClientEvent = Flatten<{ [K in keyof EventNameToEventDataMap]: {
867
+ name: K;
868
+ } & EventNameToEventDataMap[K]; }[keyof EventNameToEventDataMap]>;
869
+ type StatsigClientEvent<T> = Extract<AnyStatsigClientEvent, {
870
+ name: T;
871
+ }>;
872
+ type StatsigClientEventName = AnyStatsigClientEvent['name'] | '*';
873
+ type StatsigClientEventCallback<T extends StatsigClientEventName> = (event: T extends '*' ? AnyStatsigClientEvent : StatsigClientEvent<T>) => void;
874
+ interface StatsigClientEventEmitterInterface {
875
+ readonly loadingStatus: StatsigLoadingStatus;
876
+ on<T extends StatsigClientEventName>(event: T, listener: StatsigClientEventCallback<T>): void;
877
+ off<T extends StatsigClientEventName>(event: T, listener: StatsigClientEventCallback<T>): void;
878
+ /**
879
+ * (Statsig Use Only) - Same as .on() but logs errors to sdk_exception
880
+ */
881
+ $on<T extends StatsigClientEventName>(event: T, listener: StatsigClientEventCallback<T>): void;
882
+ /**
883
+ * (Statsig Use Only) - Emit StatsigClientEvents
884
+ */
885
+ $emt(event: AnyStatsigClientEvent): void;
886
+ }
887
+ //#endregion
888
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StatsigUpdateDetails.d.ts
889
+ type StatsigUpdateDetails = {
890
+ duration: number;
891
+ source: DataSource;
892
+ success: boolean;
893
+ error: Error | null;
894
+ sourceUrl: string | null;
895
+ warnings?: StatsigWarnings[];
896
+ };
897
+ //#endregion
898
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/StatsigClientBase.d.ts
899
+ type StatsigClientEmitEventFunc = (event: AnyStatsigClientEvent) => void;
900
+ //#endregion
901
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/ErrorBoundary.d.ts
902
+ declare class ErrorBoundary {
903
+ private _sdkKey;
904
+ private _options;
905
+ private _emitter?;
906
+ private _lastSeenError?;
907
+ private _seen;
908
+ constructor(_sdkKey: string, _options: AnyStatsigOptions | null, _emitter?: StatsigClientEmitEventFunc | undefined, _lastSeenError?: Error | undefined);
909
+ wrap(instance: unknown, namePrefix?: string): void;
910
+ logError(tag: string, error: unknown): void;
911
+ logDroppedEvents(count: number, reason: string, metadata?: Record<string, unknown>): void;
912
+ logEventRequestFailure(count: number, reason: string, flushType: string, statusCode: number, retries: number, failurePath?: string, failureErrorMessage?: string, failureDiagnosticBucket?: string, failureDiagnosticMetadata?: Record<string, string>): void;
913
+ getLastSeenErrorAndReset(): Error | null;
914
+ attachErrorIfNoneExists(error: unknown): void;
915
+ private _capture;
916
+ private _onError;
917
+ }
918
+ //#endregion
919
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/SessionID.d.ts
920
+ type SessionData = {
921
+ sessionID: string;
922
+ startTime: number;
923
+ lastUpdate: number;
924
+ };
925
+ type StatsigSession = {
926
+ data: SessionData;
927
+ sdkKey: string;
928
+ lastPersistedAt: number;
929
+ storageKey: string;
930
+ };
931
+ declare const StatsigSession: {
932
+ get: (sdkKey: string, bumpSession?: boolean) => StatsigSession;
933
+ overrideInitialSessionID: (override: string, sdkKey: string) => void;
934
+ checkForIdleSession: (sdkKey: string) => void;
935
+ };
936
+ //#endregion
937
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/ClientInterfaces.d.ts
938
+ interface StatsigClientCommonInterface extends StatsigClientEventEmitterInterface {
939
+ initializeSync(): StatsigUpdateDetails;
940
+ initializeAsync(): Promise<StatsigUpdateDetails>;
941
+ shutdown(): Promise<void>;
942
+ flush(): Promise<void>;
943
+ updateRuntimeOptions(options: StatsigRuntimeMutableOptions): void;
944
+ }
945
+ type CommonContext = {
946
+ sdkKey: string;
947
+ options: AnyStatsigOptions;
948
+ errorBoundary: ErrorBoundary;
949
+ session: StatsigSession;
950
+ stableID: string | null;
951
+ sdkInstanceID: string;
952
+ };
953
+ type OnDeviceEvaluationsContext = CommonContext & {
954
+ values: DownloadConfigSpecsResponse | null;
955
+ };
956
+ interface OnDeviceEvaluationsInterface extends StatsigClientCommonInterface {
957
+ readonly dataAdapter: SpecsDataAdapter;
958
+ getContext(): OnDeviceEvaluationsContext;
959
+ checkGate(name: string, user: StatsigUser, options?: FeatureGateEvaluationOptions): boolean;
960
+ getFeatureGate(name: string, user: StatsigUser, options?: FeatureGateEvaluationOptions): FeatureGate;
961
+ getDynamicConfig(name: string, user: StatsigUser, options?: DynamicConfigEvaluationOptions): DynamicConfig;
962
+ getExperiment(name: string, user: StatsigUser, options?: ExperimentEvaluationOptions): Experiment;
963
+ getLayer(name: string, user: StatsigUser, options?: LayerEvaluationOptions): Layer;
964
+ logEvent(event: StatsigEvent, user: StatsigUser): void;
965
+ logEvent(eventName: string, user: StatsigUser, value?: string | number, metadata?: Record<string, string>): void;
966
+ getClientInitializeResponse(user: StatsigUser, options?: ClientInitializeResponseOptions): AnyInitializeResponse | null;
967
+ }
968
+ type PrecomputedEvaluationsContext = Flatten<CommonContext & {
969
+ values: AnyInitializeResponse | null;
970
+ user: StatsigUser;
971
+ }>;
972
+ interface PrecomputedEvaluationsInterface extends StatsigClientCommonInterface {
973
+ readonly dataAdapter: EvaluationsDataAdapter;
974
+ getContext(): PrecomputedEvaluationsContext;
975
+ getContextHandle(): PrecomputedEvaluationsContextHandle;
976
+ updateUserSync(user: StatsigUser): StatsigUpdateDetails;
977
+ updateUserAsync(user: StatsigUser): Promise<StatsigUpdateDetails>;
978
+ checkGate(name: string, options?: FeatureGateEvaluationOptions): boolean;
979
+ getFeatureGate(name: string, options?: FeatureGateEvaluationOptions): FeatureGate;
980
+ getDynamicConfig(name: string, options?: DynamicConfigEvaluationOptions): DynamicConfig;
981
+ getExperiment(name: string, options?: ExperimentEvaluationOptions): Experiment;
982
+ getLayer(name: string, options?: LayerEvaluationOptions): Layer;
983
+ getParameterStore(name: string, options?: ParameterStoreEvaluationOptions): ParameterStore;
984
+ logEvent(event: StatsigEvent): void;
985
+ logEvent(eventName: string, value?: string | number, metadata?: Record<string, string>): void;
986
+ }
987
+ type StatsigClientInterface = OnDeviceEvaluationsInterface | PrecomputedEvaluationsInterface;
988
+ /**
989
+ * A handle to the PrecomputedEvaluationsContext that computes fields lazily on access.
990
+ * This avoids unnecessary computation (e.g., cloning the user) when only certain fields are needed.
991
+ * The handle is created once and reused; individual getters fetch current values on each access.
992
+ */
993
+ declare class PrecomputedEvaluationsContextHandle {
994
+ private _sdkKey;
995
+ private _getOptions;
996
+ private _getErrorBoundary;
997
+ private _getValues;
998
+ private _getUser;
999
+ private _getSdkInstanceID;
1000
+ constructor(sdkKey: string, getOptions: () => AnyStatsigOptions, getErrorBoundary: () => ErrorBoundary, getValues: () => AnyInitializeResponse | null, getUser: () => StatsigUser, getSdkInstanceID: () => string);
1001
+ get sdkKey(): string;
1002
+ get options(): AnyStatsigOptions;
1003
+ get errorBoundary(): ErrorBoundary;
1004
+ get values(): AnyInitializeResponse | null;
1005
+ get user(): StatsigUser;
1006
+ /**
1007
+ * Gets the current session.
1008
+ * @param {boolean} [bumpSession=true] - Whether to bump/update the session timing. Set to false to read without affecting session state.
1009
+ */
1010
+ getSession(bumpSession?: boolean): StatsigSession;
1011
+ get stableID(): string | null;
1012
+ get sdkInstanceID(): string;
1013
+ /**
1014
+ * Returns the full PrecomputedEvaluationsContext object.
1015
+ * Use this when you need all fields at once.
1016
+ * @param {boolean} [bumpSession=true] - Whether to bump the session when building the context.
1017
+ */
1018
+ toContext(bumpSession?: boolean): PrecomputedEvaluationsContext;
1019
+ }
1020
+ //#endregion
1021
+ //#region ../../node_modules/.pnpm/@statsig+client-core@3.33.3/node_modules/@statsig/client-core/src/$_StatsigGlobal.d.ts
1022
+ type StatsigGlobal = {
1023
+ [key: string]: unknown;
1024
+ instances?: Record<string, StatsigClientInterface>;
1025
+ firstInstance?: StatsigClientInterface;
1026
+ acInstances?: Record<string, unknown>;
1027
+ srInstances?: Record<string, unknown>;
1028
+ firstSRInstance?: unknown;
1029
+ instance: (sdkKey?: string) => StatsigClientInterface | undefined;
1030
+ };
1031
+ declare global {
1032
+ let __STATSIG__: StatsigGlobal | undefined;
1033
+ interface Window {
1034
+ __STATSIG__: StatsigGlobal | undefined;
1035
+ }
1036
+ }
1037
+ //#endregion
1038
+ //#region ../infra/src/capabilities/IFeatureManagementCapability.d.ts
1039
+ /**
1040
+ * Custom randomization-unit IDs merged into the FeatureManagement user object.
1041
+ * `undefined` values are treated as "not yet known" and are dropped before
1042
+ * being sent to the provider (never overwrite a known ID with `undefined`).
1043
+ */
1044
+ type FeatureManagementCustomIDs = Record<string, string | undefined>;
1045
+ /**
1046
+ * Which auto-collected feature-management user fields to blank out before
1047
+ * sending them to the provider. Mirrors every `StatsigUser` field except the
1048
+ * caller-owned `custom` / `customIDs` / `privateAttributes`. Each flag
1049
+ * defaults to `false` (sent as-is) except `ip` and `country`, which default
1050
+ * to `true` (redacted) — see {@link FeatureManagementProvider}'s resolved
1051
+ * defaults.
1052
+ */
1053
+ type FeatureManagementRedactedUserInfo = { [K in keyof Omit<StatsigUser, 'custom' | 'customIDs' | 'privateAttributes'>]?: boolean; };
1054
+ /**
1055
+ * Incremental identity enrichment passed to
1056
+ * {@link IFeatureManagementCapability.updateUser} as more randomization
1057
+ * units become known during the session lifecycle (e.g. `hashed_onboarding_id`
1058
+ * once the session is initialized, `flow_id` from the flow response, and
1059
+ * `workflow_id` from the workflow configuration).
1060
+ */
1061
+ type FeatureManagementUserUpdate = {
1062
+ customIDs?: FeatureManagementCustomIDs;
1063
+ custom?: Record<string, unknown>;
1064
+ };
1065
+ type FeatureManagementEventMetadataValue = boolean | number | string | Record<string, boolean | number | string>;
1066
+ type FeatureManagementEventMetadata = Record<string, FeatureManagementEventMetadataValue>;
1067
+ /**
1068
+ * Provenance of a synchronous feature-management read: whether the value
1069
+ * reflects a real evaluation (`'initialized'`), is a default because the
1070
+ * capability was never initialized (`'uninitialized'`), or is a default
1071
+ * because evaluation itself threw despite being initialized (`'error'`).
1072
+ *
1073
+ * This is a snapshot of *this read* only — it says nothing about whether a
1074
+ * later read might succeed (e.g. `'uninitialized'` covers both "still
1075
+ * booting" and "permanently opted out"; callers that need to distinguish
1076
+ * those must combine this with {@link IFeatureManagementCapability.initialized}
1077
+ * or wait on the readiness signal exposed by core).
1078
+ */
1079
+ type FeatureManagementReadStatus = 'initialized' | 'uninitialized' | 'error';
1080
+ /**
1081
+ * Read-only view of an experiment evaluation for the current user.
1082
+ */
1083
+ type FeatureManagementExperiment = {
1084
+ /** Typed parameter lookup; returns `fallback` if the param/experiment is unknown or the provider was never initialized. */
1085
+ get<T>(paramName: string, fallback: T): T;
1086
+ /** The evaluated group/arm name, or `null` before initialization or if the user is not in the experiment. */
1087
+ groupName: string | null;
1088
+ /** Provenance of this read — see {@link FeatureManagementReadStatus}. */
1089
+ status: FeatureManagementReadStatus;
1090
+ };
1091
+ type FeatureManagementLayer = {
1092
+ /** Typed parameter lookup; logs a native per-parameter layer exposure on call. Returns `fallback` if unknown or uninitialized. */
1093
+ get<T>(paramName: string, fallback: T): T;
1094
+ groupName: string | null;
1095
+ status: FeatureManagementReadStatus;
1096
+ };
1097
+ /**
1098
+ * Read-only view of a parameter store evaluation for the current user. Each
1099
+ * parameter key can be remapped in the Statsig console — to a static value,
1100
+ * a feature gate, an experiment param, or a layer param — without an SDK
1101
+ * release; this type has no `groupName` because a store is a router over
1102
+ * whichever entity its params are currently mapped to, not an entity with
1103
+ * its own arm/group.
1104
+ */
1105
+ type FeatureManagementParameterStore = {
1106
+ /** Typed parameter lookup; logs a native exposure for the mapped source (experiment/gate/layer) on call. Returns `fallback` if unknown or uninitialized. */
1107
+ get<T>(paramName: string, fallback: T): T;
1108
+ /** Provenance of this read — see {@link FeatureManagementReadStatus}. */
1109
+ status: FeatureManagementReadStatus;
1110
+ };
1111
+ /**
1112
+ * Read-only view of a feature gate evaluation for the current user.
1113
+ */
1114
+ type FeatureManagementGate = {
1115
+ /** The evaluated gate value, or `false` before initialization or on any evaluation error. */
1116
+ enabled: boolean;
1117
+ /** Provenance of this read — see {@link FeatureManagementReadStatus}. */
1118
+ status: FeatureManagementReadStatus;
1119
+ };
1120
+ //#endregion
1121
+ export { FeatureManagementParameterStore as a, FeatureManagementUserUpdate as c, FeatureManagementLayer as i, FeatureManagementExperiment as n, FeatureManagementReadStatus as o, FeatureManagementGate as r, FeatureManagementRedactedUserInfo as s, FeatureManagementEventMetadata as t };