v3.2.0 - Experiments and new initialization options
With version 3.0.0, we introduced SDK ruleset local evaluation so that your checkGate and getConfig calls no longer make a http request each time. Now with version 3.2.0, we are introducing a new API and a few customization options for initialize():
-
New API: getExperiment(user: object, experimentName: string).
- This new API returns a DynamicConfig object that you can use to retrieve parameters for your experiments (you can still use getConfig() if you prefer that).
-
3 new configuration options for StatsigOptions:
-
environment: an object type parameter which you can use to specify values for targeting purposes for ALL of your users in the current environment. E.g. use {"tier": "staging"} to specify environment tier and test in your staging environment if you have any "Environment Tier" conditions configured.
-
rulesUpdatedCallback(rulesJSON: string, time: number): a callback that is called every time there is an update to your company's rules. It has two parameters, representing the rules in a JSON string and the version/timestamp of the rules.
-
bootstrapValues: a string parameter that you can use to bootstrap Statsig's initialization. The value should be a rulesJSON value you get from the callback in 2). In the very rare case that your server cannot reach Statsig during initialization, this will ensure Statsig SDK still can evaluate your feature gates and Dynamic Configs.
-