@launchdarkly/react-sdk - v4.2.3
    Preparing search index...

    Interface LDServerBaseClient

    A minimal structural interface that any LaunchDarkly server SDK that can be used with createLDServerSession should satisfy.

    This interface decouples the React SDK from the concrete LDClient type in @launchdarkly/js-server-sdk-common, allowing edge SDKs and other custom server client implementations to be used with createLDServerSession.

    interface LDServerBaseClient {
        allFlagsState(
            context: LDContextStrict,
            options?: LDFlagsStateOptions,
        ): Promise<LDFlagsState>;
        boolVariation(
            key: string,
            context: LDContextStrict,
            defaultValue: boolean,
        ): Promise<boolean>;
        boolVariationDetail(
            key: string,
            context: LDContextStrict,
            defaultValue: boolean,
        ): Promise<LDEvaluationDetailTyped<boolean>>;
        initialized(): boolean;
        jsonVariation(
            key: string,
            context: LDContextStrict,
            defaultValue: unknown,
        ): Promise<unknown>;
        jsonVariationDetail(
            key: string,
            context: LDContextStrict,
            defaultValue: unknown,
        ): Promise<LDEvaluationDetailTyped<unknown>>;
        numberVariation(
            key: string,
            context: LDContextStrict,
            defaultValue: number,
        ): Promise<number>;
        numberVariationDetail(
            key: string,
            context: LDContextStrict,
            defaultValue: number,
        ): Promise<LDEvaluationDetailTyped<number>>;
        stringVariation(
            key: string,
            context: LDContextStrict,
            defaultValue: string,
        ): Promise<string>;
        stringVariationDetail(
            key: string,
            context: LDContextStrict,
            defaultValue: string,
        ): Promise<LDEvaluationDetailTyped<string>>;
    }
    Index
    • Determines the JSON variation of a feature flag for a context.

      This version is preferred in TypeScript because it returns unknown instead of any, requiring an explicit cast before use.

      Parameters

      Returns Promise<unknown>