import { UnpluginOptions } from 'unplugin'; import * as vite from 'vite'; declare class TrackedFilesMatcher { private trackedFilenames; constructor(trackedFiles: string[]); private displaySource; matchSourcemap(srcmapPath: string, onSourcesNotFound: (reason: string) => void): string[] | undefined; matchSources(sources: string[]): string[]; rawTrackedFilesList(): string[]; private getFilename; } type AuthMethod = "apiKey" | "oauth"; type AppsProtectionLevel = "direct_publish" | "approval_required"; type AppsOptions = { enable?: boolean; include?: string[]; dryRun?: boolean; identifier?: string; name?: string; /** Human-readable description of the app. */ description?: string; /** When true, the app appears in the Datadog self-service catalog. */ selfService?: boolean; /** Deployment and identity settings for the app. */ permissions?: { /** * Controls whether publishing the app requires a second approver. * - `direct_publish`: any user with publish rights can deploy immediately. * - `approval_required`: a second user must approve before the app goes live. */ protectionLevel?: AppsProtectionLevel; /** * UUID of the service account the app's backend functions run as. * When omitted the app runs as the uploading user. * Only service accounts are accepted; arbitrary user UUIDs are rejected by the API. */ runAs?: string; }; authOverrides?: { method?: AuthMethod; }; }; declare const CONFIG_KEY: "apps"; declare const PLUGIN_NAME: PluginName; type types = { AppsOptions: AppsOptions; }; declare const getPlugins: GetPlugins; type MinifiedPathPrefix = `http://${string}` | `https://${string}` | `/${string}`; type SourcemapsOptions = { bailOnError?: boolean; dryRun?: boolean; maxConcurrency?: number; minifiedPathPrefix: MinifiedPathPrefix; releaseVersion?: string; service: string; }; type ErrorTrackingOptions = { enable?: boolean; sourcemaps?: SourcemapsOptions; }; declare const CONFIG_KEY$1: "errorTracking"; declare const PLUGIN_NAME$1: PluginName; type types$1 = { ErrorTrackingOptions: ErrorTrackingOptions; }; declare const getPlugins$1: GetPlugins; declare const VALID_FUNCTION_KINDS: readonly [ "functionDeclaration", "functionExpression", "arrowFunction", "objectMethod", "classMethod", "classPrivateMethod" ]; type FunctionKind = (typeof VALID_FUNCTION_KINDS)[number]; type LiveDebuggerOptions = { enable?: boolean; include?: (string | RegExp)[]; exclude?: (string | RegExp)[]; honorSkipComments?: boolean; functionTypes?: FunctionKind[]; namedOnly?: boolean; }; type LiveDebuggerOptionsWithDefaults = { version: string | undefined; include: (string | RegExp)[]; exclude: (string | RegExp)[]; honorSkipComments: boolean; functionTypes: FunctionKind[] | undefined; namedOnly: boolean; }; declare const CONFIG_KEY$2: "liveDebugger"; declare const PLUGIN_NAME$2: PluginName; type types$2 = { LiveDebuggerOptions: LiveDebuggerOptions; }; declare const getLiveDebuggerPlugin: (pluginOptions: LiveDebuggerOptionsWithDefaults, context: GlobalContext) => PluginOptions; declare const getPlugins$2: GetPlugins; type Filter = (metric: Metric) => Metric | null; type MetricsOptions = { enable?: boolean; enableDefaultPrefix?: boolean; /** @deprecated */ enableTracing?: boolean; filters?: Filter[]; prefix?: string; tags?: string[]; timestamp?: number; }; declare const CONFIG_KEY$3: "metrics"; declare const PLUGIN_NAME$3: PluginName; declare const helpers: { filters: ((metric: Metric) => Metric | null)[]; }; type types$3 = { Filter: Filter; Metric: Metric; MetricsOptions: MetricsOptions; }; declare const getPlugins$3: GetPlugins; declare const CONFIG_KEY$4: "output"; declare const PLUGIN_NAME$4: PluginName; declare const FILE_KEYS: readonly [ "build", "bundler", "dependencies", "errors", "logs", "metrics", "timings", "warnings" ]; type FileKey = (typeof FILE_KEYS)[number]; type FileValue = boolean | string; type OutputOptions = { enable?: boolean; files?: { [K in FileKey]?: FileValue; }; path?: string; }; declare const helpers$1: {}; type types$4 = { OutputOptions: OutputOptions; }; declare const getFilePath: (outDir: string, pathOption: string, filename: string) => string; declare const getPlugins$4: GetPlugins; interface CookieOptions { secure?: boolean; crossSite?: boolean; partitioned?: boolean; domain?: string; } declare const SessionPersistence: { readonly COOKIE: "cookie"; readonly LOCAL_STORAGE: "local-storage"; }; type SessionPersistence = (typeof SessionPersistence)[keyof typeof SessionPersistence]; type SessionStoreStrategyType = { type: typeof SessionPersistence.COOKIE; cookieOptions: CookieOptions; } | { type: typeof SessionPersistence.LOCAL_STORAGE; }; interface Subscription { unsubscribe: () => void; } type Observer = (data: T) => void; declare class Observable { private onFirstSubscribe?; protected observers: Array>; private onLastUnsubscribe?; constructor(onFirstSubscribe?: ((observable: Observable) => (() => void) | void) | undefined); subscribe(observer: Observer): Subscription; notify(data: T): void; protected addObserver(observer: Observer): void; protected removeObserver(observer: Observer): void; } declare class BufferedObservable extends Observable { private maxBufferSize; private buffer; constructor(maxBufferSize: number); notify(data: T): void; subscribe(observer: Observer): Subscription; /** * Drop buffered data and don't buffer future data. This is to avoid leaking memory when it's not * needed anymore. This can be seen as a performance optimization, and things will work probably * even if this method isn't called, but still useful to clarify our intent and lowering our * memory impact. */ unbuffer(): void; } declare const TrackingConsent: { readonly GRANTED: "granted"; readonly NOT_GRANTED: "not-granted"; }; type TrackingConsent = (typeof TrackingConsent)[keyof typeof TrackingConsent]; interface TrackingConsentState { tryToInit: (trackingConsent: TrackingConsent) => void; update: (trackingConsent: TrackingConsent) => void; isGranted: () => boolean; observable: Observable; } type MatchOption = string | RegExp | ((value: string) => boolean); type Site = "datadoghq.com" | "us3.datadoghq.com" | "us5.datadoghq.com" | "datadoghq.eu" | "ddog-gov.com" | "ap1.datadoghq.com" | "ap2.datadoghq.com" | (string & {}); interface Context { [x: string]: ContextValue; } type ContextValue = string | number | boolean | Context | ContextArray | undefined | null; interface ContextArray extends Array { } type Duration = number & { d: "Duration in ms"; }; type ServerDuration = number & { s: "Duration in ns"; }; type TimeStamp = number & { t: "Epoch time"; }; type RelativeTime = number & { r: "Time relative to navigation start"; } & { d: "Duration in ms"; }; interface ClocksState { relative: RelativeTime; timeStamp: TimeStamp; } interface RawErrorCause { message: string; source: ErrorSource; type?: string; stack?: string; } interface Csp { disposition: "enforce" | "report"; } interface RawError { startClocks: ClocksState; message: string; type?: string; stack?: string; source: ErrorSource; originalError?: unknown; handling?: ErrorHandling; handlingStack?: string; componentStack?: string; causes?: RawErrorCause[]; fingerprint?: string; csp?: Csp; context?: Context; } declare const ErrorSource: { readonly AGENT: "agent"; readonly CONSOLE: "console"; readonly CUSTOM: "custom"; readonly LOGGER: "logger"; readonly NETWORK: "network"; readonly SOURCE: "source"; readonly REPORT: "report"; }; declare const enum ErrorHandling { HANDLED = "handled", UNHANDLED = "unhandled" } type ErrorSource = (typeof ErrorSource)[keyof typeof ErrorSource]; interface Payload { data: string | FormData | Blob; bytesCount: number; retry?: RetryInfo; encoding?: "deflate"; } interface RetryInfo { count: number; lastFailureStatus: number; } interface Uint8ArrayBuffer extends Uint8Array { readonly buffer: ArrayBuffer; subarray(begin?: number, end?: number): Uint8ArrayBuffer; } interface Encoder { /** * Whether this encoder might call the provided callbacks asynchronously */ isAsync: boolean; /** * Whether some data has been written since the last finish() or finishSync() call */ isEmpty: boolean; /** * Write a string to be encoded. * * This operation can be synchronous or asynchronous depending on the encoder implementation. * * If specified, the callback will be invoked when the operation finishes, unless the operation is * asynchronous and finish() or finishSync() is called in the meantime. */ write(data: string, callback?: (additionalEncodedBytesCount: number) => void): void; /** * Waits for pending data to be encoded and resets the encoder state. * * This operation can be synchronous or asynchronous depending on the encoder implementation. * * The callback will be invoked when the operation finishes, unless the operation is asynchronous * and another call to finish() or finishSync() occurs in the meantime. */ finish(callback: (result: EncoderResult) => void): void; /** * Resets the encoder state then returns the encoded data and any potential pending data directly, * discarding all pending write operations and finish() callbacks. */ finishSync(): EncoderResult & { pendingData: string; }; /** * Returns a rough estimation of the bytes count if the data was encoded. */ estimateEncodedBytesCount(data: string): number; } interface EncoderResult { output: Output; outputBytesCount: number; /** * An encoding type supported by HTTP Content-Encoding, if applicable. * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding#directives */ encoding?: "deflate"; /** * Total bytes count of the input strings encoded to UTF-8. */ rawBytesCount: number; } declare const PageExitReason: { readonly HIDDEN: "visibility_hidden"; readonly UNLOADING: "before_unload"; readonly PAGEHIDE: "page_hide"; readonly FROZEN: "page_frozen"; }; type PageExitReason = (typeof PageExitReason)[keyof typeof PageExitReason]; interface PageMayExitEvent { reason: PageExitReason; } type TrackType = "logs" | "rum" | "replay" | "profile" | "exposures" | "flagevaluation"; type ApiType = "fetch-keepalive" | "fetch" | "beacon" | "manual"; type EndpointBuilder = ReturnType; declare function createEndpointBuilder(initConfiguration: InitConfiguration, trackType: TrackType, extraParameters?: string[]): { build(api: ApiType, payload: Payload): string; trackType: TrackType; }; interface TransportConfiguration { logsEndpointBuilder: EndpointBuilder; rumEndpointBuilder: EndpointBuilder; sessionReplayEndpointBuilder: EndpointBuilder; profilingEndpointBuilder: EndpointBuilder; exposuresEndpointBuilder: EndpointBuilder; flagEvaluationEndpointBuilder: EndpointBuilder; datacenter?: string | undefined; replica?: ReplicaConfiguration; site: Site; source: "browser" | "flutter" | "unity"; } interface ReplicaConfiguration { logsEndpointBuilder: EndpointBuilder; rumEndpointBuilder: EndpointBuilder; } declare const DefaultPrivacyLevel: { readonly ALLOW: "allow"; readonly MASK: "mask"; readonly MASK_USER_INPUT: "mask-user-input"; readonly MASK_UNLESS_ALLOWLISTED: "mask-unless-allowlisted"; }; type DefaultPrivacyLevel = (typeof DefaultPrivacyLevel)[keyof typeof DefaultPrivacyLevel]; declare const TraceContextInjection: { readonly ALL: "all"; readonly SAMPLED: "sampled"; }; type TraceContextInjection = (typeof TraceContextInjection)[keyof typeof TraceContextInjection]; interface InitConfiguration { /** * The client token for Datadog. Required for authenticating your application with Datadog. * * @category Authentication */ clientToken: string; /** * A callback function that can be used to modify events before they are sent to Datadog. * * @category Data Collection */ beforeSend?: GenericBeforeSendCallback | undefined; /** * The percentage of sessions tracked. A value between 0 and 100. * * @category Data Collection * @defaultValue 100 */ sessionSampleRate?: number | undefined; /** * The percentage of telemetry events sent. A value between 0 and 100. * * @category Data Collection * @defaultValue 20 */ telemetrySampleRate?: number | undefined; /** * Initialization fails silently if the RUM Browser SDK is already initialized on the page. * * @defaultValue false */ silentMultipleInit?: boolean | undefined; /** * Which storage strategy to use for persisting sessions. Can be either 'cookie' or 'local-storage'. * * Important: If you are using the RUM and Logs Browser SDKs, this option must be configured with identical values * * @category Session Persistence * @defaultValue "cookie" */ sessionPersistence?: SessionPersistence | undefined; /** * Allows the use of localStorage when cookies cannot be set. This enables the RUM Browser SDK to run in environments that do not provide cookie support. * * Important: If you are using the RUM and Logs Browser SDKs, this option must be configured with identical values * See [Monitor Electron Applications Using the Browser SDK](https://docs.datadoghq.com/real_user_monitoring/guide/monitor-electron-applications-using-browser-sdk) for further information. * * @category Session Persistence * @deprecated use `sessionPersistence: local-storage` where you want to use localStorage instead */ allowFallbackToLocalStorage?: boolean | undefined; /** * Allow listening to DOM events dispatched programmatically ([untrusted events](https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted)). Enabling this option can be useful if you heavily rely on programmatic events, such as in an automated UI test environment. * * @defaultValue false */ allowUntrustedEvents?: boolean | undefined; /** * Store global context and user context in localStorage to preserve them along the user navigation. * See [Contexts life cycle](https://docs.datadoghq.com/real_user_monitoring/browser/advanced_configuration/?tab=npm#contexts-life-cycle) for further information. * * @defaultValue false */ storeContextsAcrossPages?: boolean | undefined; /** * Set the initial user tracking consent state. * See [User tracking consent](https://docs.datadoghq.com/real_user_monitoring/browser/advanced_configuration/?tab=npm#user-tracking-consent) for further information. * * @category Privacy * @defaultValue granted */ trackingConsent?: TrackingConsent | undefined; /** * List of origins where the SDK is allowed to run when used in a browser extension context. * Matches urls against the extensions origin. * If not provided and the SDK is running in a browser extension, the SDK will not run. */ allowedTrackingOrigins?: MatchOption[] | undefined; /** * Optional proxy URL, for example: https://www.proxy.com/path. * See [Proxy Your Browser RUM Data](https://docs.datadoghq.com/real_user_monitoring/guide/proxy-rum-data) for further information. * * @category Transport */ proxy?: string | ProxyFn | undefined; /** * The Datadog [site](https://docs.datadoghq.com/getting_started/site) parameter of your organization. * * @category Transport * @defaultValue datadoghq.com */ site?: Site | undefined; /** * The service name for your application. Follows the [tag syntax requirements](https://docs.datadoghq.com/getting_started/tagging/#define-tags). * * @category Data Collection */ service?: string | undefined | null; /** * The application’s environment, for example: prod, pre-prod, and staging. Follows the [tag syntax requirements](https://docs.datadoghq.com/getting_started/tagging/#define-tags). * * @category Data Collection */ env?: string | undefined | null; /** * The application’s version, for example: 1.2.3, 6c44da20, and 2020.02.13. Follows the [tag syntax requirements](https://docs.datadoghq.com/getting_started/tagging/#define-tags). * * @category Data Collection */ version?: string | undefined | null; /** * Use a partitioned secure cross-site session cookie. This allows the RUM Browser SDK to run when the site is loaded from another one (iframe). Implies `useSecureSessionCookie`. * * Important: If you are using the RUM and Logs Browser SDKs, this option must be configured with identical values * * @category Session Persistence * @defaultValue false */ usePartitionedCrossSiteSessionCookie?: boolean | undefined; /** * Use a secure session cookie. This disables RUM events sent on insecure (non-HTTPS) connections. * * Important: If you are using the RUM and Logs Browser SDKs, this option must be configured with identical values * * @category Session Persistence * @defaultValue false */ useSecureSessionCookie?: boolean | undefined; /** * Preserve the session across subdomains for the same site. * * Important: If you are using the RUM and Logs Browser SDKs, this option must be configured with identical values * * @category Session Persistence * @defaultValue false */ trackSessionAcrossSubdomains?: boolean | undefined; /** * Track anonymous user for the same site and extend cookie expiration date * * @category Data Collection * @defaultValue true */ trackAnonymousUser?: boolean | undefined; /** * Encode cookie options in the cookie value. This can be used as a mitigation for microssession issues. * ⚠️ This is a beta feature and may be changed or removed in the future. * * @category Beta * @defaultValue false */ betaEncodeCookieOptions?: boolean | undefined; /** * [Internal option] Enable experimental features * * @internal */ enableExperimentalFeatures?: string[] | undefined; /** * [Internal option] Configure the dual shipping to another datacenter * * @internal */ replica?: ReplicaUserConfiguration | undefined; /** * [Internal option] Set the datacenter from where the data is dual shipped * * @internal */ datacenter?: string; /** * [Internal option] Datadog internal analytics subdomain * * @internal */ internalAnalyticsSubdomain?: string; /** * [Internal option] The percentage of telemetry configuration sent. A value between 0 and 100. * * @internal * @defaultValue 5 */ telemetryConfigurationSampleRate?: number; /** * [Internal option] The percentage of telemetry usage sent. A value between 0 and 100. * * @internal * @defaultValue 5 */ telemetryUsageSampleRate?: number; /** * [Internal option] Additional configuration for the SDK. * * @internal */ source?: "browser" | "flutter" | "unity" | undefined; /** * [Internal option] Additional configuration for the SDK. * * @internal */ sdkVersion?: string | undefined; /** * [Internal option] Additional configuration for the SDK. * * @internal */ variant?: string | undefined; } type GenericBeforeSendCallback = (event: any, context?: any) => unknown; type ProxyFn = (options: { path: string; parameters: string; }) => string; interface ReplicaUserConfiguration { applicationId?: string; clientToken: string; } interface Configuration extends TransportConfiguration { beforeSend: GenericBeforeSendCallback | undefined; sessionStoreStrategyType: SessionStoreStrategyType | undefined; sessionSampleRate: number; telemetrySampleRate: number; telemetryConfigurationSampleRate: number; telemetryUsageSampleRate: number; service?: string | undefined; version?: string | undefined; env?: string | undefined; silentMultipleInit: boolean; allowUntrustedEvents: boolean; trackingConsent: TrackingConsent; storeContextsAcrossPages: boolean; trackAnonymousUser?: boolean; betaEncodeCookieOptions: boolean; sdkVersion: string | undefined; source: "browser" | "flutter" | "unity"; variant: string | undefined; } interface PublicApi { /** * Version of the Logs browser SDK */ version: string; /** * For CDN async setup: Early RUM API calls must be wrapped in the `window.DD_RUM.onReady()` callback. This ensures the code only gets executed once the SDK is properly loaded. * * See [CDN async setup](https://docs.datadoghq.com/real_user_monitoring/browser/#cdn-async) for further information. */ onReady: (callback: () => void) => void; } type DeflateWorkerAction = { action: "init"; } | { action: "write"; id: number; streamId: number; data: string; } | { action: "reset"; streamId: number; }; interface DeflateWorker extends Worker { postMessage(message: DeflateWorkerAction): void; } declare const enum DeflateEncoderStreamId { REPLAY = 1, RUM = 2, TELEMETRY = 4, PROFILING = 6 } declare const enum HookNames { Assemble = 0, AssembleTelemetry = 1 } declare const HookNamesAsConst: { ASSEMBLE: HookNames.Assemble; ASSEMBLE_TELEMETRY: HookNames.AssembleTelemetry; }; type RecursivePartial = { [P in keyof T]?: T[P] extends Array ? Array> : T[P] extends object | undefined ? RecursivePartial : T[P]; }; declare const DISCARDED = "DISCARDED"; declare const SKIPPED = "SKIPPED"; type DISCARDED = typeof DISCARDED; type SKIPPED = typeof SKIPPED; type TelemetryEvent = TelemetryErrorEvent | TelemetryDebugEvent | TelemetryConfigurationEvent | TelemetryUsageEvent; type TelemetryErrorEvent = CommonTelemetryProperties & { /** * The telemetry log information */ telemetry: { /** * Telemetry type */ type?: "log"; /** * Level/severity of the log */ status: "error"; /** * Body of the log */ message: string; /** * Error properties */ error?: { /** * The stack trace or the complementary information about the error */ stack?: string; /** * The error type or kind (or code in some cases) */ kind?: string; [k: string]: unknown; }; [k: string]: unknown; }; [k: string]: unknown; }; type TelemetryDebugEvent = CommonTelemetryProperties & { /** * The telemetry log information */ telemetry: { /** * Telemetry type */ type?: "log"; /** * Level/severity of the log */ status: "debug"; /** * Body of the log */ message: string; [k: string]: unknown; }; [k: string]: unknown; }; type TelemetryConfigurationEvent = CommonTelemetryProperties & { /** * The telemetry configuration information */ telemetry: { /** * Telemetry type */ type: "configuration"; /** * Configuration properties */ configuration: { /** * The percentage of sessions tracked */ session_sample_rate?: number; /** * The percentage of telemetry events sent */ telemetry_sample_rate?: number; /** * The percentage of telemetry configuration events sent after being sampled by telemetry_sample_rate */ telemetry_configuration_sample_rate?: number; /** * The percentage of telemetry usage events sent after being sampled by telemetry_sample_rate */ telemetry_usage_sample_rate?: number; /** * The percentage of requests traced */ trace_sample_rate?: number; /** * The opt-in configuration to add trace context */ trace_context_injection?: "all" | "sampled"; /** * The percentage of sessions with Browser RUM & Session Replay pricing tracked (deprecated in favor of session_replay_sample_rate) */ premium_sample_rate?: number; /** * The percentage of sessions with Browser RUM & Session Replay pricing tracked (deprecated in favor of session_replay_sample_rate) */ replay_sample_rate?: number; /** * The percentage of sessions with RUM & Session Replay pricing tracked */ session_replay_sample_rate?: number; /** * The initial tracking consent value */ tracking_consent?: "granted" | "not-granted" | "pending"; /** * Whether the session replay start is handled manually */ start_session_replay_recording_manually?: boolean; /** * Whether Session Replay should automatically start a recording when enabled */ start_recording_immediately?: boolean; /** * Whether a proxy is used */ use_proxy?: boolean; /** * Whether beforeSend callback function is used */ use_before_send?: boolean; /** * Whether initialization fails silently if the SDK is already initialized */ silent_multiple_init?: boolean; /** * Whether sessions across subdomains for the same site are tracked */ track_session_across_subdomains?: boolean; /** * Whether resources are tracked */ track_resources?: boolean; /** * Whether early requests are tracked */ track_early_requests?: boolean; /** * Whether long tasks are tracked */ track_long_task?: boolean; /** * Whether views loaded from the bfcache are tracked */ track_bfcache_views?: boolean; /** * Whether a secure cross-site session cookie is used (deprecated) */ use_cross_site_session_cookie?: boolean; /** * Whether a partitioned secure cross-site session cookie is used */ use_partitioned_cross_site_session_cookie?: boolean; /** * Whether a secure session cookie is used */ use_secure_session_cookie?: boolean; /** * Whether it is allowed to use LocalStorage when cookies are not available (deprecated in favor of session_persistence) */ allow_fallback_to_local_storage?: boolean; /** * Configure the storage strategy for persisting sessions */ session_persistence?: "local-storage" | "cookie"; /** * Whether contexts are stored in local storage */ store_contexts_across_pages?: boolean; /** * Whether untrusted events are allowed */ allow_untrusted_events?: boolean; /** * Attribute to be used to name actions */ action_name_attribute?: string; /** * Whether the allowed tracing origins list is used (deprecated in favor of use_allowed_tracing_urls) */ use_allowed_tracing_origins?: boolean; /** * Whether the allowed tracing urls list is used */ use_allowed_tracing_urls?: boolean; /** * Whether the allowed GraphQL urls list is used */ use_allowed_graph_ql_urls?: boolean; /** * Whether GraphQL payload tracking is used for at least one GraphQL endpoint */ use_track_graph_ql_payload?: boolean; /** * Whether GraphQL response errors tracking is used for at least one GraphQL endpoint */ use_track_graph_ql_response_errors?: boolean; /** * A list of selected tracing propagators */ selected_tracing_propagators?: ("datadog" | "b3" | "b3multi" | "tracecontext")[]; /** * Session replay default privacy level */ default_privacy_level?: string; /** * Session replay text and input privacy level */ text_and_input_privacy_level?: string; /** * Session replay image privacy level */ image_privacy_level?: string; /** * Session replay touch privacy level */ touch_privacy_level?: string; /** * Privacy control for action name */ enable_privacy_for_action_name?: boolean; /** * Whether the request origins list to ignore when computing the page activity is used */ use_excluded_activity_urls?: boolean; /** * Whether the Worker is loaded from an external URL */ use_worker_url?: boolean; /** * Whether intake requests are compressed */ compress_intake_requests?: boolean; /** * Whether user frustrations are tracked */ track_frustrations?: boolean; /** * Whether the RUM views creation is handled manually */ track_views_manually?: boolean; /** * Whether user actions are tracked (deprecated in favor of track_user_interactions) */ track_interactions?: boolean; /** * Whether user actions are tracked */ track_user_interactions?: boolean; /** * Whether console.error logs, uncaught exceptions and network errors are tracked */ forward_errors_to_logs?: boolean; /** * The number of displays available to the device */ number_of_displays?: number; /** * The console.* tracked */ forward_console_logs?: string[] | "all"; /** * The reports from the Reporting API tracked */ forward_reports?: string[] | "all"; /** * Whether local encryption is used */ use_local_encryption?: boolean; /** * View tracking strategy */ view_tracking_strategy?: "ActivityViewTrackingStrategy" | "FragmentViewTrackingStrategy" | "MixedViewTrackingStrategy" | "NavigationViewTrackingStrategy"; /** * Whether SwiftUI view instrumentation is enabled */ swiftui_view_tracking_enabled?: boolean; /** * Whether SwiftUI action instrumentation is enabled */ swiftui_action_tracking_enabled?: boolean; /** * Whether RUM events are tracked when the application is in Background */ track_background_events?: boolean; /** * The period between each Mobile Vital sample (in milliseconds) */ mobile_vitals_update_period?: number; /** * Whether error monitoring & crash reporting is enabled for the source platform */ track_errors?: boolean; /** * Whether automatic collection of network requests is enabled */ track_network_requests?: boolean; /** * Whether tracing features are enabled */ use_tracing?: boolean; /** * Whether native views are tracked (for cross platform SDKs) */ track_native_views?: boolean; /** * Whether native error monitoring & crash reporting is enabled (for cross platform SDKs) */ track_native_errors?: boolean; /** * Whether long task tracking is performed automatically */ track_native_long_tasks?: boolean; /** * Whether long task tracking is performed automatically for cross platform SDKs */ track_cross_platform_long_tasks?: boolean; /** * Whether the client has provided a list of first party hosts */ use_first_party_hosts?: boolean; /** * The type of initialization the SDK used, in case multiple are supported */ initialization_type?: string; /** * Whether Flutter build and raster time tracking is enabled */ track_flutter_performance?: boolean; /** * The window duration for batches sent by the SDK (in milliseconds) */ batch_size?: number; /** * The upload frequency of batches (in milliseconds) */ batch_upload_frequency?: number; /** * Maximum number of batches processed sequentially without a delay */ batch_processing_level?: number; /** * Whether UIApplication background tasks are enabled */ background_tasks_enabled?: boolean; /** * The version of React used in a ReactNative application */ react_version?: string; /** * The version of ReactNative used in a ReactNative application */ react_native_version?: string; /** * The version of Dart used in a Flutter application */ dart_version?: string; /** * The version of Unity used in a Unity application */ unity_version?: string; /** * The threshold used for iOS App Hangs monitoring (in milliseconds) */ app_hang_threshold?: number; /** * Whether logs are sent to the PCI-compliant intake */ use_pci_intake?: boolean; /** * The tracer API used by the SDK. Possible values: 'Datadog', 'OpenTelemetry', 'OpenTracing' */ tracer_api?: string; /** * The version of the tracer API used by the SDK. Eg. '0.1.0' */ tracer_api_version?: string; /** * Whether logs are sent after the session expiration */ send_logs_after_session_expiration?: boolean; /** * The list of plugins enabled */ plugins?: { /** * The name of the plugin */ name: string; [k: string]: unknown; }[]; /** * Whether the SDK is initialised on the application's main or a secondary process */ is_main_process?: boolean; /** * Interval in milliseconds when the last action is considered as the action that created the next view. Only sent if a time based strategy has been used */ inv_time_threshold_ms?: number; /** * The interval in milliseconds during which all network requests will be considered as initial, i.e. caused by the creation of this view. Only sent if a time based strategy has been used */ tns_time_threshold_ms?: number; /** * The list of events that include feature flags collection. The tracking is always enabled for views and errors. */ track_feature_flags_for_events?: ("vital" | "resource" | "action" | "long_task")[]; /** * Whether the anonymous users are tracked */ track_anonymous_user?: boolean; /** * Whether a list of allowed origins is used to control SDK execution in browser extension contexts. When enabled, the SDK will check if the current origin matches the allowed origins list before running. */ use_allowed_tracking_origins?: boolean; /** * The version of the SDK that is running. */ sdk_version?: string; /** * The source of the SDK, e.g., 'browser', 'ios', 'android', 'flutter', 'react-native', 'unity', 'kotlin-multiplatform'. */ source?: string; /** * The variant of the SDK build (e.g., standard, lite, etc.). */ variant?: string; /** * The id of the remote configuration */ remote_configuration_id?: string; /** * Whether a proxy is used for remote configuration */ use_remote_configuration_proxy?: boolean; /** * The percentage of sessions with Profiling enabled */ profiling_sample_rate?: number; /** * Whether trace baggage is propagated to child spans */ propagate_trace_baggage?: boolean; /** * Whether the beta encode cookie options is enabled */ beta_encode_cookie_options?: boolean; [k: string]: unknown; }; [k: string]: unknown; }; [k: string]: unknown; }; type TelemetryUsageEvent = CommonTelemetryProperties & { /** * The telemetry usage information */ telemetry: { /** * Telemetry type */ type: "usage"; usage: TelemetryCommonFeaturesUsage | TelemetryBrowserFeaturesUsage | TelemetryMobileFeaturesUsage; [k: string]: unknown; }; [k: string]: unknown; }; type TelemetryCommonFeaturesUsage = SetTrackingConsent | StopSession | StartView | SetViewContext | SetViewContextProperty | SetViewName | GetViewContext | AddAction | AddError | GetGlobalContext | SetGlobalContext | SetGlobalContextProperty | RemoveGlobalContextProperty | ClearGlobalContext | GetUser | SetUser | SetUserProperty | RemoveUserProperty | ClearUser | GetAccount | SetAccount | SetAccountProperty | RemoveAccountProperty | ClearAccount | AddFeatureFlagEvaluation | AddOperationStepVital; type TelemetryBrowserFeaturesUsage = StartSessionReplayRecording | StartDurationVital | StopDurationVital | AddDurationVital; type TelemetryMobileFeaturesUsage = AddViewLoadingTime | TrackWebView; interface CommonTelemetryProperties { /** * Internal properties */ _dd: { /** * Version of the RUM event format */ readonly format_version: 2; [k: string]: unknown; }; /** * Telemetry event type. Should specify telemetry only. */ readonly type: "telemetry"; /** * Start of the event in ms from epoch */ date: number; /** * The SDK generating the telemetry event */ service: string; /** * The source of this event */ readonly source: "android" | "ios" | "browser" | "flutter" | "react-native" | "unity" | "kotlin-multiplatform"; /** * The version of the SDK generating the telemetry event */ version: string; /** * Application properties */ readonly application?: { /** * UUID of the application */ id: string; [k: string]: unknown; }; /** * Session properties */ session?: { /** * UUID of the session */ id: string; [k: string]: unknown; }; /** * View properties */ view?: { /** * UUID of the view */ id: string; [k: string]: unknown; }; /** * Action properties */ action?: { /** * UUID of the action */ id: string; [k: string]: unknown; }; /** * The actual percentage of telemetry usage per event */ effective_sample_rate?: number; /** * Enabled experimental features */ readonly experimental_features?: string[]; telemetry?: { /** * Device properties */ device?: { /** * Architecture of the device */ architecture?: string; /** * Brand of the device */ brand?: string; /** * Model of the device */ model?: string; /** * Number of logical CPU cores available for scheduling on the device at runtime, as reported by the operating system. */ readonly logical_cpu_count?: number; /** * Total RAM in megabytes */ readonly total_ram?: number; /** * Whether the device is considered a low RAM device (Android) */ readonly is_low_ram?: boolean; [k: string]: unknown; }; /** * OS properties */ os?: { /** * Build of the OS */ build?: string; /** * Name of the OS */ name?: string; /** * Version of the OS */ version?: string; [k: string]: unknown; }; [k: string]: unknown; }; [k: string]: unknown; } interface SetTrackingConsent { /** * setTrackingConsent API */ feature: "set-tracking-consent"; /** * The tracking consent value set by the user */ tracking_consent: "granted" | "not-granted" | "pending"; [k: string]: unknown; } interface StopSession { /** * stopSession API */ feature: "stop-session"; [k: string]: unknown; } interface StartView { /** * startView API */ feature: "start-view"; [k: string]: unknown; } interface SetViewContext { /** * setViewContext API */ feature: "set-view-context"; [k: string]: unknown; } interface SetViewContextProperty { /** * setViewContextProperty API */ feature: "set-view-context-property"; [k: string]: unknown; } interface SetViewName { /** * setViewName API */ feature: "set-view-name"; [k: string]: unknown; } interface GetViewContext { /** * getViewContext API */ feature: "get-view-context"; [k: string]: unknown; } interface AddAction { /** * addAction API */ feature: "add-action"; [k: string]: unknown; } interface AddError { /** * addError API */ feature: "add-error"; [k: string]: unknown; } interface GetGlobalContext { /** * getGlobalContext API */ feature: "get-global-context"; [k: string]: unknown; } interface SetGlobalContext { /** * setGlobalContext, addAttribute APIs */ feature: "set-global-context"; [k: string]: unknown; } interface SetGlobalContextProperty { /** * setGlobalContextProperty API */ feature: "set-global-context-property"; [k: string]: unknown; } interface RemoveGlobalContextProperty { /** * removeGlobalContextProperty API */ feature: "remove-global-context-property"; [k: string]: unknown; } interface ClearGlobalContext { /** * clearGlobalContext API */ feature: "clear-global-context"; [k: string]: unknown; } interface GetUser { /** * getUser API */ feature: "get-user"; [k: string]: unknown; } interface SetUser { /** * setUser, setUserInfo APIs */ feature: "set-user"; [k: string]: unknown; } interface SetUserProperty { /** * setUserProperty API */ feature: "set-user-property"; [k: string]: unknown; } interface RemoveUserProperty { /** * removeUserProperty API */ feature: "remove-user-property"; [k: string]: unknown; } interface ClearUser { /** * clearUser API */ feature: "clear-user"; [k: string]: unknown; } interface GetAccount { /** * getAccount API */ feature: "get-account"; [k: string]: unknown; } interface SetAccount { /** * setAccount, setAccountProperty APIs */ feature: "set-account"; [k: string]: unknown; } interface SetAccountProperty { /** * setAccountProperty API */ feature: "set-account-property"; [k: string]: unknown; } interface RemoveAccountProperty { /** * removeAccountProperty API */ feature: "remove-account-property"; [k: string]: unknown; } interface ClearAccount { /** * clearAccount API */ feature: "clear-account"; [k: string]: unknown; } interface AddFeatureFlagEvaluation { /** * addFeatureFlagEvaluation API */ feature: "add-feature-flag-evaluation"; [k: string]: unknown; } interface AddOperationStepVital { /** * addOperationStepVital API */ feature: "add-operation-step-vital"; /** * Operations step type */ action_type: "start" | "succeed" | "fail"; [k: string]: unknown; } interface StartSessionReplayRecording { /** * startSessionReplayRecording API */ feature: "start-session-replay-recording"; /** * Whether the recording is allowed to start even on sessions sampled out of replay */ is_forced?: boolean; [k: string]: unknown; } interface StartDurationVital { /** * startDurationVital API */ feature: "start-duration-vital"; [k: string]: unknown; } interface StopDurationVital { /** * stopDurationVital API */ feature: "stop-duration-vital"; [k: string]: unknown; } interface AddDurationVital { /** * addDurationVital API */ feature: "add-duration-vital"; [k: string]: unknown; } interface AddViewLoadingTime { /** * addViewLoadingTime API */ feature: "addViewLoadingTime"; /** * Whether the view is not available */ no_view: boolean; /** * Whether the available view is not active */ no_active_view: boolean; /** * Whether the loading time was overwritten */ overwritten: boolean; [k: string]: unknown; } interface TrackWebView { /** * trackWebView API */ feature: "trackWebView"; [k: string]: unknown; } interface Telemetry { stop: () => void; enabled: boolean; metricsEnabled: boolean; } type EventTypesWithoutData = { [K in keyof EventMap]: EventMap[K] extends void ? K : never; }[keyof EventMap]; declare class AbstractLifeCycle { private callbacks; notify>(eventType: EventType): void; notify(eventType: EventType, data: EventMap[EventType]): void; subscribe(eventType: EventType, callback: (data: EventMap[EventType]) => void): Subscription; } type ContextManager = ReturnType; interface PropertiesConfig { [key: string]: { required?: boolean; type?: "string"; }; } declare function createContextManager(name?: string, { propertiesConfig, }?: { propertiesConfig?: PropertiesConfig; }): { getContext: () => Context; setContext: (newContext: unknown) => void; setContextProperty: (key: string, property: any) => void; removeContextProperty: (key: string) => void; clearContext: () => void; changeObservable: Observable; }; interface Account { id: string; name?: string | undefined; [key: string]: unknown; } interface User { id?: string | undefined; email?: string | undefined; name?: string | undefined; [key: string]: unknown; } interface RumInternalContext extends Context { application_id: string; session_id: string | undefined; view?: { id: string; url: string; referrer: string; name?: string; }; user_action?: { id: string | string[]; }; } declare const ResourceType: { readonly DOCUMENT: "document"; readonly XHR: "xhr"; readonly BEACON: "beacon"; readonly FETCH: "fetch"; readonly CSS: "css"; readonly JS: "js"; readonly IMAGE: "image"; readonly FONT: "font"; readonly MEDIA: "media"; readonly OTHER: "other"; }; type ResourceType = (typeof ResourceType)[keyof typeof ResourceType]; declare const RequestType: { readonly FETCH: "fetch"; readonly XHR: "xhr"; }; type RequestType = (typeof RequestType)[keyof typeof RequestType]; declare const enum BufferedDataType { RUNTIME_ERROR = 0 } interface BufferedData { type: BufferedDataType.RUNTIME_ERROR; error: RawError; } type RumEvent = RumActionEvent | RumTransitionEvent | RumErrorEvent | RumLongTaskEvent | RumResourceEvent | RumViewEvent | RumVitalEvent; type RumActionEvent = CommonProperties & ViewContainerSchema & { /** * RUM event type */ readonly type: "action"; /** * Action properties */ readonly action: { /** * Type of the action */ readonly type: "custom" | "click" | "tap" | "scroll" | "swipe" | "application_start" | "back"; /** * UUID of the action */ readonly id?: string; /** * Duration in ns to the action is considered loaded */ readonly loading_time?: number; /** * Action target properties */ readonly target?: { /** * Target name */ name: string; [k: string]: unknown; }; /** * Action frustration properties */ readonly frustration?: { /** * Action frustration types */ readonly type: ("rage_click" | "dead_click" | "error_click" | "rage_tap" | "error_tap")[]; [k: string]: unknown; }; /** * Properties of the errors of the action */ readonly error?: { /** * Number of errors that occurred on the action */ readonly count: number; [k: string]: unknown; }; /** * Properties of the crashes of the action */ readonly crash?: { /** * Number of crashes that occurred on the action */ readonly count: number; [k: string]: unknown; }; /** * Properties of the long tasks of the action */ readonly long_task?: { /** * Number of long tasks that occurred on the action */ readonly count: number; [k: string]: unknown; }; /** * Properties of the resources of the action */ readonly resource?: { /** * Number of resources that occurred on the action */ readonly count: number; [k: string]: unknown; }; [k: string]: unknown; }; /** * View properties */ readonly view?: { /** * Is the action starting in the foreground (focus in browser) */ readonly in_foreground?: boolean; [k: string]: unknown; }; /** * Internal properties */ _dd?: { /** * Action properties */ readonly action?: { /** * Action position properties */ readonly position?: { /** * X coordinate relative to the target element of the action (in pixels) */ readonly x: number; /** * Y coordinate relative to the target element of the action (in pixels) */ readonly y: number; [k: string]: unknown; }; /** * Target properties */ target?: { /** * CSS selector path of the target element */ readonly selector?: string; /** * Width of the target element (in pixels) */ readonly width?: number; /** * Height of the target element (in pixels) */ readonly height?: number; [k: string]: unknown; }; /** * The strategy of how the auto click action name is computed */ name_source?: "custom_attribute" | "mask_placeholder" | "standard_attribute" | "text_content" | "mask_disallowed" | "blank"; [k: string]: unknown; }; [k: string]: unknown; }; [k: string]: unknown; }; type RumTransitionEvent = CommonProperties & { /** * RUM event type */ readonly type: "transition"; /** * Stream properties */ readonly stream: { /** * UUID of the stream */ readonly id: string; [k: string]: unknown; }; /** * Transition properties */ readonly transition: { /** * Type of the transition */ readonly type: string; /** * UUID of the transition */ readonly id?: string; /** * The player's current timestamp in milliseconds */ readonly timestamp?: number; /** * Buffer starvation duration, the amount of time spent rebuffering in milliseconds */ readonly buffer_starvation_duration?: number; /** * Media start delay, the amount of time spent loading before playing in milliseconds */ readonly media_start_delay?: number; /** * Error code, as reported by the player */ readonly error_code?: number; /** * Duration of the event in milliseconds */ readonly duration?: number; [k: string]: unknown; }; [k: string]: unknown; }; type RumErrorEvent = CommonProperties & ActionChildProperties & ViewContainerSchema & { /** * RUM event type */ readonly type: "error"; /** * Error properties */ readonly error: { /** * UUID of the error */ readonly id?: string; /** * Error message */ message: string; /** * Source of the error */ readonly source: "network" | "source" | "console" | "logger" | "agent" | "webview" | "custom" | "report"; /** * Stacktrace of the error */ stack?: string; /** * Causes of the error */ causes?: { /** * Error message */ message: string; /** * The type of the error */ readonly type?: string; /** * Stacktrace of the error */ stack?: string; /** * Source of the error */ readonly source: "network" | "source" | "console" | "logger" | "agent" | "webview" | "custom" | "report"; [k: string]: unknown; }[]; /** * Whether this error crashed the host application */ readonly is_crash?: boolean; /** * Fingerprint used for Error Tracking custom grouping */ fingerprint?: string; /** * The type of the error */ readonly type?: string; /** * The specific category of the error. It provides a high-level grouping for different types of errors. */ readonly category?: "ANR" | "App Hang" | "Exception" | "Watchdog Termination" | "Memory Warning" | "Network"; /** * Whether the error has been handled manually in the source code or not */ readonly handling?: "handled" | "unhandled"; /** * Handling call stack */ readonly handling_stack?: string; /** * Source type of the error (the language or platform impacting the error stacktrace format) */ readonly source_type?: "android" | "browser" | "ios" | "react-native" | "flutter" | "roku" | "ndk" | "ios+il2cpp" | "ndk+il2cpp"; /** * Resource properties of the error */ readonly resource?: { /** * HTTP method of the resource */ readonly method: "POST" | "GET" | "HEAD" | "PUT" | "DELETE" | "PATCH" | "TRACE" | "OPTIONS" | "CONNECT"; /** * HTTP Status code of the resource */ readonly status_code: number; /** * URL of the resource */ url: string; /** * The provider for this resource */ readonly provider?: { /** * The domain name of the provider */ readonly domain?: string; /** * The user friendly name of the provider */ readonly name?: string; /** * The type of provider */ readonly type?: "ad" | "advertising" | "analytics" | "cdn" | "content" | "customer-success" | "first party" | "hosting" | "marketing" | "other" | "social" | "tag-manager" | "utility" | "video"; [k: string]: unknown; }; [k: string]: unknown; }; /** * Description of each thread in the process when error happened. */ threads?: { /** * Name of the thread (e.g. 'Thread 0'). */ readonly name: string; /** * Tells if the thread crashed. */ readonly crashed: boolean; /** * Unsymbolicated stack trace of the given thread. */ readonly stack: string; /** * Platform-specific state of the thread when its state was captured (CPU registers dump for iOS, thread state enum for Android, etc.). */ readonly state?: string; [k: string]: unknown; }[]; /** * Description of each binary image (native libraries; for Android: .so files) loaded or referenced by the process/application. */ readonly binary_images?: { /** * Build UUID that uniquely identifies the binary image. */ readonly uuid: string; /** * Name of the library. */ readonly name: string; /** * Determines if it's a system or user library. */ readonly is_system: boolean; /** * Library's load address (hexadecimal). */ readonly load_address?: string; /** * Max value from the library address range (hexadecimal). */ readonly max_address?: string; /** * CPU architecture from the library. */ readonly arch?: string; [k: string]: unknown; }[]; /** * A boolean value saying if any of the stack traces was truncated due to minification. */ readonly was_truncated?: boolean; /** * Platform-specific metadata of the error event. */ readonly meta?: { /** * The CPU architecture of the process that crashed. */ readonly code_type?: string; /** * Parent process information. */ readonly parent_process?: string; /** * A client-generated 16-byte UUID of the incident. */ readonly incident_identifier?: string; /** * The name of the crashed process. */ readonly process?: string; /** * The name of the corresponding BSD termination signal. (in case of iOS crash) */ readonly exception_type?: string; /** * CPU specific information about the exception encoded into 64-bit hexadecimal number preceded by the signal code. */ readonly exception_codes?: string; /** * The location of the executable. */ readonly path?: string; [k: string]: unknown; }; /** * Content Security Violation properties */ readonly csp?: { /** * In the context of CSP errors, indicates how the violated policy is configured to be treated by the user agent. */ readonly disposition?: "enforce" | "report"; [k: string]: unknown; }; /** * Time since application start when error happened (in milliseconds) */ readonly time_since_app_start?: number; [k: string]: unknown; }; /** * Properties of App Hang and ANR errors */ readonly freeze?: { /** * Duration of the main thread freeze (in ns) */ readonly duration: number; [k: string]: unknown; }; /** * View properties */ readonly view?: { /** * Is the error starting in the foreground (focus in browser) */ readonly in_foreground?: boolean; [k: string]: unknown; }; /** * Feature flags properties */ readonly feature_flags?: { [k: string]: unknown; }; [k: string]: unknown; }; type RumLongTaskEvent = CommonProperties & ActionChildProperties & ViewContainerSchema & { /** * RUM event type */ readonly type: "long_task"; /** * Long Task properties */ readonly long_task: { /** * UUID of the long task or long animation frame */ readonly id?: string; /** * Start time of the long animation frame */ readonly start_time?: number; /** * Type of the event: long task or long animation frame */ readonly entry_type?: "long-task" | "long-animation-frame"; /** * Duration in ns of the long task or long animation frame */ readonly duration: number; /** * Duration in ns for which the animation frame was being blocked */ readonly blocking_duration?: number; /** * Time difference (in ns) between the timeOrigin and the start time of the rendering cycle, which includes requestAnimationFrame callbacks, style and layout calculation, resize observer and intersection observer callbacks */ readonly render_start?: number; /** * Time difference (in ns) between the timeOrigin and the start time of the time period spent in style and layout calculations */ readonly style_and_layout_start?: number; /** * Time difference (in ns) between the timeOrigin and the start time of of the first UI event (mouse/keyboard and so on) to be handled during the course of this frame */ readonly first_ui_event_timestamp?: number; /** * Whether this long task is considered a frozen frame */ readonly is_frozen_frame?: boolean; /** * A list of long scripts that were executed over the course of the long frame */ readonly scripts?: { /** * Duration in ns between startTime and when the subsequent microtask queue has finished processing */ readonly duration?: number; /** * Duration in ns of the total time spent in 'pausing' synchronous operations (alert, synchronous XHR) */ readonly pause_duration?: number; /** * Duration in ns of the the total time spent processing forced layout and style inside this function */ readonly forced_style_and_layout_duration?: number; /** * Time the entry function was invoked */ readonly start_time?: number; /** * Time after compilation */ readonly execution_start?: number; /** * The script resource name where available (or empty if not found) */ source_url?: string; /** * The script function name where available (or empty if not found) */ readonly source_function_name?: string; /** * The script character position where available (or -1 if not found) */ readonly source_char_position?: number; /** * Information about the invoker of the script */ invoker?: string; /** * Type of the invoker of the script */ readonly invoker_type?: "user-callback" | "event-listener" | "resolve-promise" | "reject-promise" | "classic-script" | "module-script"; /** * The container (the top-level document, or an