npm.io
5.2.1 • Published 4d ago

@stigg/node-server-sdk

Licence
MIT
Version
5.2.1
Deps
16
Size
223 kB
Vulns
0
Weekly
0

node-server-sdk

Stigg server-side SDK.

Redis cache

When the SDK is configured with redis, customer entitlement data is cached in Redis. By default, cached entries are written with a 7-day TTL (604800 seconds).

Options

  • redis.ttl (number, default 604800) — expiration in seconds applied to cached entries. Pass -1 to write entries without an expiration; use this when the cache must remain authoritative through extended Stigg Cloud outages. Invalidation continues to flow through the persistent-cache-service pipeline, so cached data still converges on real changes.
import Stigg from '@stigg/node-server-sdk';

const stigg = Stigg.initialize({
  apiKey: process.env.STIGG_SERVER_API_KEY,
  redis: {
    host: 'redis',
    port: 6379,
    environmentPrefix: 'prod',
    ttl: -1,
  },
});