statsig-node-redis
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Statsig Node Server SDK - Redis Integration

npm version

A first party Redis integration with the Statsig server-side Node.js SDK.

Quick Setup

  1. Install the Statsig Node SDK
npm install statsig-node
  1. Install this package
npm install statsig-node-redis
  1. Import the package
import { RedisDataAdapter } from 'statsig-node-redis'
  1. Create an instance of the RedisDataAdapter
const dataAdapter = new RedisDataAdapter();
  1. When initializing the statsig sdk, add the adapter to options
await statsig.initialize(
    'server-secret-key',
    { dataAdapter: dataAdapter },
);

Customizing the adapter

When initializing RedisDataAdapter, you can specify the following options:

const dataAdapter = new RedisDataAdapter(
  hostname,
  port,
  password,
  db,
);
param default description
hostname 'localhost' Redis server hostname
port 6379 Redis server port
password ACL password or the old "--requirepass" password
db 0 Redis database number (supports 16 databases)

Links

Node Redis

/statsig-node-redis/

    Package Sidebar

    Install

    npm i statsig-node-redis

    Weekly Downloads

    1

    Version

    2.0.1

    License

    ISC

    Unpacked Size

    26.1 kB

    Total Files

    17

    Last publish

    Collaborators

    • kenny-statsig
    • daniel-statsig
    • sroyal
    • statsig-admin