v4.39.0 - Sticky bucketing storage adapter
- Added an option to provide a custom storage adapter for user-persisted values
UserPersistentStorageInterface
. So far, supports storing sticky experiments on user level
Warning
This is an experimental feature that may be subject to change.
Example usage
class UserPersistentStorageExample implements UserPersistentStorageInterface
{
public store: Record<string, string>;
public constructor() {
this.store = {};
}
load(userID: string): string {
return this.store[userID];
}
save(userID: string, data: string) {
this.store[userID] = data;
}
}
...
await Statsig.initialize(
"client-sdk-key",
{ userID: "some_user_id" },
{ userPersistentStorage: new UserPersistentStorageExample() }
);
Full Changelog: v4.38.0...v4.39.0