FeatureFlagDefinition
FeatureFlagDefinition
Definition for a feature flag, including its key, description, identify function, and decide function. The identify function is used to determine the entities that will be evaluated against the feature flag, while the decide function contains the logic for determining the outcome of the flag based on those entities.
interface FeatureFlagDefinition<R, Entity> {
key: string;
description?: string;
identify?: IdentifyFunction<Entity>;
decide: DecideFunction<Entity, R>;
disableAnalytics?: boolean;
}
key
string
Unique key for the feature flag. Should be a string that identifies the flag.
description
string
Optional description of the feature flag. This can be used for documentation or debugging purposes.
identify
IdentifyFunction<Entity>
Optional flag to enable integration with an external flag provider. If true, the flag will use the global flag provider to determine its state. Default: false
decide
DecideFunction<Entity, R>
Function to decide the outcome of the feature flag. This function receives the identified entities and should return the result of the decision.
disableAnalytics
boolean
Whether to disable analytics tracking for this flag. Default: false