Session replay configuration reference
Replay options for the browser (canvas capture and masking, asset proxy, inline images) and the iOS, Android, React Native and Flutter SDKs.
Replay is off or opt-in everywhere, needs the replay consent category as well as analytics consent, and the project's privacy policy can only add masking, never remove it. The project-level policy is in Replay privacy.
Browser
Replay is the opt-in module @lucida-analytics/browser/replay; its options go in the replay key of init.
init("lc_pk_...", {
replay: {
sample_rate: 0.25,
captureCanvas: { fps: 2, quality: 0.4 },
assets: { inlineImages: true, proxy: { url: "/asset-proxy", origins: ["https://cdn.example.com"] } },
},
});Option | Default | Meaning |
|---|---|---|
| on |
|
| 1 | 0 to 1, decided once per session |
| 0, | Sessions shorter than this are never sent. |
| always |
|
| none | OR-ed rules with URL, event and flag conditions, sample rate and minimum duration; replace |
| all | Regex sources; exclude wins. Each is tested against the full URL and against the path with its query, so |
| none | Blocked (placeholder box) or text-masked, on top of |
| true | Only a local |
| false | Mask every text node and text attribute; |
| none | Extra masking on pages matching a URL pattern |
| none | Rewrite hooks. Password inputs are always masked |
| 60000 | Ring buffer kept before a trigger fires |
| 256 KB | When a chunk is sent |
| 300000 | No person-driven event for this long and recording drops everything until the next interaction; 0 turns it off |
| burst 100, 10 per second per element | Guard against runaway attribute mutations; |
| off |
|
| off | Hand the replay link to Intercom, Crisp or Chatly while recording. Local config only |
Canvas capture and masking
Off unless you set captureCanvas or the project turns on replay_capture_canvas; captureCanvas: false refuses the project's toggle.
captureCanvas: { fps, quality }: frames per second per canvas (default 2, 1 to 15) and JPEG quality (default 0.4, 0.05 to 1).Canvases inside
[data-lc-block]are never captured.canvasMaskRegions: (canvas) => [{x, y, width, height}]returns areas, in the canvas's own pixel space (not CSS pixels), that are painted black before a frame is encoded. A function that throws masks the whole canvas.The project can add
replay_canvas_maskrules{selector, regions?}in settings; a matching canvas gets those regions painted, or is blacked out entirely whenregionsis absent. Local config cannot remove them.
Assets: inline images, fonts and the proxy
replay.assets is opt-in and local config only.
Option | Meaning |
|---|---|
| Put same-origin or CORS-readable images into the recording as data URLs. Refused when |
| An inlined image larger than this (data URL characters, default 256 KB) is dropped; the element keeps its URL |
| Record web fonts loaded with the FontFace API |
|
|
The proxy endpoint is yours to run: it receives ?url= and returns the asset.
include_urls and exclude_urls on single-page apps
The URL rules are checked again every time the page URL changes, not only at page load. The recorder listens for the browser Navigation API's currententrychange event, or wraps history.pushState and replaceState when that API is missing, and also listens for popstate and hashchange. A one-second timer is a backstop.
Moving to an excluded URL. Recording stops at once when the change is seen (in the same call for
pushStateandreplaceState), the recorder's in-memory buffer is dropped and what was already chunked is flushed. Nothing is recorded while the URL stays excluded, and the session status showsexcluded.Moving back to an allowed URL. Recording starts again with a fresh full snapshot.
Limit. The recorder learns of a route change when the URL changes. If your router renders the new page before it changes the URL, those changes are recorded as part of the previous page. We have not measured this ordering for any router. Mask or block the sensitive elements as well when the page content matters.
iOS (Swift)
Set cfg.replay (type ReplayConfig) on the LucidaConfig before starting. Off by default.
Option | Default |
|---|---|
| false |
|
|
| 0.4 |
| 5 seconds; a snapshot is sent only when the structure changed |
| all true. |
| 1.0 |
| 0 |
| true (kill switch, sample rate and minimum duration from |
| none: record only while this flag is on |
| empty; deny wins |
| none: screen-name patterns ( |
| none: regular expressions starred in any text, plus the project's list |
| true: tap and swipe positions, never what was typed |
| true: |
| 10 MiB for chunks waiting offline |
In SwiftUI mark views with .lucidaMask() (never shown; wins) or .lucidaUnmask(). In UIKit set accessibilityIdentifier to lucida-unmask to show a view.
Android (Kotlin)
ReplayConfig(...) on the config (replay = ReplayConfig(); null means no replay). Options include maskAllText, maskAllTextInputs, maskAllImages, maskSandboxedViews, sampleRate, throttleMs, maskScreens, maskTextPatterns and captureDeadSwipes. Password inputs are never captured. Tag a view lc-block (empty box), lc-ignore (omitted), lc-mask (masked even when the global switch is off) or lc-unmask. Start and stop with lucida.replay.start() and stop().
React Native
createClient("lc_pk_...", { replay: { enabled: true, module: NativeModules.LucidaReplay } }). The module is a native bridge that calls the iOS and Android wireframe encoders. The two native bridge files in sdks/react-native are not compiled or tested in the Lucida repository (no React Native toolchain there). Verify them in a real app before you ship.
Options: snapshotIntervalMs (5000), maskText, maskAllTextInputs, maskAllImages, maskSandboxedViews (all true), mode (wireframe or screenshot), screenshotQuality (0.4), sampleRate (1), throttleMs, minDurationMs, spoolBudgetBytes (10 MiB), useRemoteConfig (true), linkedFlag, screenAllowList, screenDenyList, captureTouches, maskScreens, maskTextPatterns, captureDeadSwipes. Wrap views in <LucidaMask> or <LucidaUnmask>, and the app in <LucidaTouchCapture> to record taps and swipes. Set the screen name with client.screen; client.replay has start, stop, pause, resume and isRecording.
Flutter
final replay = ReplayRecorder(lucida.core, FlutterWidgetTree())..start(); // package lucida_flutter
MaterialApp(navigatorObservers: [LucidaScreenObserver(lucida, replay: replay)]);
lucida.core.consent.set({'replay': true});ReplayRecorder options: snapshotInterval (5 s), maskTextContent, maskAllTextInputs, maskAllImages (true), sampleRate, minDurationMs, useRemoteConfig, linkedFlag, screenAllowList, screenDenyList, captureTouches, maskScreens, maskTextPatterns, captureDeadSwipes, spoolBudgetBytes. Wrap widgets in LucidaMask, LucidaUnmask or LucidaSensitive (text is never recorded). For screenshot mode wrap the app in LucidaReplayBoundary and pass screenshots: FlutterScreenshots(); platform views come out blank. FlutterWidgetTree is not compiled or tested in the Lucida repository (Flutter is not installed on the build host). Treat it as a reference implementation and verify it on a device.
Controlled exposure
All four mobile SDKs can capture a listed field encrypted, for audited reveal only. See Replay privacy.