Creates an instance of the LaunchDarkly client.
The LaunchDarkly mobile key.
Enable / disable Auto environment attributes. When enabled, the SDK will automatically provide data about the mobile environment where the application is running. To learn more, read Automatic environment attributes. for more documentation.
LDOptions to initialize the client with.
Private
_connectionReadonly
autoProtected
dataProtected
emitterProtected
Readonly
environmentReadonly
loggerReadonly
platformReadonly
sdkGets the SDK connection mode.
Protected
getIdentifies a context to LaunchDarkly. See LDClient.identify.
If used with the sheddable
option set to true, then the identify operation will be sheddable. This means that if
multiple identify operations are done, without waiting for the previous one to complete, then intermediate
operations may be discarded.
It is recommended to use the identifyResult
method instead when the operation is sheddable. In a future release,
all identify operations will default to being sheddable.
The LDContext object to be identified.
Optional
identifyOptions: LDIdentifyOptionsOptional configuration. See LDIdentifyOptions.
Optional
A Promise which resolves when the flag values for the specified context are available. It rejects when:
The context is unspecified or has no key.
The identify timeout is exceeded. In client SDKs this defaults to 5s. You can customize this timeout with identifyOptions.
A network error is encountered during initialization.
Identifies a context to LaunchDarkly and returns a promise which resolves to an object containing the result of the identify operation.
Unlike the server-side SDKs, the client-side JavaScript SDKs maintain a current context state,
which is set when you call identify()
.
Changing the current context also causes all feature flag values to be reloaded. Until that has finished, calls to variation will still return flag values for the previous context. You can await the Promise to determine when the new flag values are available.
If used with the sheddable
option set to true, then the identify operation will be sheddable. This means that if
multiple identify operations are done, without waiting for the previous one to complete, then intermediate
operations may be discarded.
The LDContext object.
Optional
identifyOptions: LDIdentifyOptionsOptional configuration. Please see LDIdentifyOptions.
Optional
A promise which resolves to an object containing the result of the identify operation. The promise returned from this method will not be rejected.
Protected
sendProtected
setOptional
defaultValue: anyOptional
Generated using TypeDoc
The React Native LaunchDarkly client. Instantiate this class to create an instance of the ReactNativeLDClient and pass it to the LDProvider.
Example