@statsig/client-core 3.16.0 → 3.16.2
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 +1 -1
- package/src/EvaluationTypes.d.ts +1 -0
- package/src/InitializeResponse.d.ts +6 -0
- package/src/StatsigClientEventEmitter.d.ts +6 -0
- package/src/StatsigEvent.js +4 -3
- package/src/StatsigMetadata.d.ts +1 -1
- package/src/StatsigMetadata.js +1 -1
- package/src/StatsigPlugin.d.ts +1 -1
package/package.json
CHANGED
package/src/EvaluationTypes.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export type LayerEvaluation = Flatten<Omit<ExperimentEvaluation, 'id_type'> & {
|
|
|
29
29
|
allocated_experiment_name: string;
|
|
30
30
|
explicit_parameters: string[];
|
|
31
31
|
undelegated_secondary_exposures?: SecondaryExposure[] | string[];
|
|
32
|
+
parameter_rule_ids?: Record<string, string>;
|
|
32
33
|
}>;
|
|
33
34
|
export type AnyEvaluation = GateEvaluation | ExperimentEvaluation | DynamicConfigEvaluation | LayerEvaluation;
|
|
34
35
|
export type EvaluationDetails = {
|
|
@@ -4,6 +4,12 @@ import { StatsigUser } from './StatsigUser';
|
|
|
4
4
|
type SessionReplayFields = {
|
|
5
5
|
can_record_session?: boolean;
|
|
6
6
|
session_recording_rate?: number;
|
|
7
|
+
passes_session_recording_targeting?: boolean;
|
|
8
|
+
session_recording_event_triggers?: Record<string, SessionReplayTrigger>;
|
|
9
|
+
session_recording_exposure_triggers?: Record<string, SessionReplayTrigger>;
|
|
10
|
+
};
|
|
11
|
+
type SessionReplayTrigger = {
|
|
12
|
+
values?: string[];
|
|
7
13
|
};
|
|
8
14
|
type AutoCaptureFields = {
|
|
9
15
|
auto_capture_settings?: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DataAdapterResult } from './StatsigDataAdapter';
|
|
2
|
+
import { StatsigEvent } from './StatsigEvent';
|
|
2
3
|
import { DynamicConfig, Experiment, FeatureGate, Layer } from './StatsigTypes';
|
|
3
4
|
import { Flatten } from './TypingUtils';
|
|
4
5
|
export type StatsigLoadingStatus = 'Uninitialized' | 'Loading' | 'Ready';
|
|
@@ -41,6 +42,9 @@ type EventNameToEventDataMap = {
|
|
|
41
42
|
layer_evaluation: {
|
|
42
43
|
layer: Layer;
|
|
43
44
|
};
|
|
45
|
+
log_event_called: {
|
|
46
|
+
event: StatsigEvent;
|
|
47
|
+
};
|
|
44
48
|
};
|
|
45
49
|
/**
|
|
46
50
|
* Type representing various events emitted by a Statsig client.
|
|
@@ -66,6 +70,8 @@ type EventNameToEventDataMap = {
|
|
|
66
70
|
* `experiment_evaluation` - Fired when any experiment is checked from the Statsig client.
|
|
67
71
|
*
|
|
68
72
|
* `layer_evaluation` - Fired when any layer is checked from the Statsig client.
|
|
73
|
+
*
|
|
74
|
+
* `log_event_called` - Fired when log event is called.
|
|
69
75
|
*/
|
|
70
76
|
export type AnyStatsigClientEvent = Flatten<{
|
|
71
77
|
[K in keyof EventNameToEventDataMap]: {
|
package/src/StatsigEvent.js
CHANGED
|
@@ -63,7 +63,7 @@ const _createConfigExposure = (user, config, exposureMapping) => {
|
|
|
63
63
|
};
|
|
64
64
|
exports._createConfigExposure = _createConfigExposure;
|
|
65
65
|
const _createLayerParameterExposure = (user, layer, parameterName, exposureMapping) => {
|
|
66
|
-
var _a, _b, _c, _d;
|
|
66
|
+
var _a, _b, _c, _d, _e, _f;
|
|
67
67
|
const evaluation = layer.__evaluation;
|
|
68
68
|
const isExplicit = ((_a = evaluation === null || evaluation === void 0 ? void 0 : evaluation.explicit_parameters) === null || _a === void 0 ? void 0 : _a.includes(parameterName)) === true;
|
|
69
69
|
let allocatedExperiment = '';
|
|
@@ -72,14 +72,15 @@ const _createLayerParameterExposure = (user, layer, parameterName, exposureMappi
|
|
|
72
72
|
allocatedExperiment = (_c = evaluation.allocated_experiment_name) !== null && _c !== void 0 ? _c : '';
|
|
73
73
|
secondaryExposures = evaluation.secondary_exposures;
|
|
74
74
|
}
|
|
75
|
+
const parameterRuleIDs = (_d = layer.__evaluation) === null || _d === void 0 ? void 0 : _d.parameter_rule_ids;
|
|
75
76
|
const metadata = {
|
|
76
77
|
config: layer.name,
|
|
77
78
|
parameterName,
|
|
78
|
-
ruleID: layer.ruleID,
|
|
79
|
+
ruleID: (_e = parameterRuleIDs === null || parameterRuleIDs === void 0 ? void 0 : parameterRuleIDs[parameterName]) !== null && _e !== void 0 ? _e : layer.ruleID,
|
|
79
80
|
allocatedExperiment,
|
|
80
81
|
isExplicitParameter: String(isExplicit),
|
|
81
82
|
};
|
|
82
|
-
if (((
|
|
83
|
+
if (((_f = layer.__evaluation) === null || _f === void 0 ? void 0 : _f.version) != null) {
|
|
83
84
|
metadata['configVersion'] = layer.__evaluation.version;
|
|
84
85
|
}
|
|
85
86
|
return _createExposure(LAYER_EXPOSURE_NAME, user, layer.details, metadata, _mapExposures(secondaryExposures, exposureMapping));
|
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 = '3.16.
|
|
4
|
+
exports.SDK_VERSION = '3.16.2';
|
|
5
5
|
let metadata = {
|
|
6
6
|
sdkVersion: exports.SDK_VERSION,
|
|
7
7
|
sdkType: 'js-mono', // js-mono is overwritten by Precomp and OnDevice clients
|
package/src/StatsigPlugin.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StatsigClientInterface } from './ClientInterfaces';
|
|
2
2
|
export type StatsigPlugin<T extends StatsigClientInterface> = {
|
|
3
|
-
readonly __plugin: 'session-replay' | 'auto-capture';
|
|
3
|
+
readonly __plugin: 'session-replay' | 'auto-capture' | 'triggered-session-replay';
|
|
4
4
|
bind: (client: T) => void;
|
|
5
5
|
};
|