Interface that extends the LDClient interface to include the identifyResult method.

This is an independent interface for backwards compatibility. Adding this to the LDClient interface would require a breaking change.

Hierarchy

  • LDClientImpl

Implements

Constructors

Properties

_baseHeaders: LDHeaders
_checkedContext?: Context
_config: Configuration
_diagnosticsManager?: DiagnosticsManager
_eventFactoryDefault: default = ...
_eventFactoryWithReasons: default = ...
_eventProcessor?: EventProcessor
_eventSendingEnabled: boolean = false
_flagManager: FlagManager
_highTimeoutThreshold: number = 15
_hookRunner: default
_identifyQueue: {
    execute<TBeforeResult>(task, sheddable?) => Promise<TaskResult<void>>;
    pendingCount() => number;
} = ...

Type declaration

  • execute:function
    • Execute a task using the queue.

      Type Parameters

      • TBeforeResult

      Parameters

      • task: Task<void, TBeforeResult>

        The async function to execute.

      • sheddable: boolean = false

        Whether the task can be shed from the queue.

      Returns Promise<TaskResult<void>>

      A promise that resolves to the result of the task.

  • pendingCount:function
_inspectorManager: default
_uncheckedContext?: LDContext
autoEnvAttributes: AutoEnvAttributes
dataManager: DataManager
emitter: LDEmitter
environmentMetadata: LDPluginEnvironmentMetadata
logger: LDLogger
platform: Platform
sdkKey: string

Methods

  • Returns {
        identifyPromise: Promise<void>;
        identifyReject: ((err) => void);
        identifyResolve: (() => void);
    }

    • identifyPromise: Promise<void>
    • identifyReject: ((err) => void)
        • (err): void
        • Parameters

          • err: Error

          Returns void

    • identifyResolve: (() => void)
        • (): void
        • Returns void

  • Identifies a context to LaunchDarkly. See LDClient.identify.

    If used with the sheddable option set to true, then the identify operation will be sheddable. This means that if multiple identify operations are done, without waiting for the previous one to complete, then intermediate operations may be discarded.

    It is recommended to use the identifyResult method instead when the operation is sheddable. In a future release, all identify operations will default to being sheddable.

    Parameters

    Returns Promise<void>

    A Promise which resolves when the flag values for the specified context are available. It rejects when:

    1. The context is unspecified or has no key.

    2. The identify timeout is exceeded. In client SDKs this defaults to 5s. You can customize this timeout with identifyOptions.

    3. A network error is encountered during initialization.

  • Identifies a context to LaunchDarkly and returns a promise which resolves to an object containing the result of the identify operation.

    Unlike the server-side SDKs, the client-side JavaScript SDKs maintain a current context state, which is set when you call identify().

    Changing the current context also causes all feature flag values to be reloaded. Until that has finished, calls to variation will still return flag values for the previous context. You can await the Promise to determine when the new flag values are available.

    If used with the sheddable option set to true, then the identify operation will be sheddable. This means that if multiple identify operations are done, without waiting for the previous one to complete, then intermediate operations may be discarded.

    Parameters

    Returns Promise<LDIdentifyResult>

    A promise which resolves to an object containing the result of the identify operation. The promise returned from this method will not be rejected.

  • Enable/Disable event sending.

    Parameters

    • enabled: boolean

      True to enable event processing, false to disable.

    • flush: boolean

      True to flush while disabling. Useful to flush on certain state transitions.

    Returns void

Generated using TypeDoc