OptionalcaptureQueryParams?: false | string[]OptionalcaptureReferrer?: booleanSpecifies whether to record the page that linked to this one. When the
SDK initializes and document.referrer is a different origin, it is
added as the landing.referrer attribute to all telemetry for the rest
of the page load, as if passed to LDObserve.setAttributes.
Only the origin and path are kept: the query string, fragment and any credentials are stripped so tokens or personal data in the referrer URL are not recorded. An empty or same-origin referrer sets nothing, and the value is not updated on SPA navigation.
OptionalconsoleMethodsToRecord?: (Specifies which console methods to record.
The value here will be ignored if disabledConsoleRecording is true.
OptionaldisableConsoleRecording?: booleanSpecifies whether the SDK will record console messages.
OptionalenableFlagEvaluationSpans?: booleanSpecifies whether to emit a feature_flag exposure span for each
feature flag evaluation made by the LaunchDarkly client.
Each evaluation span is ingested as a trace, so evaluation-heavy pages
can produce a large trace volume. Set to false to stop emitting
evaluation spans while keeping the rest of the plugin's telemetry (for
example web vitals, errors and logs). Other plugins' evaluation hooks
still run.
When enabled, flagExposureDedupeWindowMillis can be used instead to
reduce the volume without turning the spans off entirely.
OptionalenableLongtaskRecording?: booleanSpecifies whether to record main-thread longtask entries (>50ms) as
long_task.duration histogram samples.
OptionalenablePerformanceRecording?: booleanSpecifies whether to record performance metrics (e.g. FPS, device memory).
OptionalenablePromisePatch?: booleanSpecifies whether window.Promise should be patched to record the stack trace of promise rejections.
OptionalenableReportingObserver?: booleanSpecifies whether to subscribe to the browser Reporting API and emit CSP/intervention reports as errors and deprecation reports as warn logs.
Optionalenvironment?: stringSpecifies the environment your application is running in. This is useful to distinguish whether your session was recorded on localhost or in production.
OptionalflagExposureDedupeMaxSize?: numberThe 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.
OptionalflagExposureDedupeWindowMillis?: numberThe 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.
OptionalnetworkRecording?: boolean | NetworkRecordingOptionsSpecifies how and what the SDK records from network requests and responses.
Optionalotel?: OtelOptions & { otlpEndpoint?: string }OTLP options for OpenTelemetry tracing. Instrumentations are enabled by default.
OptionalproductAnalytics?: boolean | ProductAnalyticsEventsSpecifies whether to record product analytics events.
OptionalrecordLaunchDarklySdkLogs?: booleanSpecifies whether console output written by the LaunchDarkly SDK's own
logger (lines prefixed [LaunchDarkly], e.g. stream connection
open/close messages) is recorded as logs. Those lines describe the SDK
rather than your application, and the streaming URL they contain embeds
the evaluation context, so they are skipped by default.
OptionalreportConsoleErrors?: booleanSpecifies whether the SDK will report console.error invocations as Errors.
OptionaltracingOrigins?: boolean | (string | RegExp)[]Specifies where the backend of the app lives. If specified, the SDK will attach the traceparent header 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.
Verbose project ID that is exposed to users. Legacy users may still be using ints.
Attributes set with setAttributes, as a frozen snapshot.
Record arbitrary metric values via as a Counter. A Counter efficiently records an increment in a metric, such as number of cache hits. Values with the same metric name and attributes are aggregated via the OTel SDK. See https://opentelemetry.io/docs/specs/otel/metrics/data-model/ for more details.
Calling this method will report an error in Highlight and map it to the current session being recorded.
A common use case for H.error is calling it right outside of an error boundary.
Optionalmessage: stringOptionalpayload: { [key: string]: string }Optionalsource: stringOptionaltype: ErrorMessageTypehttps://docs.highlight.run/grouping-errors for more information.
Record arbitrary metric values via as a Gauge. A Gauge records any point-in-time measurement, such as the current CPU utilization %. Values with the same metric name and attributes are aggregated via the OTel SDK. See https://opentelemetry.io/docs/specs/otel/metrics/data-model/ for more details.
Record arbitrary metric values via as a Histogram. A Histogram efficiently records near-by point-in-time measurement into a bucketed aggregate. Values with the same metric name and attributes are aggregated via the OTel SDK. See https://opentelemetry.io/docs/specs/otel/metrics/data-model/ for more details.
Record arbitrary metric values via as a Counter. A Counter efficiently records an increment in a metric, such as number of cache hits. Values with the same metric name and attributes are aggregated via the OTel SDK. See https://opentelemetry.io/docs/specs/otel/metrics/data-model/ for more details.
Record arbitrary logs from your own integrations or manual. Useful when you don't want to emit a console log to the browser dev tools but still want to report a custom log.
Optionalmetadata: AttributesRecord arbitrary metric values via as a UpDownCounter. A UpDownCounter efficiently records an increment or decrement in a metric, such as number of paying customers. Values with the same metric name and attributes are aggregated via the OTel SDK. See https://opentelemetry.io/docs/specs/otel/metrics/data-model/ for more details.
Adds attributes to all telemetry recorded from now on: every span (including automatically instrumented ones such as document load, fetch/XHR, clicks and page views), log, error and metric.
Calling it again merges with the attributes already set; a null or
undefined value removes that key. Attributes passed to an individual
call (for example recordLog metadata or metric attributes) take
precedence over these. Keys in namespaces the SDK sets itself
(highlight.*, launchdarkly.*, session.*, context.contextKeys.*)
are ignored.
Attributes are held in memory for the current page load only: they are never persisted, and a full page load starts without them.
Each attribute is also added to every metric, so a value with many distinct values (such as a user ID) creates as many metric series.
Start the observability data capture when running in manualStart mode.
Can safely be called before the SDK has initialized (e.g. before the
plugin registers): the call resolves once the SDK is attached and
started, without throwing.
Starts a new span for tracing in Highlight. The span will be ended when the
end() is called on the span. It returns whatever is returned from the
callback function.
The name of the span.
Options for the span.
Optionalcontext: Context | ((span: Span) => any)The context for the span.
Optionalfn: (span: Span) => anyThe function to run in the span.
Starts a new span for tracing in Highlight. The span will be ended when the callback function returns.
The name of the span.
Options for the span.
Optionalcontext: Context | ((span?: Span) => any)The context for the span.
Optionalfn: (span?: Span) => anyStop the observability data capture.
Can safely be called before the SDK has initialized; before start()
it cancels a pending start instead of throwing.
Query parameters to read from the page URL and add as attributes to all telemetry, as if passed to
LDObserve.setAttributes.When the SDK initializes, each listed parameter present in
location.searchbecomes an attribute named after the parameter (e.g.utm_campaign) on every span (including document load, page view and fetch/XHR spans), log, error and metric for the rest of the page load, including after SPA navigation drops it from the URL.Last touch: when an SPA navigation lands on a URL with any listed parameter, the captured values are replaced by that URL's values, and previously captured keys missing from it are removed, so the set always reflects one landing. A navigation without listed parameters keeps the current values. Spans already started keep the values they had.
Values are kept in memory only; nothing is written to storage or cookies, so a later full page load captures again from its own URL.
Only the listed keys are captured, so other query parameters (which may hold personal data such as emails or tokens) are never recorded this way. The default list contains UTM parameters only. A name ending in
*matches every parameter with that prefix (e.g.'utm_*').Keys set with
setAttributeswin: capture never replaces or removes a key the app set itself.removeAttributesremoves a captured value (a later landing with that parameter captures it again). Keys in the namespaces the SDK sets itself (highlight.*,launchdarkly.*,session.*,context.contextKeys.*) are ignored.A custom list replaces the default. Set to
falseor[]to turn capture off.