statsig-sidecar-v2-beta 2.5.0 → 2.6.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/README.md +18 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,9 +8,26 @@ You can register a pre-init experiment callback through `window.statsigSidecarCo
|
|
|
8
8
|
window.statsigSidecarConfig = {
|
|
9
9
|
onExperimentEvaluation: function (event) {
|
|
10
10
|
// event.name === "experiment_evaluation"
|
|
11
|
-
// event.experiment is the Statsig experiment instance
|
|
11
|
+
// event.experiment is the full Statsig experiment instance
|
|
12
|
+
// event.experimentName is the Sidecar experiment name
|
|
13
|
+
// event.groupName is the assigned group / variant
|
|
12
14
|
},
|
|
13
15
|
};
|
|
14
16
|
```
|
|
15
17
|
|
|
16
18
|
Unlike `window.postExperimentCallback`, `onExperimentEvaluation` fires once per Sidecar experiment evaluation, including experiments activated later through prerun scripts via `StatsigSidecar.activateExperiment(...)`.
|
|
19
|
+
|
|
20
|
+
Example:
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
window.statsigSidecarConfig = {
|
|
24
|
+
onExperimentEvaluation: function (event) {
|
|
25
|
+
window._ddm.trigger("ab_testing", {
|
|
26
|
+
data: {
|
|
27
|
+
experiment_id: event.experimentName,
|
|
28
|
+
experiment_variant: event.groupName,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
```
|