Skip to main content

OpenFeature

An open standard for feature flags

Simple API


import {
OpenFeature
} from '@openfeature/js-sdk'

const client = OpenFeature.getClient('my-client');

const value = client
.getBooleanValue('new-look', false);

Flexible integration


class MyFlagProvider implements Provider {
//...
resolveBooleanEvaluation(
flagKey: string,
defaultValue: boolean,
context: Context,
): Promise<ResolutionDetails<boolean>> {
// your implementation
}
//...
}

Powerful extensions


class MyHook implements Hook {
before(
hookContext: BeforeHookContext,
hookHints?: HookHints) {
// do something before flag evaluation
}

after(
hookContext: Readonly<HookContext<FlagValue>>,
evaluationDetails: EvaluationDetails<FlagValue>,
hookHints?: HookHints
) {
// do something after flag evaluation
}
}