| @flags-sdk/statsig | major |
|---|
Migrate to @statsig/statsig-node-core (Statsig's Rust-based server SDK).
This is a breaking change. The underlying Statsig SDK is now instance-based instead of a singleton, and several method names and option keys have changed.
Breaking changes
- The exported
Statsigis now a class (new Statsig(key, options)), not a singleton. Methods such asStatsig.getFeatureGateSyncno longer exist — use the instance returned bystatsigAdapter.initialize()and callgetFeatureGate(user, key)etc. - Sync method variants (
*Sync) and*WithExposureLoggingDisabledSyncare removed. Pass{ disableExposureLogging: true }as the third argument instead. - The
DynamicConfigandExperimenttypes are now distinct (the adapter'sexperimentgetter receives anExperiment). statsigOptionskeys changed: usespecsSyncIntervalMs(wasrulesetsSyncIntervalMs),enableIdLists(wasdisableIdListsSync/initStrategyForIDLists), anddataStore(wasdataAdapter).getClientInitializeResponsenow returns a JSONstringand accepts{ hashAlgorithm: 'djb2' }instead of{ hash: 'djb2' }.- The Edge Runtime workaround hooks were removed. The new SDK uses native Node bindings (NAPI) and runs on Node.js only — including Vercel's Fluid Compute. It is not compatible with the Edge Runtime.
Internal changes
- Drops the
statsig-node-verceldependency. The Edge Config integration is now implemented inline using a customDataStorethat reads from@vercel/edge-config.