Sentry Session Replay: setup, privacy and cost
Sentry Session Replay records what a user saw and did before and after an error: a DOM recording on the web and masked screenshots on iOS, Android, React Native and Flutter. You turn it on with the replay integration and two sample rates: replaysSessionSampleRate records whole sessions, and replaysOnErrorSampleRate keeps a rolling buffer and uploads it only when an error happens. Text, inputs and images are masked by default, and as of November 2026 every plan includes 50 replays a month, with more billed from about $0.00375 each.
Steps
- Add the integrationAdd replayIntegration() (or mobileReplayIntegration() / the mobile options) to your Sentry init.
- Set both ratesUse 1.0 for both while testing, then lower the session rate and keep the error rate at 1.0.
- Check maskingWatch a few test replays and unmask only harmless elements; never turn masking off globally in apps with personal data.
- Watch usageCheck replay usage in Stats after a week and adjust the session rate to fit your budget.
Set up session replay on the web
Replay ships inside @sentry/browser and the framework SDKs (7.27.0 or newer). Add the integration and both rates to Sentry.init:
import * as Sentry from "@sentry/browser";
Sentry.init({
dsn: "https://<key>@o<orgId>.ingest.sentry.io/<projectId>",
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
integrations: [Sentry.replayIntegration()],
});| Option | What it does | Sentry's advice |
|---|---|---|
replaysSessionSampleRate | Share of sessions recorded and sent from the start (session mode) | 0.1 to start, 1.0 only while testing, lower in production |
replaysOnErrorSampleRate | Share of the remaining sessions that buffer the last 60 seconds in memory and upload only if an error is captured (buffer mode) | Keep at 1.0 |
When a buffered session hits an error that is sampled, Sentry uploads the 60 seconds before it and keeps recording from there like a normal session. A recording pauses after 5 minutes without a click, keypress or navigation, and the session ends after 15 minutes of inactivity or 60 minutes in total. You can start recording yourself with replay.start() or replay.startBuffering(), and skip specific errors with beforeErrorSampling. If you use a Content Security Policy, add worker-src 'self' blob:. Canvas is not recorded unless you add replayCanvasIntegration().
Mobile replay: iOS, Android, React Native, Flutter
On mobile the option names move, and the error buffer is up to 30 seconds instead of 60:
| SDK | Minimum | Options |
|---|---|---|
| iOS (Cocoa) | 8.31.1 | options.sessionReplay.sessionSampleRate, options.sessionReplay.onErrorSampleRate |
| Android | 7.12.0 | options.sessionReplay.sessionSampleRate, options.sessionReplay.onErrorSampleRate |
| React Native | 6.5.0 | replaysSessionSampleRate, replaysOnErrorSampleRate and Sentry.mobileReplayIntegration() |
| Flutter | 9.0.0 (web 10.3.0, experimental) | options.replay.sessionSampleRate, options.replay.onErrorSampleRate, root wrapped in SentryWidget |
SentrySDK.start { options in
options.dsn = "https://<key>@o<orgId>.ingest.sentry.io/<projectId>"
options.sessionReplay.onErrorSampleRate = 1.0
options.sessionReplay.sessionSampleRate = 0.1
}A mobile replay session starts when the SDK starts or the app comes to the foreground, keeps the same replay if the app returns within 30 seconds of going to the background, and ends after longer in the background or at 60 minutes. Setup guides: React Native and Flutter.
Privacy and masking defaults
On the web, three options default to true: maskAllText (every character becomes *), maskAllInputs, and blockAllMedia (img, svg, video, audio and similar become placeholders). Fine-tune with selectors or classes in your markup:
| Class / attribute | Effect |
|---|---|
sentry-mask / data-sentry-mask | Mask the element's text |
sentry-block / data-sentry-block | Replace the element with a same-size placeholder |
sentry-ignore / data-sentry-ignore | Don't record input events on the field |
The unmask and unblock options reveal selected elements again, but never override sensitive fields such as passwords. Request and response bodies are not captured unless you opt in. On mobile, text, images, webviews and user input are masked by default (maskAllText and maskAllImages; React Native adds maskAllVectors; Flutter masks text, input and non-asset images).
The mistake people make next is turning masking off globally because the replays are "all asterisks". Unmask the specific, harmless elements instead (a product title, a nav bar), and re-check masking after you upgrade your UI framework or OS SDK, as Sentry recommends for mobile.
What session replay costs
As of November 2026 Developer (free), Team ($29 a month, or $26 billed annually) and Business ($89, or $80 annually) all include 50 replays a month. Beyond that, pay-as-you-go replay rates are the same on Team and Business:
| Replays per month | PAYG per replay |
|---|---|
| >50–5k | $0.00375 |
| >5k–100k | $0.003563 |
| >100k–900k | $0.003206 |
| >900k–4.5M | $0.002886 |
| >4.5M | $0.002453 |
Worked example: 100,000 sessions a month at replaysSessionSampleRate: 0.1 is about 10,000 replays, roughly $35 to $36 a month in PAYG on top of the plan, plus error replays from the other 90% of sessions. Only accepted replays count toward the quota; the usage stats on Sentry's Stats page show which projects use the most. Most teams set the session rate low (or to 0) and keep the error rate at 1.0, because error replays are the ones you open. Plan details: Sentry pricing.
How replays link to errors
An error captured while a replay is running is linked to it. On the issue details page, events with a replay show a replay preview, from which you can open the other replays recorded for that issue. Inside a replay, the Errors tab lists errors that happened during it, including backend errors, with links to their issues; the Console, Network, Trace and Tags tabs sit beside it. The full list lives under Explore > Replays. User Feedback submissions, rage clicks and dead clicks are linked to replays too; see Sentry user feedback.
Questions
Does Sentry Session Replay record video?
No. On the web it records DOM changes and rebuilds the page; on mobile it captures screenshots with sensitive content masked. Both play back as a video-like timeline in Sentry.
Why are my replays only asterisks and grey boxes?
That is the default privacy setting: maskAllText, maskAllInputs and blockAllMedia are on. Unmask specific safe elements with the unmask and unblock options.
How do I only record sessions that have an error?
Set replaysSessionSampleRate to 0 and replaysOnErrorSampleRate to 1.0. The SDK buffers the last 60 seconds on the web (30 on mobile) and uploads only when an error is captured.
Sources
- Set Up Session Replaydocs.sentry.io
- Privacydocs.sentry.io
- Set Up Session Replay (iOS)docs.sentry.io
- Pricing & Billingdocs.sentry.io