Session Replay
Record DOM sessions with rrweb
Session replay records DOM mutations and user interactions using rrweb. Recordings are serialized events, not video.
Enable Replay
Import and add the session replay extension.
import { sessionReplay } from "@faststats/react/replay";
<Analytics siteKey="your_site_key" extensions={[sessionReplay()]} />;faststats: {
siteKey: "your_site_key",
extensions: { sessionReplay: true },
}import { init } from "@faststats/web";
import { sessionReplay } from "@faststats/web/replay";
init({
siteKey: "your_site_key",
extensions: [sessionReplay()],
});Batching
Replay events are buffered in the browser and uploaded in chunks. The defaults prefer fewer, larger chunks so a normal one-minute replay should usually create single-digit storage objects instead of dozens.
sessionReplay({
flushInterval: 15_000,
maxEvents: 1000,
maxBatchSizeBytes: 900 * 1024,
});The collector coalesces these small reliable browser flushes into fewer storage objects. The recorder still flushes early on page hide, session rotation, periodic full snapshots, and when a batch reaches the byte limit.
Privacy and Masking
The recorder masks inputs by default and accepts selectors and classes directly
in the sessionReplay options.
init({
siteKey: "your_site_key",
extensions: [
sessionReplay({
maskAllInputs: true,
maskTextSelector: ".sensitive",
blockSelector: ".no-record",
}),
],
});| Option | Type | Description |
|---|---|---|
maskAllInputs | boolean | Masks the value of every input field |
maskTextSelector | string | Masks text inside elements matching this selector |
maskTextClass | string | Masks text inside elements with this class |
blockSelector | string | Skips recording elements matching this selector |
blockClass | string | Skips recording elements with this class |
recordConsole | boolean | Records console output during the session |
Any element you mark with the block selector is replaced with a placeholder, so its content never leaves the browser.
Cookieless Behavior
Replay follows your consent setup. In anonymous, forced cookieless, or denied mode the recorder stops and clears buffered events, so nothing is recorded until consent is granted with stored identifiers enabled. See Consent and Cookieless.