Skip to main content
Every option the browser SDK accepts, with its default value and a note on when to change it. These apply to both new LucentTracker(options) and the options prop on <LucentProvider>.
import { LucentTracker } from "@lucenthq/sdk";

const tracker = new LucentTracker({
  publicKey: "luc_pk_...",
  privacy: { mode: "privacy-first" },
  sampling: { sessionReplay: 1.0 },
  capture: {
    canvas: false,
    console: true,
    network: true,
  },
});

Core

publicKey
string
required
Your Lucent publishable key (luc_pk_...). Safe to expose in client‑side code — can only write session data to your org, cannot read anything. Manage keys in the dashboard.
ingestBaseUrl
string
default:"https://batch-jobs-lucent.onrender.com"
Override the ingest endpoint. Only needed for self‑hosted setups or internal testing.
autoStart
boolean
default:"true"
When false, the <LucentProvider> will not begin recording until you explicitly call start(). Useful when you want to wait for user consent before collecting data. Currently honored by <LucentProvider> only — new LucentTracker(...) always starts immediately.

Privacy

Lucent ships with a privacy‑first default: all text content is masked and all inputs are redacted unless you opt in.
privacy.mode
"privacy-first" | "visibility-first"
default:"\"privacy-first\""
  • privacy-first — mask all text and inputs by default. Add the data-lucent-unredact attribute to any element whose text you want to record.
  • visibility-first — record text by default. Use redactSelectors to opt specific elements out.
privacy.redactSelectors
string[]
default:"[]"
CSS selectors whose matched elements should have their text replaced with asterisks. Commonly used for PII like email, name, address.
privacy.maskAllInputs
boolean
default:"true in privacy-first mode"
When true, all form inputs (except <input type='button'> and <input type='submit'>) have their values replaced. Defaults to true in privacy-first mode and false in visibility-first mode.
privacy.blockSelectors
string[]
default:"[]"
CSS selectors whose matched elements should be replaced with a placeholder rectangle in the replay. Use for third‑party widgets you cannot safely record.

Capture

Toggle individual data sources on or off. Clicks, inputs, and form submissions are always captured — they’re required for the replay and for rage‑click / dead‑click detection.
capture.canvas
boolean
default:"false"
Record <canvas> contents. Disabled by default because it is bandwidth‑heavy.
capture.console
boolean
default:"true"
Capture console.log / warn / error output from the page.
capture.consoleLogLevels
string[]
Which console levels to record. Tighten this to ["warn", "error"] if you want to reduce noise.
capture.network
boolean
default:"true"
Capture fetch and XMLHttpRequest calls (method, URL, status, timing). Request/response bodies are not captured.
capture.networkIgnoreUrls
(string | RegExp)[]
default:"[]"
Network requests matching any of these patterns are skipped entirely. Useful for filtering out noisy analytics or telemetry endpoints.

Sampling

sampling.sessionReplay
number
default:"1.0"
Fraction of sessions to record, between 0.0 and 1.0. The decision is made once per LucentTracker instance on construction — not per event. For example, 0.1 records 10% of sessions.

Batching

These defaults match what the ingest API is tuned for. Change them only if you have a specific reason.
batching.flushIntervalMs
number
default:"10000"
How often the event queue is flushed to the ingest API, in milliseconds.
batching.maxEventsPerBatch
number
default:"500"
Maximum events per batch. Reaching this triggers an immediate flush.
batching.maxBatchBytes
number
default:"1048576"
Maximum batch size in bytes (1 MiB). Reaching this triggers an immediate flush.

Detection

Thresholds for client‑side signal detection. Events that trip these fire rage_click and dead_click events into the session stream.
detection.rageClickThreshold
number
default:"3"
Number of clicks on the same target within one second that counts as a rage click.
detection.deadClickTimeoutMs
number
default:"500"
If a click produces no DOM mutation or navigation within this many milliseconds, it’s reported as a dead click.