Developer pages

Replay privacy

redactionStrategy modes, selectors, password protection, canvas, and verification.

Why this matters

Replays reconstruct on-screen UI from rrweb snapshots. Without redaction, typed values and sensitive labels can be stored and played back.

Configure at init

HumanBehaviorTracker.init(apiKey, {
  redactionStrategy: {
    mode: "privacy-first", // default
    unredactFields: ['input[name="email"]', "#public-search"],
  },
});

Or start open and mask selectively:

HumanBehaviorTracker.init(apiKey, {
  redactionStrategy: {
    mode: "visibility-first",
    redactFields: ['input[name="ssn"]', "[data-hb-redact=\"true\"]"],
  },
});

Modes

ModeDefault input behaviorSelector lists
privacy-first (default)maskAllInputs: true — inputs masked; text masked unless unredactedunredactFields: CSS selectors to show
visibility-firstInputs visible by default; passwords and listed fields maskedredactFields: CSS selectors to hide; if omitted, defaults to input[type="password"] and [data-hb-redact="true"]

Password protection

Password fields are always protected. Selectors that target password inputs are rejected from unredact lists (warning logged). Visibility-first always includes password selectors in the redact set.

DOM helpers

Attribute / classRole
data-hb-redact="true"Default mark for visibility-first redaction
data-no-redact="true" / .human-behavior-no-redactExclude selectors recognized by RedactionManager
rr-maskClass applied at runtime for visibility-first targets

Runtime helpers

tracker.setUnredactedFields(['input[name="email"]']);
tracker.getUnredactedFields();
tracker.hasUnredactedFields();

Prefer configuring redactionStrategy at init for production; runtime helpers are for dynamic UIs.

rrweb recording knobs tied to privacy

Init optionDefaultPrivacy note
recordCanvasfalseOpt-in; when on, samples ~4 FPS WebP at quality 0.4
suppressConsoleErrorstrueReduces rrweb/CORS console noise only — not a privacy control
captureRequestBodiesfalseKeep off unless you need error-correlated bodies (redacted)
enableConsoleTrackingtrueConsole may contain secrets — see Console & network

Input masking options enabled for common types: password, text, textarea, email, number, tel, url, search, date, time, month, week. Masking fails closed (masks on error).

Deprecated option

OptionStatus
Top-level redactFields: string[]Deprecated — treated as a legacy unredact list; migrate to redactionStrategy

Operational checklist

  • Do not console.warn / console.error tokens/PII if console capture is on (console.log is not ingested)
  • Do not put secrets in customEvent properties
  • Review Privacy model for product surfaces that can show data
  • Verify masking on a staging session before production rollout

Verify

  1. Record a session that includes password fields and any marked sensitive inputs.
  2. Open Replays → player viewport.
  3. Confirm passwords never appear in clear text; confirm unredacted / redacted selectors behave as configured.