@dash0/sdk-web
Version:
Dash0's Web SDK to collect telemetry from end-users' web browsers
32 lines (31 loc) • 1.51 kB
TypeScript
import { Endpoint, Vars } from "../vars";
import { AttributeValueType } from "../utils/otel";
import { AnyValue } from "../../types/otlp";
export type InitOptions = {
serviceName: string;
serviceVersion?: string;
environment?: string;
deploymentName?: string;
deploymentId?: string;
/**
* Additional attributes to include with transmitted signals
*/
additionalSignalAttributes?: Record<string, AttributeValueType | AnyValue>;
/**
* OTLP endpoints to which the generated telemetry should be sent to.
*/
endpoint: Endpoint | Endpoint[];
/**
* The session inactivity timeout. Session inactivity is the maximum
* allowed time to pass between two page loads before the session is considered
* to be expired. Also think of cache time-to-idle configuration options.
*/
sessionInactivityTimeoutMillis?: number;
/**
* The default session termination timeout. Session termination is the maximum
* allowed time to pass since session start before the session is considered
* to be expired. Also think of cache time-to-live configuration options.
*/
sessionTerminationTimeoutMillis?: number;
} & Partial<Pick<Vars, "ignoreUrls" | "ignoreErrorMessages" | "wrapEventHandlers" | "wrapTimers" | "propagateTraceHeadersCorsURLs" | "maxWaitForResourceTimingsMillis" | "maxToleranceForResourceTimingsMillis" | "headersToCapture" | "pageViewInstrumentation">>;
export declare function init(opts: InitOptions): void;