InvergeDocs
JavaScriptAPI reference

Feature flags

Feature flags in the JavaScript SDK.

// access
nexus.flags

NexusFlags

class

Feature flags — evaluate once, then read synchronously.

NexusFlags

constructor
new NexusFlags(http: NexusHttp, id: NexusIdentity, cfg: ResolvedConfig)

Parameters

Prop

Type

Returns NexusFlags

View source

all

property
readonly all: Record<string, unknown>

load()

method
async load(properties?: Record<string, unknown>): Promise<void>

Evaluate all flags for the current person + properties and cache them.

Parameters

Prop

Type

View source

isEnabled()

method
isEnabled(key: string): boolean

True when a boolean flag is on, or a multivariate flag has any variant.

Parameters

Prop

Type

Returns boolean

View source

variant()

method
variant(key: string): string | null

The variant key for a multivariate flag, or null.

Parameters

Prop

Type

Returns string | null

View source

payload()

method
payload(key: string): unknown

The remote-config payload attached to a flag, if any.

Parameters

Prop

Type

Returns unknown

View source

On this page