OptionalbackendOptionalcontextA function that returns a friendly name for a given context. This name will be used to identify the session in the observability UI.
contextFriendlyName: (context: LDContext) => {
if(context.kind === 'multi' && context.user?.email) {
return context.user.email;
} else if(context.kind === 'user') {
return context.key;
}
// Use the default identifier for contexts which don't contain a user.
return undefined;
}
The context to get a friendly name for.
The friendly name for the context, or undefined to use the default identifier.
OptionalcustomCustom headers to include with OTLP exports.
OptionaldebugDebug mode - enables additional logging.
OptionaldisableWhether errors tracking is disabled.
OptionaldisableWhether logs are disabled.
OptionaldisableWhether metrics are disabled.
OptionaldisableDisables public custom tracing APIs (startSpan, startActiveSpan,
withSpan, getTracer(), track, runWithHeaders, startWithHeaders).
SDK auto-instrumentation (network requests, internal telemetry) is unaffected.
OptionalflagThe maximum number of unique feature flag exposure keys tracked for deduplication at once. When exceeded, the least recently recorded keys are evicted to bound memory usage.
OptionalflagThe time window, in milliseconds, during which repeated feature flag
evaluations that resolve to the same result are deduplicated, so that only
a single feature_flag exposure span is emitted per unique
(flag key, value, variation, reason, context) within the window.
This is useful for reducing exposure volume caused by frequent re-evaluations (for example, React re-renders).
Set to 0 (the default) to disable deduplication and emit an exposure
for every evaluation. Set a positive value to enable it.
OptionalmaxThe maximum number of spans and log records held in the in-memory export buffer before the oldest are dropped. Applied to both traces and logs.
Telemetry is buffered in memory only (there is no on-disk persistence), so this value bounds how much can be retained while the device is offline or between uploads. When the buffer is full, newly recorded items are dropped until space frees up (the already-buffered items are kept and exported). Larger values retain more data across short outages at the cost of memory; anything still buffered is lost if the app is terminated.
OptionalnetworkOptions for recording network request and response headers and bodies, with controls for redacting sensitive data.
OptionalotlpThe endpoint URL for the OTLP exporter.
OptionalresourceAdditional resource attributes to include in telemetry data.
OptionalserviceThe service name for the application.
OptionalserviceThe service version for the application.
OptionalsessionMaximum inactivity, in milliseconds, before the next app launch / JS reload starts a new session instead of continuing the previous one. Measured from the last recorded activity to the next load.
The session id is never rotated while the app is running (in-process): it is decided once per JS load and held for that load's lifetime, mirroring the native session replay / observability instance, which treats an externally supplied id as a custom session and never auto-rotates it. Session boundaries therefore only occur at a launch/reload, governed by this value.
OptionaltracingSpecifies where the backend of the app lives. If specified, the SDK will attach tracing headers to outgoing requests whose destination URLs match a substring or regexp from this list, so that backend errors can be linked back to the session. If 'true' is specified, all requests to the current domain will be matched.
OptionaluploadThe delay, in milliseconds, between scheduled uploads of buffered spans and log records. Applied to both traces and logs. Lower values upload more frequently in smaller batches; higher values upload less frequently in larger batches.
OptionalurlURLs to not record headers and bodies for, and to not propagate trace
headers (e.g. traceparent) to. Each entry is matched as a
case-insensitive substring of the full request URL; a match suppresses
both recording and trace-header propagation for that request.
The backend URL for the application.