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.

Embed
Preview of the card
<a href="https://lucidace.com/help/replay-config-reference"><img src="https://lucidace.com/help/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/2f4b888b-c4e6-488b-81bd-6e838fb12d2e/pages/fe42267f-1b31-4261-9222-f35d6c0b8f68/social-card.svg?v=3e7ae33eec8b" alt="Session replay configuration reference" width="600" height="315"></a>

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

enabled

on

false switches the module off

sample_rate

1

0 to 1, decided once per session

min_duration_ms, min_duration_mode

0, buffer

Sessions shorter than this are never sent. buffer: this page's recorded data must reach it; session: the session's age counts

trigger

always

{mode: "always"}, on_event (events), on_flag (flag), on_url (pattern) or on_frustration

trigger_groups

none

OR-ed rules with URL, event and flag conditions, sample rate and minimum duration; replace trigger and sample_rate when set

include_urls, exclude_urls

all

Regex sources; exclude wins. Each is tested against the full URL and against the path with its query, so ^/account matches https://example.com/account/billing

block_selectors, mask_selectors

none

Blocked (placeholder box) or text-masked, on top of [data-lc-block] and [data-lc-mask]

mask_all_inputs

true

Only a local false loosens it; remote config can only tighten

mask_all_text, unmask_selectors

false

Mask every text node and text attribute; unmask_selectors (and [data-lc-unmask]) stay readable

url_privacy_rules

none

Extra masking on pages matching a URL pattern

maskInputFn, maskTextFn, maskUrlFn, maskInputOptions

none

Rewrite hooks. Password inputs are always masked

buffer_ms

60000

Ring buffer kept before a trigger fires

chunk_bytes, flush_interval_ms

256 KB

When a chunk is sent

idle_threshold_ms

300000

No person-driven event for this long and recording drops everything until the next interaction; 0 turns it off

mutationThrottle

burst 100, 10 per second per element

Guard against runaway attribute mutations; false turns it off

crossOriginIframes

off

{allowedOrigins: [...]}; both the parent and the iframe must list the other's origin. Local config only

supportWidgets

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_mask rules {selector, regions?} in settings; a matching canvas gets those regions painted, or is blacked out entirely when regions is absent. Local config cannot remove them.

Assets: inline images, fonts and the proxy

replay.assets is opt-in and local config only.

Option

Meaning

inlineImages

Put same-origin or CORS-readable images into the recording as data URLs. Refused when mask_all_text is on

maxInlineBytes

An inlined image larger than this (data URL characters, default 256 KB) is dropped; the element keeps its URL

collectFonts

Record web fonts loaded with the FontFace API

proxy

{url, origins}: asset URLs (img, source and video src and srcset, poster, stylesheets, CSS url() including fonts) from the listed origins are rewritten to <url>?url=<encoded original> so the player loads CORS-blocked or expiring assets through your proxy. url must be on the page's own origin or the Lucida host; any other proxy is ignored

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 pushState and replaceState), 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 shows excluded.

  • 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

enabled

false

mode

.wireframe; .screenshot sends masked JPEG frames, masks painted on the device before encoding

screenshotQuality

0.4

snapshotInterval

5 seconds; a snapshot is sent only when the structure changed

maskText, maskAllTextInputs, maskAllImages, maskSandboxedViews

all true. WKWebView and MKMapView content cannot be read: only the frame is recorded. Secure fields are never read

sampleRate

1.0

minDurationMs

0

useRemoteConfig

true (kill switch, sample rate and minimum duration from GET /v1/config, tightening only)

linkedFlag

none: record only while this flag is on

screenAllowList, screenDenyList

empty; deny wins

maskScreens

none: screen-name patterns (* wildcard) that mask all text, inputs and images, plus the project's replay_mask_screens

maskTextPatterns

none: regular expressions starred in any text, plus the project's list

captureTouches

true: tap and swipe positions, never what was typed

captureDeadSwipes

true: $dead_swipe for a swipe of 48 pt or more that changed nothing

spoolBudgetBytes

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.

Updated