Skip to content
FlagPilot
Menu

Node SDK

boolVariation

Evaluate a boolean flag. Anything else returns your default.

The typed helper for on/off flags. If the flag is not a boolean flag, you get your default and the evaluation reason is ERROR / WRONG_TYPE.

Signature
boolVariation(key: string, ctx: Context, d: boolean): boolean
Example
if (flags.boolVariation('new-checkout', ctx, false)) {
  // new code path
}

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.