# Amplitude Documentation — Session Replay # Generated: 2026-09-08T23:40:00Z # Pages included: 28 of 28 # Source: https://amplitude.com/docs/llms.txt # Product feed: llms-session-replay.txt > Session Replay setup, privacy, playback, and platform SDK plugins. > For AI agents: a documentation index is available at [/docs/llms.txt](/docs/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`. ================================================================================ # Session Replay URL: https://amplitude.com/docs/session-replay ================================================================================ # Session Replay Session Replay records the rendered DOM of a user's web or mobile session and plays it back as video, synced with that user's event stream in Amplitude. Open a replay from a chart, the homepage, or User Look-Up to watch what a user clicked, typed, and saw at each event, including console errors, network failures, rage clicks, and dead clicks captured during the session. Use Session Replay when a chart shows a drop-off or anomaly and you need the qualitative behavior behind it. For pure quantitative breakdowns of where users drop off, use [Funnel Analysis](https://amplitude.com/docs/analytics/charts/funnel-analysis/funnel-analysis-build) or [Journeys](https://amplitude.com/docs/analytics/charts/journeys/journeys-understand-paths) instead. **Outcome:** [Instrument Session Replay](https://amplitude.com/docs/session-replay/instrument-session-replay) Pair your metrics with a video of what users actually did. **Outcome:** [Find the session behind the metric](https://amplitude.com/docs/session-replay/session-replay-viewer) Go from a chart, funnel, or support ticket to the exact session. **Outcome:** [See where users click and scroll](https://amplitude.com/docs/heatmaps) Understand which parts of a page get attention and which get ignored. **Outcome:** [Spot friction users don't report](https://amplitude.com/docs/session-replay/overview#frustration-analytics) Catch rage clicks, dead clicks, and errors across sessions. **Outcome:** [Protect customer privacy](https://amplitude.com/docs/session-replay/manage-privacy-settings-for-session-replay) Mask sensitive content, honor consent, and control what gets captured. **Outcome:** [Capture the sessions that matter](https://amplitude.com/docs/session-replay/targeted-replay-capture) Focus replays on specific users, pages, and flows. ## Instrument Session Replay Session Replay requires instrumentation beyond standard Amplitude instrumentation. Start with the [SDK catalog](https://amplitude.com/docs/session-replay/instrument-session-replay), or jump to the implementation guide for your platform. - [Browser SDK plugin](https://amplitude.com/docs/sdks/session-replay/session-replay-plugin) for teams that already use the Amplitude Browser SDK. - [Browser standalone SDK](https://amplitude.com/docs/sdks/session-replay/session-replay-standalone-sdk) for teams that need replay capture without the Browser SDK. - [iOS plugin](https://amplitude.com/docs/sdks/session-replay/session-replay-ios-plugin) or [iOS standalone SDK](https://amplitude.com/docs/sdks/session-replay/session-replay-ios-standalone-sdk). - [Android plugin](https://amplitude.com/docs/sdks/session-replay/session-replay-android-plugin) or [Android standalone SDK](https://amplitude.com/docs/sdks/session-replay/session-replay-android-standalone). - [React Native plugin](https://amplitude.com/docs/sdks/session-replay/session-replay-react-native-sdk-plugin) or [React Native standalone SDK](https://amplitude.com/docs/sdks/session-replay/session-replay-react-native-standalone-sdk). - [Google Tag Manager](https://amplitude.com/docs/sdks/session-replay/session-replay-google-tag-manager), [Segment](https://amplitude.com/docs/sdks/session-replay/session-replay-integration-with-segment), and [RudderStack](https://amplitude.com/docs/sdks/session-replay/session-replay-rudderstack-integration) integrations. ## View and analyze replays Use replays to understand the exact user sessions behind charts, support tickets, and homepage activity. Pair playback with analysis tools that surface patterns across many sessions. - [View and search replays](https://amplitude.com/docs/session-replay/session-replay-viewer) from charts, User Look-Up, your homepage, or the replay search page. - [Create heatmaps](https://amplitude.com/docs/heatmaps) to analyze click, selector, and scroll behavior. - [Use zoning](https://amplitude.com/docs/zoning-insights) to group related page elements for heatmap analysis. - [Filter replays by sentiment](https://amplitude.com/docs/session-replay/filter-replays-by-sentiment) to focus on feedback signals. - [Bookmark session replays](https://amplitude.com/docs/session-replay/bookmarkable-session-replays) to keep important sessions beyond the standard retention period. ## Privacy and operations Session Replay includes privacy controls for masking, user consent, and user-generated content. Configure these controls before you capture production traffic. - [Manage privacy settings](https://amplitude.com/docs/session-replay/manage-privacy-settings-for-session-replay) for masking levels and overrides. - [Apply consent management best practices](https://amplitude.com/docs/session-replay/best-practices-for-managing-user-consent) before you capture replay data. - [Create user-generated content filter rules](https://amplitude.com/docs/session-replay/ugc-filter-rules) to prevent sensitive content capture. - [Monitor replay ingestion](https://amplitude.com/docs/session-replay/ingestion-monitor) to track capture volume and ingestion health. - [Configure targeted replay capture](https://amplitude.com/docs/session-replay/targeted-replay-capture) to capture sessions that match specific events, properties, or page URLs. ### [Contextualize User Experience with Session Replay](https://academy.amplitude.com/contextualize-user-experience-with-session-replay) Learn new tools and strategies for governing and maintaining your Amplitude data for continued business value. ================================================================================ # Session Replay Browser SDK Plugin URL: https://amplitude.com/docs/sdks/session-replay/session-replay-plugin Updated: 2024-09-19 ================================================================================ # Session Replay Browser SDK Plugin - **Package:** `@amplitude/plugin-session-replay-browser` ([npm](https://www.npmjs.com/package/@amplitude/plugin-session-replay-browser)) - **Latest version:** 1.35.0 > **Note:** Session Replay instrumentation > > Session Replay isn't on by default, and requires setup beyond the standard Amplitude instrumentation. The Session Replay Browser SDK plugin adds session recording to a site already instrumented with Amplitude Browser SDK 2. If your site already uses Amplitude instrumentation, use this option. If you use a provider other than Amplitude for in-product analytics, choose the [standalone implementation](https://amplitude.com/docs/sdks/session-replay/session-replay-standalone-sdk). For more information about the Browser SDK, go to [Browser SDK 2](https://amplitude.com/docs/sdks/analytics/browser/browser-sdk-2). > **Info:** Session Replay and performance > > Session Replay minimizes impact on the performance of the web pages where you install it by: > > - Processing content asynchronously through webhooks for efficient compression and optimized bundle sizes. > - Batching requests and using lightweight compression to reduce network connections and bandwidth. > - Optimizing DOM processing. ### Bundle size The Session Replay plugin adds to your application's bundle size. For current bundle size information, check the [npm package page](https://www.npmjs.com/package/@amplitude/plugin-session-replay-browser) or [BundlePhobia](https://bundlephobia.com/package/@amplitude/plugin-session-replay-browser). ### Runtime performance Session Replay runs asynchronously and processes replay data in the background to avoid blocking the main thread. Performance characteristics include: - **DOM capture**: DOM snapshot capture typically adds less than 5ms of processing time for each page interaction. Initial page load snapshot capture may take 10-50ms depending on page complexity. - **Memory usage**: Session Replay stores replay events in memory or IndexedDB (configurable using `storeType`). Memory usage scales with session length and page complexity, typically ranging from 1-10 MB for each active session. - **CPU impact**: With default settings, Session Replay uses less than 2% of CPU time during normal operation. Session Replay defers compression operations to browser idle periods when `performanceConfig.enabled` is `true` (default). - **Network bandwidth**: Session Replay compresses replay data before upload, typically reducing payload size by 60-80%. Session Replay batches network requests and sends them asynchronously. ### Performance optimization To optimize Session Replay performance: - Enable `useWebWorker`, which moves compression off the main thread and reduces CPU impact. - Configure `performanceConfig.timeout` to control when deferred compression occurs. - Set `storeType` to `memory` if you don't need persistence across page reloads, which reduces IndexedDB overhead. For detailed performance testing results, go to the [Session Replay performance testing blog post](https://amplitude.com/blog/session-replay-performance-testing). Session Replay captures changes to a page's Document Object Model (DOM), including elements in the shadow DOM. Session Replay then replays these changes to build a video-like replay. For example, at the start of a session, Session Replay captures a full snapshot of the page's DOM. As the user interacts with the page, Session Replay captures each change to the DOM as a diff. When you watch the replay of a session, Session Replay applies each diff back to the original DOM in sequential order to construct the replay. Session replays have no maximum length. ## Before you begin The Session Replay Plugin requires that: 1. Your application is web-based. 2. You can provide a device ID to the SDK. 3. Your site uses the Browser 2.0 SDK. ### Supported browsers Session Replay supports the same set of browsers as Amplitude's SDKs. For more information, refer to [Browser Compatibility](https://amplitude.com/docs/get-started/browser-compatibility). Session Replay may not support all browser extensions or DOM elements that browser extensions introduce. Session Replay supports Shadow DOM, but exceptions may exist depending on the frameworks your site uses. ## Quickstart Install the plugin with npm or yarn. > **Info:** Unified SDK > > If you haven't installed the Browser SDK yet, consider using the [Browser Unified SDK](https://amplitude.com/docs/sdks/analytics/browser/browser-unified-sdk) instead. The Unified SDK provides a single entry point for all Amplitude features (Analytics, Session Replay, Experiment) and simplifies integration by handling initialization and configuration of all components. #### npm ```bash # If you already have Browser SDK installed, install the Session Replay Plugin npm install @amplitude/plugin-session-replay-browser --save # OR if you haven't installed Browser SDK yet, use the Unified SDK instead npm install @amplitude/unified ``` #### yarn ```bash # If you already have Browser SDK installed, install the Session Replay Plugin yarn add @amplitude/plugin-session-replay-browser # OR if you haven't installed Browser SDK yet, use the Unified SDK instead yarn add @amplitude/unified ``` Configure your application code. #### Plugin configuration ```js import * as amplitude from "@amplitude/analytics-browser"; import { sessionReplayPlugin } from "@amplitude/plugin-session-replay-browser"; // Create and Install Session Replay Plugin const sessionReplayTracking = sessionReplayPlugin(); amplitude.add(sessionReplayTracking); // Your existing initialization logic with Browser SDK amplitude.init(API_KEY); ``` #### Unified SDK ```js import { initAll } from "@amplitude/unified"; // Initialize Unified SDK with Session Replay configuration initAll("YOUR_API_KEY", { sessionReplay: { sampleRate: "", }, }); ``` You can also add the code directly to the `` of your site. With this method, make sure your application doesn't initialize the Browser SDK elsewhere. If you initialize the Browser SDK more than one time, you may experience mismatches in Device ID or Session ID. ```html ``` > **Info:** > > Session Replay instrumentation happens in the context of an Amplitude Project. Amplitude defines your replay quota at the Organization level. As a result, you can have multiple Session Replay implementations across multiple projects, each with its own sample rate, that pull from the same quota. > **Tip:** Compatibility with Google Tag Manager > > The Session Replay plugin scripts load asynchronously when you add them to the `` tag of your page. As a result, this implementation isn't compatible with Google Tag Manager. For more information, go to [Session Replay Implementation with Google Tag Manager](https://amplitude.com/docs/sdks/session-replay/session-replay-google-tag-manager). ## Configuration | Name | Type | Required | Default | Description | | --- | --- | --- | --- | --- | | `sampleRate` | `number` | No | `0` | Controls how many sessions to select for replay collection. The number is a decimal between 0 and 1, for example `0.4`, representing the fraction of sessions Amplitude randomly selects for replay collection. Over a large number of sessions, `0.4` selects `40%` of those sessions. This field isn't required because Session Replay supports [Remote Configuration](https://amplitude.com/docs/admin/account-management/account-settings#session-replay-settings) of settings including Sample Rate. | | `privacyConfig` | `object` | No | `undefined` | Supports advanced masking configurations with CSS selectors. | | `applyBackgroundColorToBlockedElements` | `boolean` | No | `false` | If true, applies a background color to blocked elements for visual masking. This helps you see which elements Session Replay blocks from capture. | | `debugMode` | `boolean` | No | `false` | Adds an additional debug event property to help debug instrumentation issues (such as mismatching apps). Recommended only for debugging initial setup, not for production. | | `serverZone` | `string` | No | `US` | EU or US. Sets the Amplitude server zone. Set this to EU for Amplitude projects in the EU data center. | | `configServerUrl` | `string` | No | `undefined` | The endpoint URL to fetch remote configuration. If provided, it overrides the default server zone configuration. | | `trackServerUrl` | `string` | No | `undefined` | The endpoint URL to send session replay data. If provided, Amplitude forwards requests from the SDK there instead of to the default Session Replay endpoint. | | `shouldInlineStylesheet` | `boolean` | No | `true` | If true, Session Replay stores the contents of inlined stylesheets. During replay, Session Replay uses the stored stylesheet instead of fetching it remotely. This prevents replays from appearing broken due to missing stylesheets. Inlining stylesheets may not work in all cases. If undefined, Session Replay inlines stylesheets. | | `storeType` | `string` | No | `idb` | How Session Replay stores replay events. `idb` uses IndexedDB to persist replay events when Session Replay can't send all events during capture. `memory` stores replay events only in memory, so events are lost when the page closes. If IndexedDB is unavailable, the system falls back to memory. | | `performanceConfig.enabled` | `boolean` | No | `true` | If enabled, Session Replay defers event compression to occur during the browser's idle periods. | | `performanceConfig.timeout` | `number` | No | `undefined` | Optional timeout in milliseconds for the requestIdleCallback API. If specified, this value sets a maximum time for the browser to wait before running the deferred compression task, even if the browser isn't idle. | | `useWebWorker` | `boolean` | No | `false` | Uses a web worker to compress replay events. This improves performance by moving compression off the main thread. | ### API endpoints Session Replay uses the following API endpoints: - **Data ingestion**: - US: `https://api-sr.amplitude.com/sessions/v2/track`. - EU: `https://api-sr.eu.amplitude.com/sessions/v2/track`. - Session Replay sends captured replay data to these endpoints. - **Remote configuration**: - US: `https://sr-client-cfg.amplitude.com/config`. - EU: `https://sr-client-cfg.eu.amplitude.com/config`. - Session Replay fetches remote configuration from these endpoints. If you set up a domain proxy, forward requests to these endpoints. You can override these defaults using the `trackServerUrl` and `configServerUrl` configuration options. ### Track default session events Session Replay enables session tracking by default. This ensures Session Replay captures Session Start and Session End events. If you didn't capture these events before you implement Session Replay, expect an increase in event volume. For more information about session tracking, go to [Browser SDK 2.0 | Tracking Sessions](https://amplitude.com/docs/sdks/analytics/browser/browser-sdk-2#track-sessions). #### SDK configuration Use the Browser SDK configuration to implicitly enable session tracking. ```js amplitude.init(API_KEY, USER, { autocapture: { sessions: true, }, }); ``` #### Plugin configuration Disable all default tracking by the Browser SDK. In this case, the plugin enables default session tracking. ```js amplitude.init(API_KEY, USER, { autocapture: false, }); ``` > **Info:** Session Start and Session End events > > Starting with plugin version 1.12.1, Session Replay no longer captures `Session Start` and `Session End` events by default. To enable capture of these events, set `forceSessionTracking: true`: > > ```js > const sessionReplayTracking = window.sessionReplay.plugin({ > forceSessionTracking: true, // Enable capture of Session Start and Session End events > sampleRate: 1, // 100% sample rate, should reduce for production traffic. > }); > ``` > > Amplitude requires at least one event in any captured session to enable playback of the replay. ### Mask on-screen data The Session Replay SDK offers three ways to mask user input, text, and other HTML elements. | Element | Description | | --- | --- | | `` | Session Replay masks all text input fields by default. When a users enters text into an input field, Session Replay captures asterisks in place of text. To _unmask_ a text input, add the class `.amp-unmask`. For example: ``. | | text | To mask text within non-input elements, add the class `.amp-mask`. For example, `

