Skip to content

Overview ​

replayIntegration records what the user sees — DOM changes, mouse movement, scrolling, input — with rrweb, so you can watch the session leading up to an error instead of reconstructing it from logs. Every event sent from the page is tagged with the replay.id context, which links an issue to its replay on the dashboard.

A session is recorded in one of two modes:

  • Full session — with probability sessionSampleRate, the whole session is uploaded from the start, in segments every flushInterval ms.
  • On error — every other session is only buffered in memory, keeping the last checkoutEveryNms ms or so. When an exception is captured, with probability onErrorSampleRate the buffer is uploaded and recording continues from there on. Sessions without errors never leave the browser.

Usage ​

ts
import { use } from '@buglapse/browser'
import { replayIntegration } from '@buglapse/browser/integrations'

use(replayIntegration({
    sessionSampleRate: 0.1,
    onErrorSampleRate: 1,
}))

Privacy ​

All <input> values are masked by default (maskAllInputs). To hide more of the page, add a class to the elements themselves:

html
<div class="buglapse-block">Not recorded at all — shown as an empty placeholder</div>
<p class="buglapse-mask">Text is recorded as asterisks</p>

Options ​

OptionTypeDefaultDescription
sessionSampleRatenumber0.1Share of sessions (0–1) recorded from the start
onErrorSampleRatenumber1Chance (0–1) that an exception starts uploading a buffered session
flushIntervalnumber5000How often, in ms, a recording session uploads a segment
maxSegmentEventsnumber300Upload a segment early once it holds this many rrweb events
checkoutEveryNmsnumber30000How often, in ms, a full DOM snapshot is taken; also bounds how far back an on-error replay reaches
maskAllInputsbooleantrueMask the values of all form inputs
blockClassstring'buglapse-block'Class that excludes an element from the recording
maskTextClassstring'buglapse-mask'Class that masks an element's text
recordCanvasbooleantrueRecord <canvas> content; without it canvases replay blank
canvasFpsnumber4Frame rate canvas content is captured at

rrweb is a sizeable dependency — import replayIntegration only in apps where you actually use it.