Creates a feature flag evaluator.
Configure the evaluator
Configures the Store and optional logger for flag evaluation.
Optionallogger?: GenericLoggerLogs evaluation outcomes without values.
Provides flag lookups.
Evaluates one flag and returns its value or the required fallback.
Handles StoreUnavailableError with the fallback.
With a schema, validates the fallback before contacting the Store
and replaces the primitive type check with schema validation. Returns the
validated output on both the found path and the fallback path, and rejects
schema outputs that are undefined.
Variant stores require a full Variant fallback, return it unchanged on a
fallback path, and do not accept schemas.
Configure the flag evaluation
Evaluates one flag and returns its value or the required fallback.
Handles StoreUnavailableError with the fallback.
With a schema, validates the fallback before contacting the Store
and replaces the primitive type check with schema validation. Returns the
validated output on both the found path and the fallback path, and rejects
schema outputs that are undefined.
Variant stores require a full Variant fallback, return it unchanged on a
fallback path, and do not accept schemas.
Configure the flag evaluation
Evaluates several flags with an independent fallback for each flag.
Handles StoreUnavailableError with every fallback.
Validates schema-backed fallbacks before contacting the Store.
Each schema replaces the primitive type check and supplies the output on both
the found path and the fallback path. Rejects undefined schema outputs and
throws for the whole batch if any flag fails validation.
Variant stores require a full Variant fallback per flag and do not accept
schemas. Each requested key resolves to a Variant.
Configure the batch evaluation
Gets enabled flag names in the Store's iteration order.
Configure the lookup
Supplies context to getEnabledFeatures.
Optionalcontext?: EvaluationContext
Evaluates feature flags against a caller-supplied
Store.Infers the Store's value type. Variant stores require full Variant fallbacks and return Variants without schemas; JSON stores retain primitive inference and optional Standard Schema validation.
Example