Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "launchdarkly-node-client-sdk"

This is the API reference for the LaunchDarkly Client-Side Node SDK.

In typical usage, you will call initialize in the main process at startup time to obtain an an instance of LDClient.

For more information, see the SDK reference guide.

Index

Type aliases

LDFlagValue

LDFlagValue: any

The types of values a feature flag can have.

Flags can have any JSON-serializable value.

Variables

Const version

version: string

The current version string of the SDK.

Functions

createConsoleLogger

  • 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.

    Parameters

    • minimumLevel: string

    Returns LDLogger

initialize

  • 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.

    • user: LDUser

      The initial user properties. These can be changed later with LDClient.identify. The user must have a key property, except that if you omit user.key and set user.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

Generated using TypeDoc