@statsig/client-core 1.0.1 → 1.1.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
package/src/StatsigMetadata.d.ts
CHANGED
package/src/StatsigMetadata.js
CHANGED
|
@@ -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 = '1.
|
|
4
|
+
exports.SDK_VERSION = '1.1.1';
|
|
5
5
|
let metadata = {
|
|
6
6
|
sdkVersion: exports.SDK_VERSION,
|
|
7
7
|
sdkType: 'js-mono', // js-mono is overwritten by Precomp and OnDevice clients
|
|
@@ -26,17 +26,6 @@ export type NetworkConfigCommon = {
|
|
|
26
26
|
* default: `https://featuregates.org/v1/initialize`
|
|
27
27
|
*/
|
|
28
28
|
logEventUrl?: string;
|
|
29
|
-
/**
|
|
30
|
-
* The maximum amount of time (in milliseconds) that any network request can take
|
|
31
|
-
* before timing out.
|
|
32
|
-
*
|
|
33
|
-
* default: `10,000 ms` (10 seconds)
|
|
34
|
-
*/
|
|
35
|
-
networkTimeoutMs?: number;
|
|
36
|
-
/**
|
|
37
|
-
* Intended for testing purposes. Prevents any network requests being made.
|
|
38
|
-
*/
|
|
39
|
-
preventAllNetworkTraffic?: boolean;
|
|
40
29
|
/**
|
|
41
30
|
* Overrides the default networking layer used by the Statsig client.
|
|
42
31
|
* By default, the client use `fetch`, but overriding this
|
|
@@ -49,20 +38,43 @@ export type NetworkConfigCommon = {
|
|
|
49
38
|
* @returns {Response}
|
|
50
39
|
*/
|
|
51
40
|
networkOverrideFunc?: (url: string, args: NetworkArgs) => Promise<Response>;
|
|
41
|
+
/**
|
|
42
|
+
* The maximum amount of time (in milliseconds) that any network request can take
|
|
43
|
+
* before timing out.
|
|
44
|
+
*
|
|
45
|
+
* default: `10,000 ms` (10 seconds)
|
|
46
|
+
*/
|
|
47
|
+
networkTimeoutMs?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Intended for testing purposes. Prevents any network requests being made.
|
|
50
|
+
*/
|
|
51
|
+
preventAllNetworkTraffic?: boolean;
|
|
52
52
|
};
|
|
53
53
|
/** Options for configuring a Statsig client. */
|
|
54
54
|
export type StatsigOptionsCommon<NetworkConfig extends NetworkConfigCommon> = StatsigRuntimeMutableOptions & {
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* Whether or not Statsig should compress JSON bodies for network requests where possible.
|
|
57
57
|
*
|
|
58
|
-
*
|
|
58
|
+
* default: `false`
|
|
59
59
|
*/
|
|
60
|
-
|
|
60
|
+
disableCompression?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Whether or not Statsig should use raw JSON for network requests where possible.
|
|
63
|
+
*
|
|
64
|
+
* default: `false`
|
|
65
|
+
*/
|
|
66
|
+
disableStatsigEncoding?: boolean;
|
|
61
67
|
/**
|
|
62
68
|
* An object you can use to set environment variables that apply to all of your users
|
|
63
69
|
* in the same session.
|
|
64
70
|
*/
|
|
65
71
|
environment?: StatsigEnvironment;
|
|
72
|
+
/**
|
|
73
|
+
* (Web only) Should the 'current page' url be included with logged events.
|
|
74
|
+
*
|
|
75
|
+
* default: true
|
|
76
|
+
*/
|
|
77
|
+
includeCurrentPageUrlWithEvents?: boolean;
|
|
66
78
|
/**
|
|
67
79
|
* How much information is allowed to be printed to the console.
|
|
68
80
|
*
|
|
@@ -78,32 +90,20 @@ export type StatsigOptionsCommon<NetworkConfig extends NetworkConfigCommon> = St
|
|
|
78
90
|
/**
|
|
79
91
|
* How often (in milliseconds) to flush logs to Statsig.
|
|
80
92
|
*
|
|
81
|
-
* default: `10,000 ms`
|
|
93
|
+
* default: `10,000 ms` (10 seconds)
|
|
82
94
|
*/
|
|
83
95
|
loggingIntervalMs?: number;
|
|
84
96
|
/**
|
|
85
|
-
*
|
|
86
|
-
* returned to the caller of a check api (checkGate/getExperiment etc).
|
|
87
|
-
*/
|
|
88
|
-
overrideAdapter?: OverrideAdapter;
|
|
89
|
-
/**
|
|
90
|
-
* (Web only) Should the 'current page' url be included with logged events.
|
|
91
|
-
*
|
|
92
|
-
* default: true
|
|
93
|
-
*/
|
|
94
|
-
includeCurrentPageUrlWithEvents?: boolean;
|
|
95
|
-
/**
|
|
96
|
-
* Whether or not Statsig should use raw JSON for network requests where possible.
|
|
97
|
+
* Allows for fine grained control over which api or urls are hit for specific Statsig network requests.
|
|
97
98
|
*
|
|
98
|
-
*
|
|
99
|
+
* For defaults see {@link StatsigClientUrlOverrideOptions}
|
|
99
100
|
*/
|
|
100
|
-
|
|
101
|
+
networkConfig?: NetworkConfig;
|
|
101
102
|
/**
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
* default: `false`
|
|
103
|
+
* An implementor of {@link OverrideAdapter}, used to alter evaluations before its
|
|
104
|
+
* returned to the caller of a check api (checkGate/getExperiment etc).
|
|
105
105
|
*/
|
|
106
|
-
|
|
106
|
+
overrideAdapter?: OverrideAdapter;
|
|
107
107
|
};
|
|
108
108
|
export type AnyStatsigOptions = StatsigOptionsCommon<NetworkConfigCommon>;
|
|
109
109
|
export type StatsigEnvironment = {
|