Overview
Proliferate’s session replay uses rrweb to record DOM snapshots and incremental changes. Unlike traditional screen recording, this approach:- Captures DOM state rather than pixels, allowing text selection and inspection
- Uses minimal bandwidth by only recording changes, not full frames
- Preserves privacy with built-in input masking
The Ring Buffer Architecture
Session replay uses a ring buffer that keeps only the most recent activity. This design has key advantages:- Memory efficient: Old events are automatically discarded
- Bandwidth efficient: Replay is only sent when an error occurs
- Privacy-first: No continuous data transmission
Buffer Limits
The replay buffer has three configurable limits:| Limit | Default | Description |
|---|---|---|
maxBufferMinutes | 5 | Maximum time span of recorded events |
maxBufferEvents | 10,000 | Maximum number of events |
maxBufferBytes | 5 MB | Maximum buffer size in bytes |
When any limit is reached, the oldest events are evicted to make room for new ones.
What Gets Recorded
DOM Snapshots
A full snapshot captures the entire DOM state at a point in time. This serves as the baseline for playback. Full snapshots are taken:- When recording starts
- After long idle periods
- When visibility changes (tab focus)
Incremental Changes
Between snapshots, incremental events record changes:- DOM mutations: Element additions, removals, text changes
- Style changes: CSS property updates
- Attribute changes: Class, id, data attributes
User Interactions
User activity is captured for accurate playback:- Mouse movements: Position updates for cursor rendering
- Mouse clicks: Click events with target element
- Scroll events: Scroll position changes
- Input changes: Form field updates (masked by default)
- Touch events: Mobile touch interactions
Session and Window IDs
Proliferate tracks sessions across page loads and tabs:- Persisted in
sessionStorage - Survives page reloads
- Expires after 30 minutes of inactivity
- Used to correlate all events in a user session
- Unique per browser tab
- Allows multi-tab replay correlation
- Generated fresh for each tab
When Replay is Sent
- Error is captured (
captureExceptionor automatic) - SDK retrieves buffered replay events
- Replay is associated with the error’s
event_id - Data is sent to the backend
Idle Detection
To save resources, recording pauses when the user is idle:- Activity tracking: Mouse, keyboard, touch, scroll events reset the idle timer
- Idle timeout: After 5 minutes of inactivity, incremental recording pauses
- Full snapshots preserved: Even during idle, full snapshots are captured on visibility changes
- Resume on activity: Recording resumes immediately when user becomes active
Mutation Throttling
To prevent performance issues from rapid DOM changes (e.g., animations, live data):- Token bucket algorithm: Limits mutations per element
- Throttled elements tracked: When an element exceeds its mutation budget, further changes are dropped
- Periodic reset: Throttling state resets periodically and on full snapshots
Playback in the Dashboard
When viewing an error with replay:- Timeline scrubbing: Navigate through the recording
- Speed control: Play at 1x, 2x, or 4x speed
- Event markers: See clicks, navigation, and console events on the timeline
- Error highlight: Error occurrence is marked on the timeline
- DOM inspection: Click elements to see their properties
Performance Considerations
Session replay is designed for minimal impact:| Aspect | Impact |
|---|---|
| Memory | 1-5 MB for buffer |
| CPU | < 1% during active recording |
| Bundle size | ~50 KB (lazy loaded) |
rrweb is dynamically imported, so it’s not included in your main bundle. Recording pauses when the tab is hidden or user is idle.

