• Public
  • Public/Protected
  • All

LaunchDarkly initialization options.


  • LDOptions



Optional allAttributesPrivate

allAttributesPrivate: undefined | false | true

Whether all user attributes (except the user key) should be marked as private, and not sent to LaunchDarkly.

By default, this is false.

Optional baseUri

baseUri: undefined | string

The base URI for the LaunchDarkly server.

Most users should use the default value.

Optional capacity

capacity: undefined | number

The capacity of the analytics events queue.

The client buffers up to this many events in memory before flushing. If the capacity is exceeded before the buffer is flushed, events will be discarded.

Optional diagnosticOptOut

diagnosticOptOut: undefined | false | true

Set to true to opt out of sending diagnostics data.

Unless the diagnosticOptOut field is set to true, the client will send some diagnostics data to the LaunchDarkly servers in order to assist in the development of future SDK improvements. These diagnostics consist of an initial payload containing some details of SDK in use, the SDK's configuration, and the platform the SDK is being run on, as well as payloads sent periodically with information on irregular occurrences such as dropped events.

Optional diagnosticRecordingInterval

diagnosticRecordingInterval: undefined | number

The interval at which periodic diagnostic data is sent, in seconds.

The default is 900 (every 15 minutes) and the minimum value is 60 (every minute).

Optional eventsUri

eventsUri: undefined | string

The base URI for the LaunchDarkly events server.

Most users should use the default value.

Optional featureStore

featureStore: LDFeatureStore

A component that stores feature flags and related data received from LaunchDarkly.

By default, this is an in-memory data structure. The SDK also provides a Redis implementation (RedisFeatureStore); other options are described in the SDK reference guide.

Optional flushInterval

flushInterval: undefined | number

The interval in between flushes of the analytics events queue, in seconds.

Optional inlineUsersInEvents

inlineUsersInEvents: undefined | false | true

Whether to include full user details in every analytics event.

The default is false: events will only include the user key, except for one "index" event that provides the full details for the user.

Optional logger

logger: LDLogger | object

Configures a logger for warnings and errors generated by the SDK.

This can be a custom logger or an instance of winston.Logger.

Optional offline

offline: undefined | false | true

Whether the client should be initialized in offline mode.

Optional pollInterval

pollInterval: undefined | number

The time between polling requests, in seconds. Ignored in streaming mode.

Optional privateAttributeNames

privateAttributeNames: Array<string>

The names of any user attributes that should be marked as private, and not sent to LaunchDarkly.

Optional proxyAuth

proxyAuth: undefined | string

Allows you to specify basic authentication parameters for an optional HTTP proxy. Usually of the form username:password.

Optional proxyHost

proxyHost: undefined | string

Allows you to specify a host for an optional HTTP proxy.

Optional proxyPort

proxyPort: undefined | number

Allows you to specify a port for an optional HTTP proxy.

Both the host and port must be specified to enable proxy support.

Optional proxyScheme

proxyScheme: undefined | string

When using an HTTP proxy, specifies whether it is accessed via http or https.

Optional sendEvents

sendEvents: undefined | false | true

Whether to send analytics events back to LaunchDarkly. By default, this is true.

Optional stream

stream: undefined | false | true

Whether streaming mode should be used to receive flag updates.

This is true by default. If you set it to false, the client will use polling. Streaming should only be disabled on the advice of LaunchDarkly support.

Optional streamInitialReconnectDelay

streamInitialReconnectDelay: undefined | number

Sets the initial reconnect delay for the streaming connection, in seconds.

The streaming service uses a backoff algorithm (with jitter) every time the connection needs to be reestablished. The delay for the first reconnection will start near this value, and then increase exponentially for any subsequent connection failures.

The default value is 1.

Optional streamInitialReconnectDelayMillis

streamInitialReconnectDelayMillis: undefined | number

Deprecated alternative to streamInitialReconnectDelay.


Use streamInitialReconnectDelay instead, which is measured in seconds like the other time interval properties.

Optional streamUri

streamUri: undefined | string

The base URI for the LaunchDarkly streaming server.

Most users should use the default value.

Optional timeout

timeout: undefined | number

The connection timeout, in seconds.

Optional tlsParams

tlsParams: LDTLSOptions

Additional parameters to pass to the Node HTTPS API for secure requests. These can include any of the TLS-related parameters supported by https.request(), such as ca, cert, and key.

For more information, see the Node documentation for https.request() and tls.connect().

Optional updateProcessor

updateProcessor: undefined | object

A component that obtains feature flag data and puts it in the feature store.

By default, this is the client's default streaming or polling component. It can be changed for testing purposes; see FileDataSource.

Optional useLdd

useLdd: undefined | false | true

Whether you are using the LaunchDarkly relay proxy in daemon mode.

In this configuration, the client will not connect to LaunchDarkly to get feature flags, but will instead get feature state from a database (Redis or another supported feature store integration) that is populated by the relay. By default, this is false.

Optional userKeysCapacity

userKeysCapacity: undefined | number

The number of user keys that the event processor can remember at any one time, so that duplicate user details will not be sent in analytics events.

Defaults to 1000.

Optional userKeysFlushInterval

userKeysFlushInterval: undefined | number

The interval (in seconds) at which the event processor will reset its set of known user keys.

Defaults to 300.

Optional wrapperName

wrapperName: undefined | string

For use by wrapper libraries to set an identifying name for the wrapper being used.

This will be sent in User-Agent headers during requests to the LaunchDarkly servers to allow recording metrics on the usage of these wrapper libraries.

Optional wrapperVersion

wrapperVersion: undefined | string

For use by wrapper libraries to report the version of the library in use.

If wrapperName is not set, this field will be ignored. Otherwise the version string will be included in the User-Agent headers along with the wrapperName during requests to the LaunchDarkly servers.

Generated using TypeDoc