Persistent Storage Adapter
The persistent storage adapter allows you to plug in your own storage solution that Statsig SDK uses to persist user assignments. The storage interface consists of just aload
and save
API for read/write operations.
Currently only supported in
Go
, Ruby
, Legacy Node
, Node Core
, Kotlin
, .Net
, Python Core
Persistent Storage Logic
- Providing a storage adapter on Statsig initialization will give the SDK access to read & write on your custom storage
- Providing user persisted values to
get_experiment
will inform the SDK to- save the evaluation of the current user on first evaluation
- Will only save when experiment / layer is active
- load the previously saved evaluation of a persisted user on subsequent evaluations
- save the evaluation of the current user on first evaluation
- CAVEAT Persisted Value will be deleted when:
- When you provided call
getExperiment
withuser_persisted_values=None
- or When experiment is not active
- When you provided call
Persistent Assignment Options (Limited SDK Support)
- Enforce Targeting:
boolean
, default:false
- Whether or not to enforce targeting rules before assigning persisted values
- Kotlin
- Node JS
Example usage
- Ruby
- Python (Python Core)
- Node Core
- Kotlin
- Node JS
- Go
- .Net