interface FlagProvider
Since 0.1.0

Port that all flag providers implement.

Providers refresh their state out of band; isEnabled evaluates against a cached snapshot synchronously.

Properties

Provider type identifier.

Methods

isEnabled(
flag: string,
context?: FlagContext
): boolean

Evaluate whether a flag is enabled.

Since 0.2.0
optional
isEnabledAsync(
flag: string,
context?: FlagContext
): Promise<boolean>

Optionally evaluate a flag asynchronously, when the backing source can produce a more accurate answer than the cached snapshot.

Implemented only by providers whose SDK evaluates asynchronously (the LaunchDarkly provider). A provider that omits it is not deficient: the service resolves FlagProvider.isEnabled instead, which for a purely local snapshot is already the correct answer.

start(): Promise<void>

Pull initial state into the cache.

stop(): Promise<void>

Release timers / connections.

Optional status — absent when the provider has no health signal.

Usage

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