• Public
  • Public/Protected
  • All

Module "launchdarkly-electron-client-sdk"

This is the API reference for the LaunchDarkly SDK for Electron.

In typical usage, you will call initializeInMain in the main process at startup time to obtain an instance of LDElectronMainClient-- and, optionally, call initializeInRenderer in a renderer process to obtain a corresponding instance of LDElectronRendererClient.

For more information, see the SDK reference guide.


Type aliases


LDEvaluationReason: NonNullableLDEvaluationReason | null

Describes the reason that a flag evaluation produced a particular value. This is part of the LDEvaluationDetail object returned by LDElectronMainClient.variationDetail or LDElectronRendererClient.variationDetail.

Will be null when <a href="interfaces/_launchdarkly_electron_client_sdk_.ldoptions.html#evaluationreasons">LDOptions.evaluationReasons</a> is false.


LDFlagValue: any

The types of values a feature flag can have.

Flags can have any JSON-serializable value.



LDLogLevel: "debug" | "info" | "warn" | "error" | "none"

Logging levels that can be used with [[basicLogger]].

Set BasicLoggerOptions.level to one of these values to control what levels of log messages are enabled. Going from lowest importance (and most verbose) to most importance, the levels are 'debug', 'info', 'warn', and 'error'. You can also specify 'none' instead to disable all logging.


Const version

version: string

The current version string of the SDK.



  • createConsoleLogger(minimumLevel: string): LDLogger
  • A basic implementation of logging that uses the global console object. This is used by default in the browser SDK. It sends messages of "debug", "info", "warn", or "error" level (if enable) to console.log(), console.info(), console.warn(), and console.error() respectively.

    To make LDClient use this logger, put it in the logger property of LDOptions.


    Please use basicLogger instead.


    • minimumLevel: string

    Returns LDLogger



  • Creates an instance of the LaunchDarkly Electron client to be used in the main process.

    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 LDElectronMainClient.waitForInitialization, or register an event listener for the "ready" event using LDElectronMainClient.on.


    Returns LDElectronMainClient


  • Creates an instance of the LaunchDarkly Electron client to be used in a renderer process, which will receive all of its state from a client in the main process.


    • Optional envKey: undefined | string

      The LaunchDarkly environment ID. This can usually be omitted because it can be obtained from the LDElectronMainClient instance in the main process. You only need to specify it here if there are multiple client instances with different environment IDs.

    • Optional options: LDOptions

      Optional configuration settings. Since the main process client controls all communication with LaunchDarkly, the only options that can actually be set for the renderer client are the ones that control event generation: sendEvents, allAttributesPrivate, privateAttributeNames, inlineUsersInEvents, allowFrequentDuplicateEvents, and sendEventsOnlyForVariation`.

    Returns LDElectronRendererClient

Generated using TypeDoc