Recording modes
The replay system operates in three modes:Trigger events
Replay transitions from BUFFER to RECORDING when one of these events occurs:- Error — an unhandled JavaScript error or
console.errorcall - Widget open — the user opens the chat widget
Enabling replay
Session replay is controlled from the dashboard under Settings → Widget → Features. When enabled, the SDK automatically starts recording in buffer mode on initialization. No code changes are needed — the SDK reads thesessionReplay flag from your widget configuration.
Data handling
- Batches are gzipped using the browser’s native
CompressionStreamAPI before upload - Uploads use widget JWT authentication (obtained during the widget auth handshake)
- Batches include a sequence number for ordered playback
- If the upload quota is exceeded (HTTP 402/429), recording stops automatically
Privacy & masking
The SDK applies these privacy defaults:Masking specific elements
Adddata-hb-mask to mask text content:
data-hb-block to exclude an element entirely:
GDPR opt-out
CalldisableReplay() to permanently stop session replay for the current user:
destroy() + init() is called again).
Use this to honor user privacy preferences or implement a “Do not record” toggle in your application.
