ReadonlyeventsAn event emitter for ProviderEvents.
ReadonlymetadataReadonlyrunsRepresents where the provider is intended to be run. If defined, the SDK will enforce that the defined paradigm at runtime.
Overwrites the configured flags.
new flag configuration
provider.putConfiguration({
'my-flag': {
variants: { on: true, off: false },
defaultVariant: 'on',
contextEvaluator: (ctx) => ctx?.user?.id === '123' ? 'on' : 'off',
disabled: false,
},
});
const flags = {
'my-flag': {
variants: { on: true, off: false },
defaultVariant: 'on',
contextEvaluator: (ctx) => ctx?.user?.id === '123' ? 'on' : 'off',
disabled: false,
},
} as const; // 'as const' needed to preserve the `defaultVariant` narrow literal type rather than `string`
provider.putConfiguration(flags);
Resolve a boolean flag and its evaluation details.
Optionalcontext: EvaluationContextOptionallogger: LoggerResolve a numeric flag and its evaluation details.
Optionalcontext: EvaluationContextOptionallogger: LoggerResolve and parse an object flag and its evaluation details.
Optionalcontext: EvaluationContextOptionallogger: LoggerResolve a string flag and its evaluation details.
Optionalcontext: EvaluationContextOptionallogger: Logger
A simple OpenFeature provider intended for demos and as a test stub.
Example