class ConfigProvider
implements FlagProvider
Since 0.1.0

Immutable config-backed flag provider.

Flags are set at construction time and never change. Useful for simple, static flag sets defined in application configuration.

Examples

Example 1

const provider = new ConfigProvider({
  'beta-features': { enabled: false, users: ['user1'] },
  'new-dashboard': { enabled: true },
});

Constructors

ConfigProvider(flags: Readonly<Record<string, FlagDefinition>>)

Properties

readonly
type: "config"

Provider type identifier.

Methods

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

Evaluates the flag against the immutable flag map.

start(): Promise<void>

No-op — flags are immutable.

stop(): Promise<void>

No-op — flags are immutable.

Usage

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