Text

`. When masked, Session Replay captures masked text as a series of asterisks. | | non-text elements | To block a non-text element, add the class `.amp-block`. For example, `
`. Session Replay replaces blocked elements with a placeholder of the same dimensions. | Session Replay supports setting a masking level on the [Session Replay Settings](https://amplitude.com/docs/session-replay/manage-privacy-settings-for-session-replay) screen in Amplitude. This includes Light, Medium, and Conservative settings. Session Replay settings also enable remote masking overrides. These enable users in your organization to configure or update masking after implementation. In the event of a conflict, Session Replay defers to the remote setting. For example: | | .selector-1 | .selector-2 | .selector-3 | | --- | --- | --- | --- | | Local setting | `mask` | -- | `mask` | | Remote setting | `unmask` | `unmask` | -- | | Result | `unmask` | `unmask` | `mask` | In this example, `.selector-1` has a local setting and a remote setting. The result follows the remote setting, and overrides the setting in the SDK or plugin implementation. Specify elements to block or mask in the `privacyConfig` object during configuration. ```js // This configuration blocks .no-track and #ads, sets the default mask level, // and defines the mask and unmask selectors. await sessionReplay.init(AMPLITUDE_API_KEY, { privacyConfig: { blockSelector: ['.no-track', '#ads'], defaultMaskLevel: 'medium', maskSelector: ['.sensitive-data', '.user-email'], unmaskSelector: ['.public-info', '#main-content'] } }).promise; ``` #### CSS selectors Session Replay's configuration supports many types of [CSS Selector](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors). Specify an element tag (`h1` or `textarea`), a class name (`.hidden`) or a data attribute. Data attributes may be useful if your class names change often due to hashing. To use data attributes, add a custom attribute like `data-amp-unmask` or `data-amp-mask` to any HTML element. For example, ``, then enclose the attribute in square brackets when you specify the selector, `[data-amp-unmask]`. > **Note:** Remote configuration > > If remote configuration is enabled, and fails to load, Session Replay doesn't capture any sessions. This ensures that Amplitude respects any privacy settings you define in the Admin interface, and you don't accidentally capture sensitive data. ### User opt-out The Session Replay plugin follows the Browser SDK's `optOut` setting and doesn't support user opt-outs on its own. ### Content Security Policy (CSP) If your web application uses a strict Content Security Policy, add the following directives. #### Required CSP directives ```text script-src: https://cdn.amplitude.com; connect-src: https://api-secure.amplitude.com; worker-src: blob:; ``` #### CSP directives reference | Directive | Domain | Required | Description | | --- | --- | --- | --- | | `script-src` | `https://cdn.amplitude.com` | Yes, if using CDN | Allows the Session Replay plugin and Browser SDK to load from Amplitude's CDN. | | `connect-src` | `https://api-secure.amplitude.com` | Yes (US) | Allows the SDK to send replay data to Amplitude's US servers. | | `connect-src` | `https://api.eu.amplitude.com` | Yes (EU) | Allows the SDK to send replay data to Amplitude's EU servers. Required if you set `serverZone: "EU"`. | | `worker-src` | `blob:` | Yes, if using web workers | Required if you enable the `useWebWorker` option for replay event compression. | #### API endpoints Session Replay sends data to the following endpoints: | Region | Endpoint | Purpose | | --- | --- | --- | | US (default) | `https://api-secure.amplitude.com/sessions/track` | Replay data ingestion. | | EU | `https://api.eu.amplitude.com/sessions/track` | Replay data ingestion for EU data residency. | | US (default) | `https://api-secure.amplitude.com/sessions/config` | Remote configuration (sample rate settings). | | EU | `https://api.eu.amplitude.com/sessions/config` | Remote configuration for EU data residency. | #### Example CSP header For the US region: ```text Content-Security-Policy: script-src 'self' https://cdn.amplitude.com; connect-src 'self' https://api-secure.amplitude.com; worker-src 'self' blob:; ``` For EU data center: ```text Content-Security-Policy: script-src 'self' https://cdn.amplitude.com; connect-src 'self' https://api.eu.amplitude.com; worker-src 'self' blob:; ``` > **Tip:** > > If you use the `configServerUrl` or `trackServerUrl` configuration options to specify custom endpoints, add those domains to your `connect-src` directive instead. ### EU data residency Session Replay is available to Amplitude customers who use the EU data center. Set the `serverZone` configuration option to `EU` during initialization. For example: ```js // For European users, set the serverZone to "EU" await sessionReplay.init(AMPLITUDE_API_KEY, { serverZone: "EU", // [tl! ~~] }).promise; ``` ### Sampling rate By default, Session Replay captures 0% of sessions for replay. If you used Amplitude's new account snippet to instrument, sample rate defaults to `1` (100% of sessions) for easier testing. Update the sample rate from the [Session Replay settings page](https://amplitude.com/docs/admin/account-management/account-settings#session-replay-settings) or use the `sampleRate` configuration option to set the percentage of total sessions that Session Replay captures. For example: ```js // This configuration samples 1% of all sessions await sessionReplay.init(AMPLITUDE_API_KEY, { sampleRate: 0.01, }).promise; ``` To set the `sampleRate`, consider the monthly quota on your Session Replay plan. For example, if your monthly quota is 2,500,000 sessions and you average 3,000,000 monthly sessions, your quota is 83% of your average sessions. In this case, to make sampling last through the month, set `sampleRate` to `.83` or lower. Note the following as you consider your sample rate: - When you reach your monthly session quota, Amplitude stops capturing sessions for replay. - Session quotas reset on the first of every month. - Use sample rate to distribute your session quota over the course of a month, rather than using your full quota at the beginning of the month. - To find the best sample rate, Amplitude recommends that you start low, for example `.01`. If this value doesn't capture enough replays, raise the rate over a few days. For ways to monitor the number of session replays captured, refer to [View the number of captured sessions](https://amplitude.com/docs/session-replay). Session Replay supports remote sampling rate settings. This lets users in your organization configure or update the sampling rate of your project after implementation, without a code change. If a conflict occurs, Session Replay defaults to the remote setting. For more information, refer to [Account Settings](https://amplitude.com/docs/admin/account-management/account-settings#session-replay-settings). ### Disable replay collection After you enable Session Replay, it runs on your site until either: - The user leaves your site. - You call `amplitude.remove(sessionReplayTracking.name)`. > **Note:** > > These examples assume you use the variable `sessionReplayTracking` in your initialization code. Call `amplitude.remove('sessionReplayTracking')` before a user navigates to a restricted area of your site to disable replay collection while the user is in that area. To restart replay collection, call `amplitude.add(sessionReplayTracking)` to re-add the plugin. > **Note:** > > `amplitude.add()` takes an object of type `Plugin` as a parameter, and `amplitude.remove()` takes a string as a parameter, which is the name of the plugin you want to remove. > **Note:** > > Always wait for `amplitude.add()` to finish before you call `amplitude.remove()`. If you don't, you may get an error in the console: `TypeError: Cannot read properties of undefined (reading 'teardown')`. Use the `promise` property to do this, as shown in either of these examples: > > ```js > await amplitude.add(sessionReplayTracking).promise; > await amplitude.remove(sessionReplayTracking.name).promise; > ``` > > ```js > const addPromise = amplitude.add(sessionReplayTracking).promise; > addPromise.then(() => { > amplitude.remove(sessionReplayTracking.name).promise; > }); > ``` You can also use a feature flag product like Amplitude Experiment to create logic that enables or disables replay collection based on criteria like location. For example, create a feature flag that targets a specific user group, and add it to your initialization logic: ```js import { sessionReplayPlugin } from "@amplitude/plugin-session-replay-browser"; // Your existing initialization logic with Browser SDK amplitude.init(API_KEY); if (nonEUCountryFlagEnabled) { // Create and Install Session Replay Plugin const sessionReplayTracking = sessionReplayPlugin({ sampleRate: 0.5, }); amplitude.add(sessionReplayTracking); } ``` ## Data retention Session replay uses existing Amplitude tools and APIs to handle privacy and deletion requests. > **Note:** Consent management and Session Replay > > While privacy laws and regulations vary across states and countries, certain constants exist, including the requirements to disclose in a privacy notice the categories of personal information you are collecting, the purposes for its use, and the categories of third parties with which personal information is shared. When implementing a session replay tool, you should review your privacy notice to make sure your disclosures remain accurate and complete. And as a best practice, review your notice with legal counsel to make sure it complies with the constantly evolving privacy laws and requirements applicable to your business and personal information data practices. ### Retention period If your Amplitude plan includes Session Replay, Amplitude retains raw replay data for 30 days from the date of ingestion. Purchase extra retention time, up to a maximum of 12 months. For more information, contact [Amplitude Support](https://support.amplitude.com). If you purchase extra session volume, Amplitude retains raw replay data for up to 12 months from the date of ingestion. If you need a more strict policy, contact Amplitude support to set the value to 30 days. Changes to the retention period impact replays ingested after the change. Sessions captured and ingested before a retention period change retain the previous retention period. Replays that are outside of the retention period aren't viewable in Amplitude. ### DSAR API The Amplitude DSAR API returns metadata about session replays, but not the raw replay data. Amplitude creates the \[Amplitude\] Replay Captured event automatically when Session Replay captures a replay. This event includes the \[Amplitude\] Session Replay ID property, which provides information about the replays collected for the user. The session replay ID has the format `/`. If you use [custom session definitions](https://amplitude.com/docs/session-replay/session-matching#requirements-for-custom-session-definitions), the custom session ID value can't contain `/` and must use accepted characters: `a-z A-Z 0-9 _ - . | @ : =`. If you need an additional character, contact [Amplitude support](https://gethelp.amplitude.com/hc/en-us/requests/new). ```json { "amplitude_id": 123456789, "app": 12345, "event_time": "2020-02-15 01:00:00.123456", "event_type": "first_event", "server_upload_time": "2020-02-18 01:00:00.234567", "device_id": "your device id", "user_properties": { ... }, "event_properties": { "[Amplitude] Session Replay ID": "cb6ade06-cbdf-4e0c-8156-32c2863379d6/1699922971244" }, "session_id": 1699922971244, } ``` ### Data deletion Session Replay uses Amplitude's [User Privacy API](https://amplitude.com/docs/apis/analytics/user-privacy/) to handle deletion requests. Successful deletion requests remove all session replays for the specified user. When you delete the Amplitude project on which you use Session Replay, Amplitude deletes that replay data. ### Bot filter Session Replay uses the same [block filter](https://amplitude.com/docs/data/block-bot-traffic) that the Amplitude app provides. Session Replay doesn't block traffic based on event or user properties. ## Session Replay storage Session Replay doesn't set cookies on the user's browser. Instead, it relies on a browser storage option called [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) by default. This option enables continuous replay collection during a session in which the user navigates browser tabs or closes and reopens a tab. The SDK cleans up the data it stores in IndexedDB and shouldn't impact the user's disk space. If the environment doesn't support IndexedDB, Session Replay falls back to an in-memory storage option. In-memory storage is less durable and data is lost when the user closes their browser window. Set the config option `storeType` to `'memory'` to force in-memory storage. If a user opts out of all cookies on your site, use the `optOut` configuration option to disable replay collection for that user. ### IndexedDB best practices To ensure that IndexedDB is initialized and working properly: - Review CSP headers to ensure they're not overly restrictive. Ensure `default-src` and `script-src` directives allow necessary sources. - Perform IndexedDB operations within the same origin. Cross-origin restrictions can block IndexedDB operations. - Confirm that users use a modern browser that supports IndexedDB. Amplitude recommends the latest versions of Chrome, Firefox, Safari, Edge, or Opera. ### Cookies Session Replay doesn't use cookies directly, and has no impact on cookie size. [Browser SDK](https://amplitude.com/docs/sdks/analytics/browser/browser-sdk-2) uses cookies for session management. ## Known limitations Note the following limitations as you implement Session Replay: - Session Replay doesn't stitch together replays from a single user across multiple projects. For example: - You instrument your marketing site and web application as separate Amplitude projects with Session Replay enabled in each. - A known user begins on the marketing site and logs in to the web application. - Amplitude captures both sessions. - The replay for each session is available to view in the host project. - Session Replay can't capture the following HTML elements: - Canvas. - WebGL. - `object` tags including plugins like Flash, Silverlight, or Java. Session replay supports `object type="image"`. - Lottie animations. - Cross-origin `