interface ILaunchDarklyClient
Since 0.2.0

The subset of LaunchDarkly's LDClient this provider uses.

Methods

initialized(): boolean

Whether the client has completed initialization. Synchronous.

waitForInitialization(options?: { readonly timeoutSeconds?: number; }): Promise<unknown>

Resolves once the client has connected, or rejects on permanent failure.

boolVariation(
key: string,
defaultValue: boolean
): Promise<boolean>

Evaluates a boolean flag for a context.

Fetches a synchronously-queryable snapshot of every flag for a context.

on(
event: string,
listener: () => void
): void

Registers an event listener. The provider listens for 'update', which fires whenever any flag's configuration changes.

close(): void

Shuts the client down and flushes pending events. Synchronous.

Usage

import { type ILaunchDarklyClient } from "feature-flags-plugin/src/index.ts";