Circle V2 API Docs
    Preparing search index...

    Type Alias FeatureFlagAccessor

    Reactive flag reader exposed to components via useFeatureFlags() / useFeatureFlag(). Implementations are provided by FeatureFlagProvider based on the concrete browser client.

    Note: the accessor's identity changes when flag values change (so consumers re-render and pick up new values). However, the identify method has stable identity across flag updates, so components that only need identify should destructure it to use it in useEffect deps without causing re-runs on every flag change.

    type FeatureFlagAccessor = {
        getVariation: <K extends FlagName, T>(
            key: K,
            defaultValue: K extends keyof FeatureFlagRegistry
                ? FeatureFlagRegistry[K]
                : T,
        ) => K extends keyof FeatureFlagRegistry ? FeatureFlagRegistry[K] : T;
        identify: (context: FlagContext) => Promise<void>;
        isEnabled: <K extends FlagName>(key: K) => boolean;
    }
    Index

    Properties

    getVariation: <K extends FlagName, T>(
        key: K,
        defaultValue: K extends keyof FeatureFlagRegistry
            ? FeatureFlagRegistry[K]
            : T,
    ) => K extends keyof FeatureFlagRegistry ? FeatureFlagRegistry[K] : T
    identify: (context: FlagContext) => Promise<void>
    isEnabled: <K extends FlagName>(key: K) => boolean