/** * * Copyright 2020-2026 Splunk Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ import { Attributes } from '@opentelemetry/api'; import type { SplunkOtelWebType } from '@splunk/otel-web'; import { BatchLogProcessor } from './batch-log-processor'; import { RecorderPublicConfig } from './session-replay'; export type SplunkRumRecorderConfig = { /** Destination for the captured data */ beaconEndpoint?: string; /** Debug mode */ debug?: boolean; /** * Enables persistence of session replay data when upload requests fail. * * When enabled, session replay chunks that fail to upload (due to network issues, * server errors, or browser issues) are automatically stored in local browser storage * and retried on subsequent page loads. * * This feature helps prevent data loss and ensures comprehensive session coverage * even in unreliable network conditions. The queue is automatically managed and * cleaned up after successful uploads. * * Storage: Currently the data is stored in localStorage. * @default true */ persistFailedReplayData?: boolean; /** * The name of your organization’s realm. Automatically configures beaconUrl with correct URL */ realm?: string; /** * RUM authorization token for data sending. Please make sure this is a token * with only RUM scope as it's visible to every user of your app **/ rumAccessToken?: string; /** * Optional session sampler instance to control which sessions get recorded. * Use SplunkRum.SessionBasedSampler to create one with a specific ratio. * @example * sampler: new SplunkRum.SessionBasedSampler({ ratio: 0.5 }) */ sampler?: InstanceType; } & RecorderPublicConfig; declare const SplunkRumRecorder: { _getProcessorForSession({ anonymousUserId, attributes, exportQueuedLogs, exportUrl, persistFailedReplayData, sessionId, }: { anonymousUserId?: string; attributes: Attributes; exportQueuedLogs: boolean; exportUrl: string; persistFailedReplayData: boolean; sessionId: string; }): BatchLogProcessor; deinit(): void; init(config: SplunkRumRecorderConfig): void; readonly inited: boolean; resume(): void; stop(): void; }; export default SplunkRumRecorder;