Optional allOptional applicationOptional id?: stringOptional name?: stringOptional version?: stringOptional versionOptional automaticDetermines if the SDK responds to entering different visibility states, such as foreground and background. An example is flushing buffered events when going to the background.
This is true by default. Generally speaking the SDK will be able to most reliably deliver events with this setting on.
It may be useful to disable for environments where not all window/document objects are available, such as when running the SDK in a browser extension.
Optional baseOptional capacityOptional cleanOptional dataConfiguration for the FDv2 data system. When present, the SDK uses the FDv2 protocol for flag delivery instead of the default FDv1 protocol.
The browser SDK restricts automaticModeSwitching to false or
ManualModeSwitching only -- automatic switching has no effect
in browser environments.
This option is not stable, and not subject to any backwards compatibility guarantees or semantic versioning. It is in early access. If you want access to this feature please join the EAP. https://launchdarkly.com/docs/sdk/features/data-saving-mode
Optional debugOptional diagnosticOptional diagnosticOptional disableOptional eventA function which, if present, can change the URL in analytics events to something other
than the actual browser URL. It will be called with the current browser URL as a parameter,
and returns the value that should be stored in the event's url property.
It may be useful to customize the url to provide specific meaning, incorporate
client-side routing concerns, or redact tokens or other info.
Optional eventsOptional fetchWhether the client should make a request to LaunchDarkly for Experimentation metrics (goals).
This is true by default, meaning that this request will be made on every page load. Set it to false if you are not using Experimentation and want to skip the request.
Optional flushOptional hooksOptional inspectorsOptional loggerOptional maxOptional payloadOptional pluginsA list of plugins to be used with the SDK.
Optional pollOptional privateOptional sendOptional storageCustom storage implementation.
Storage is used for caching flag values for a context as well as persisting generated identifiers.
By default the browser SDK uses window.localStorage.
If there is an issue with the storage implementation, then generated keys and context caches may not be persisted. This will cause the SDK to generate new keys and context caches on every startup. Implementations should not throw; if one does, the SDK logs the error and degrades gracefully rather than crashing the application.
Optional streamOptional streamOptional streamingWhether 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. If you leave the value undefined (the default), the client will open a streaming
connection if you subscribe to "change" or "change:flag-key" events.
This is equivalent to calling client.setStreaming() with the same value.
Optional useOptional withOptional wrapperOptional wrapperGenerated using TypeDoc
Initialization options for the LaunchDarkly browser SDK.