statsig-node-cloudflare-kv
v1.2.2
Published
[](https://badge.fury.io/js/statsig-node-cloudflare-kv)
Maintainers
Keywords
Readme
Statsig Node Server SDK - Cloudflare KV Adapter
A first party Cloudflare integration with the Statsig server-side Node.js SDK.
Quick Setup
- Install the Statsig Node SDK
npm install [email protected]- Install this package
npm install statsig-node-cloudflare-kv- Setup the Statsig Cloudflare Integration
- Import the package
import { CloudflareKVDataAdapter } from 'statsig-node-cloudflare-kv'- Create an instance of the
CloudflareKVDataAdapter
const dataAdapter = new CloudflareKVDataAdapter(env.YOUR_KV_BINDING, 'statsig-<COMPANY_ID>');[!TIP] You can find your company ID from the Statsig Console URL
https://console.statsig.com/<COMPANY_ID>6. When initializing thestatsigsdk, add the adapter to options
await statsig.initialize(
'server-secret-key',
{ dataAdapter: dataAdapter },
);