Options
All
  • Public
  • Public/Protected
  • All
Menu

LaunchDarkly initialization options.

Hierarchy

  • LDOptions

Index

Properties

allAttributesPrivate?: boolean

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

By default, this is false.

application?: { id?: string; version?: string }

Information about the application where the LaunchDarkly SDK is running.

Type declaration

  • Optional id?: string

    A unique identifier representing the application where the LaunchDarkly SDK is running.

    This can be specified as any string value as long as it only uses the following characters: ASCII letters, ASCII digits, period, hyphen, underscore. A string containing any other characters will be ignored.

    Example: authentication-service

  • Optional version?: string

    A unique identifier representing the version of the application where the LaunchDarkly SDK is running.

    This can be specified as any string value as long as it only uses the following characters: ASCII letters, ASCII digits, period, hyphen, underscore. A string containing any other characters will be ignored.

    Example: 1.0.0 (standard version string) or abcdef (sha prefix)

baseUri?: string

The base URI for the LaunchDarkly server.

Most users should use the default value.

bigSegments?: LDBigSegmentsOptions

Additional parameters for configuring the SDK's Big Segments behavior.

Big Segments are a specific type of user segments. For more information, read the LaunchDarkly documentation: https://docs.launchdarkly.com/home/users/big-segments

By default, there is no configuration and Big Segments cannot be evaluated. In this case, any flag evaluation that references a Big Segment will behave as if no users are included in any Big Segments, and the LDEvaluationReason associated with any such flag evaluation will have a bigSegmentsStatus of "NOT_CONFIGURED".

capacity?: 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.

contextKeysCapacity?: number

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

Defaults to 1000.

contextKeysFlushInterval?: number

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

Defaults to 300.

diagnosticOptOut?: boolean

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.

diagnosticRecordingInterval?: 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).

eventsUri?: string

The base URI for the LaunchDarkly events server.

Most users should use the default value.

featureStore?: LDFeatureStore | ((options: LDOptions) => LDFeatureStore)

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

By default, this is an in-memory data structure. Database integrations are also available, as described in the SDK features guide.

Some implementations provide the store implementation object itself, while others provide a factory function that creates the store implementation based on the SDK configuration; this property accepts either.

flushInterval?: number

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

logger?: LDLogger

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

The logger can be any object that conforms to the LDLogger interface. For a simple implementation that lets you filter by log level, see basicLogger. You can also use an instance of winston.Logger from the Winston logging package.

If you do not set this property, the SDK uses basicLogger with a minimum level of info.

offline?: boolean

Whether the client should be initialized in offline mode.

pollInterval?: number

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

privateAttributes?: string[]

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

Any contexts sent to LaunchDarkly with this configuration active will have attributes with these names removed. This is in addition to any attributes that were marked as private for an individual context with LDContextMeta.privateAttributes. Setting LDOptions.allAttributesPrivate to true overrides this.

If and only if a parameter starts with a slash, it is interpreted as a slash-delimited path that can denote a nested property within a JSON object. For instance, "/address/street" means that if there is an attribute called "address" that is a JSON object, and one of the object's properties is "street", the "street" property will be redacted from the analytics data but other properties within "address" will still be sent. This syntax also uses the JSON Pointer convention of escaping a literal slash character as "1" and a tilde as "0".

proxyAuth?: string

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

proxyHost?: string

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

proxyPort?: number

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

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

proxyScheme?: string

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

sendEvents?: boolean

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

stream?: boolean

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.

streamInitialReconnectDelay?: 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.

streamUri?: string

The base URI for the LaunchDarkly streaming server.

Most users should use the default value.

timeout?: number

The connection timeout, in seconds.

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().

updateProcessor?: 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.

useLdd?: boolean

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 Proxy. By default, this is false. To learn more, read Using daemon mode.

userKeysCapacity?: 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.

deprecated

Use contextKeysCapacity instead.

userKeysFlushInterval?: number

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

Defaults to 300.

deprecated

Use contextKeysFlushInterval instead.

wrapperName?: 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.

wrapperVersion?: 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