The minimal LDClient contract required by the OpenFeature provider. Any LaunchDarkly server-side LDClient should satisfy this interface.

Hierarchy

  • OpenFeatureLDClientContract

Methods

  • Flush any pending analytics events to LaunchDarkly. Called by the provider during Provider.onClose.

    Returns Promise<void>

  • Track a custom event for the given context.

    Parameters

    • key: string

      The name of the event.

    • context: LDContext

      The context to associate with the event.

    • Optional data: any

      Optional additional information to attach to the event.

      Optional
    • Optional metricValue: number

      Optional numeric metric value to associate with the event.

      Optional

    Returns void

  • Evaluate a flag and return the value along with details of how it was calculated.

    Parameters

    • key: string

      The unique key of the feature flag.

    • context: LDContext

      The context to evaluate the flag against.

    • defaultValue: any

      The value to return if the flag cannot be evaluated.

    Returns Promise<LDEvaluationDetail>

    A promise which resolves to the evaluation detail.

  • Wait for the underlying client to finish initialization.

    Parameters

    • Optional options: {
          timeout: number;
      }

      Optional initialization options. The timeout field is the maximum number of seconds to wait.

      Optional
      • timeout: number

    Returns Promise<unknown>

Generated using TypeDoc