SDK
Node SDK reference
One client per process, a handful of methods, and no network call per evaluation. One page per method.
The SDK is @rollkit/sdk in the repository (packages/sdk). It is for server-side Node; browsers use a client key with the delivery API.
- 01
createFlagClient
Create the one client your process uses. It starts fetching the snapshot at once.
- 02
waitForInitialization
Wait until the first snapshot is loaded, or fail after a timeout or a rejected key.
- 03
variation
Evaluate a flag of any type and get its value, or your default.
- 04
variationDetail
Evaluate a flag and get the value with the reason, variation id and versions.
- 05
boolVariation
Evaluate a boolean flag. Anything else returns your default.
- 06
stringVariation
Evaluate a string flag, such as copy or a variant name.
- 07
numberVariation
Evaluate a number flag, such as a limit or a timeout.
- 08
jsonVariation
Evaluate a JSON flag and get a structured value back.
- 09
allFlags
Evaluate every flag in the snapshot for one context.
- 10
on
Subscribe to ready, update, error and stream state events.
- 11
close
Stop polling and abort requests. Evaluation keeps working from memory.