• Creates an instance of the LaunchDarkly client.

    Applications should instantiate a single instance for the lifetime of the application. The client will begin attempting to connect to LaunchDarkly as soon as it is created. To determine when it is ready to use, call LDClient.waitForInitialization, or register an event listener for the "ready" event using LDClient.on.

    Parameters

    • envKey: string

      The LaunchDarkly environment ID.

    • context: LDContext

      The initial context properties. These can be changed later with LDClient.identify. The context must have a key property, except that if you omit context.key and set context.anonymous to true, the SDK will create a randomized unique key (which will be cached in local storage for the current OS user account, so the next initialization will reuse the same key).

    • Optional options: LDOptions

      Optional configuration settings.

    Returns LDClient