Configuration options for the LaunchDarkly React Native SDK.
Whether to treat all context attributes as private for event reporting for all contexts. The SDK will not include private attribute values in analytics events, but private attribute names will be sent. The default is false.
Information about the application where the LaunchDarkly SDK is running.
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
Sets a human friendly name for the application in which the LaunchDarkly SDK is running.
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)
Sets a human friendly name for the version of the application in which the LaunchDarkly SDK is running.
The interval by which the SDK polls for flag updates when the application is in the background.
The default value is 3600000ms (1 hour).
The timeout interval for connecting to LaunchDarkly for flag requests and event reports.
The default value is 10000ms (10 seconds).
Controls information logged to the console, and modifying some setting ranges to facilitate debugging.
This setting is only used when running in iOS. In Android this setting is ignored.
The default value is false.
Setting for whether sending diagnostic data about the SDK is disabled. The default is false.
The time interval between sending periodic diagnostic data. The default is 900000ms (15 minutes).
Whether or not the SDK should attempt to check for flag updates while the application runs in the background.
If this is true, the client will periodically poll for updates while in the background; if false, the SDK will not attempt to receive updates while the app is backgrounded.
The default value is false.
When enabled the SDK will automatically send data about the mobile environment to LaunchDarkly.
The default value is false (the SDK will not send mobile environment data).
Whether LaunchDarkly should provide additional information about how flag values were calculated.
The additional information will then be available through the client's
LDClient.*VariationDetail
methods. Since this increases the size of network requests,
such information is not sent unless you set this option to true.
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 queue is flushed, events will be discarded. Increasing the capacity means that events are less likely to be discarded, at the cost of consuming more memory. Note that in regular usage flag evaluations do not produce individual events, only summary counts, so you only need a large capacity if you are generating a large number of click, pageview, or identify events (or if you are using the event debugger).
The default value is 100.
The base URI for the LaunchDarkly events server.
Most customers should use the default value.
The interval in between flushes of the analytics events queue, in milliseconds.
The default value is 30000ms (30 seconds).
Android only.
Set to true to make the SDK provide unique keys for anonymous contexts. Read more at https://launchdarkly.github.io/android-client-sdk/com/launchdarkly/sdk/android/LDConfig.Builder.html#generateAnonymousKeys(boolean).
The default is true.
Setting for the maximum number of locally cached contexts. Default is 5 contexts.
The mobile SDK key associated with your LaunchDarkly environment.
This field is required as the React Native SDK will use this value to uniquely identify your LaunchDarkly account.
Disables all network calls from the LaunchDarkly SDK.
This can also be specified after the client has been created, using LDClient.setOffline().
The default value is false (the client will make network calls).
The base URI for the LaunchDarkly polling server.
Most customers should use the default value.
The interval by which the SDK polls for flag updates when the application is in the foreground. This property is only used if is the streaming connection is disabled.
The default value is 300000ms (5 min).
The names of context attributes that should be marked as private, and not sent to LaunchDarkly in analytics events.
You can also specify this on a per-context basis with {@link LDContextMeta.privateAttributes}
The mapping of environment names as keys to mobile keys for each environment as values.
Whether or not to open a streaming connection to LaunchDarkly for live flag updates.
If this is true, the client will always attempt to maintain a streaming connection; if false, it never will.
The default value is true.
The base URI for the LaunchDarkly streaming server.
Most customers should use the default value.
Whether or not to use the REPORT verb to fetch flag settings.
If this is true, flag settings will be fetched with a REPORT request including a JSON entity body with the context.
Otherwise (by default) a GET request will be issued with the context passed as a base64 URL-encoded path parameter.
Do not use unless advised by LaunchDarkly.
An object that combines the result of a feature flag evaluation with information about how it was calculated.
This is the result of calling one of the LDClient.*VariationDetail
methods.
For more information, see the documentation.
The type of flag being evaluated.
An object describing the main factor that influenced the flag evaluation value.
The result of the flag evaluation. This will be either one of the flag's variations or the default value that was passed to the variation detail function.
The index of the returned value within the flag's list of variations, e.g. 0 for the
first variation-- or null
if the default value was returned.
Describes the reason that a flag evaluation produced a particular value. This is part of the LDEvaluationDetail object returned by the variation detail methods.
The flag could not be evaluated, so the default value was returned.
The kind of error which occurred.
Kinds of errors include:
'CLIENT_NOT_READY'
: The client is not able to establish a connection to LaunchDarkly yet. If there is a persistent feature store, the store does not yet contain flag data.'FLAG_NOT_FOUND'
: The flag key did not match any known flag.'USER_NOT_SPECIFIED'
: The user object or user key was not provided.'MALFORMED_FLAG'
: There was an internal inconsistency in the flag data. For example, a rule specified a nonexistent variation. This is an unusual condition that might require assistance from LaunchDarkly's Support team.'WRONG_TYPE'
: The application code requested the flag value with a different data type than it actually is. For example, the code asked for a boolean when the flag type is actually a string.'EXCEPTION'
: An unexpected error stopped flag evaluation. This could happen if you are using a persistent feature store and the database stops working. When this happens, the SDK always prints the specific error to the log.The flag is on, but the context did not match any targets or rules, so it returned the value that appears on the dashboard under "Default rule."
The flag is off and therefore returned its configured off value.
The flag had at least one prerequisite flag that either was off or did not return the desired variation. Because of this, the flag returned its "off" value.
The key of the prerequisite flag that failed.
The context who encountered the flag matched one of the flag's rules.
The rule's unique identifier, which stays the same even if you rearrange the order of the rules.
The positional index of the matched rule (0 for the first rule).
The context key was specifically targeted for this flag in the "Target individual contexts" section.
Generated using TypeDoc
This is the API reference for the LaunchDarkly Client-Side SDK for React Native.
In typical usage, you will instantiate LDClient and then call configure once at startup time to set up your connection to LaunchDarkly.
For more information, see the SDK reference guide.