JavaScriptAPI reference
Feature flags
Feature flags in the JavaScript SDK.
// access
nexus.flagsNexusFlags
classFeature flags — evaluate once, then read synchronously.
NexusFlags
constructornew NexusFlags(http: NexusHttp, id: NexusIdentity, cfg: ResolvedConfig)Parameters
Prop
Type
Returns NexusFlags
all
propertyreadonly all: Record<string, unknown>load()
methodasync load(properties?: Record<string, unknown>): Promise<void>Evaluate all flags for the current person + properties and cache them.
Parameters
Prop
Type
isEnabled()
methodisEnabled(key: string): booleanTrue when a boolean flag is on, or a multivariate flag has any variant.
Parameters
Prop
Type
Returns boolean
variant()
methodvariant(key: string): string | nullThe variant key for a multivariate flag, or null.
Parameters
Prop
Type
Returns string | null
payload()
methodpayload(key: string): unknownThe remote-config payload attached to a flag, if any.
Parameters
Prop
Type
Returns unknown
