Replay console and network capture

Opt in to console output and network requests inside a session replay so developers can debug what a user saw. Off by default; credentials are always redacted.

Embed
Preview of the card
<a href="https://lucidace.com/help/replay-console-network"><img src="https://lucidace.com/help/_api/public/orgs/af34862a-c837-4478-8335-0505efe40459/spaces/2f4b888b-c4e6-488b-81bd-6e838fb12d2e/pages/d5d637f2-82d5-4217-9e45-770f8821744f/social-card.svg?v=3e7ae33eec8b" alt="Replay console and network capture" width="600" height="315"></a>

A replay can show the page's console output and its fetch/XHR requests next to the timeline. Both are off by default and configured in the browser SDK. They are context inside the recording, not analytics events and not error tracking: errors, traces and performance monitoring stay in Watchtower.

init("lc_pk_...", {
  apiHost,
  replay: {
    console: true, // log, info, warn, error, debug + uncaught errors and unhandled rejections
    network: {
      headers: false, // default false
      body: false, // default false
      deny: ["/health", /analytics\.example\.com/], // never recorded (string = substring)
      allow: ["/api/"], // when set, only matching URLs are recorded
      redact: (req) => (req.url.includes("/admin") ? null : req), // last look; return null to drop
    },
  },
});

network: false (the default) records no requests.

What is recorded

  • Console: the level and the arguments as text (cycles and DOM nodes are summarised, each argument is cut at 1 000 characters, at most 1 000 entries per recording). Uncaught errors and unhandled promise rejections appear as error entries.

  • Network: URL (with your urlPrivacy rules applied), method, status (0 when no response arrived), start, duration and size. Headers and bodies only when headers / body are true; bodies are cut at 4 KB.

Always redacted

  • Headers Authorization, Proxy-Authorization, Cookie, Set-Cookie, X-Api-Key, X-Auth-Token, X-CSRF-Token.

  • JSON and form fields whose name looks like a password, secret, token, API key, card number, CVV or SSN.

  • Binary bodies (files, blobs) are never stored.

  • The SDK's own requests to <apiHost>/v1/ are never recorded.

Console text is withheld (the level is kept) on pages with text masking (mask_all_text or a URL privacy rule that masks all text). Nothing is recorded while recording is paused, on excluded URLs, or without consent.

In the player and the list

The player adds a Console and network panel. Click a row to seek to it; filter console by level and requests by status class (2xx, 3xx, 4xx, 5xx, failed). A request opens a detail view, which shows headers and bodies only if they were captured.

The replay list has Has console error and Has 5xx request filters (has_console_error, has_network_5xx in POST /v1/projects/{id}/replays/search). Rows carry console_error_count, network_error_count, has_console_error and has_network_5xx. Recordings made before you turned the options on have no counts and match "No".

Updated