- Guides
- Privacy controls
Privacy controls
Mask text by default, hide regions, and keep network requests or their bodies out of recordings.
Espejo already redacts secrets and masks every input before anything uploads (see Security & isolation). This page covers what you decide to leave out: personal data that is on screen or in your API responses. Every option below can only restrict what is recorded. None of them can switch on something your project has off.
Set it once for the whole project
Section titled “Set it once for the whole project”You do not need to touch your HTML. In the console, open Project settings → Recording → Privacy and choose:
- Page text in the replay: only what you mark, or all text.
- Network request and response bodies: record them, or never.
- Routes whose bodies are never recorded and Routes never recorded at all: one fragment per line, with the same matching rules as the attributes below.
- Screen recording: offered, or turned off.
It applies to every visitor of the project. New page loads pick up a change within about 5 minutes. Everything on this page can only restrict: the project setting and the script attributes are combined by keeping the most restrictive of the two, so neither one can loosen what the other set. The replay waits for the project setting (2 seconds at most) before it records anything. If your project settings cannot be fetched, the script attributes alone apply.
Text on screen
Section titled “Text on screen”In DOM replay (data-capture="dom", or espejo.dom.js), only input values
are masked by default. Text elsewhere on the page is recorded as it is.
| Attribute | Effect |
|---|---|
data-espejo-mask | Keeps the shape of the element and replaces its text with *. Best for debugging layout bugs. |
data-espejo-block | Cuts a hole in the replay. Clicks inside it are not described. |
data-espejo-unmask | Only with data-mask-text="all": leaves the text of that element and everything inside it readable. |
Mask everything by default
Section titled “Mask everything by default”Set data-mask-text="all" on the script tag. All text on the page is masked
in the DOM replay and in the page snapshot behind heatmaps. A new page that
nobody marked is covered from the start.
<script src="https://app.espejo.dev/sdk/espejo.dom.js" data-key="pk_live_…" data-mask-text="all"></script>Then mark what is safe to read, such as the menu, headings and buttons:
<nav data-espejo-unmask>…</nav><h1 data-espejo-unmask>Tickets</h1><main> <!-- masked: layout stays, text becomes asterisks --> <p data-espejo-unmask>Customer: <span data-espejo-mask>Ana Pérez</span></p></main>A data-espejo-mask or data-espejo-block inside an unmasked region still
applies. Masked text keeps its length, so the layout looks the same in the
replay.
With a bundler, the same option is maskText: "all" in the configuration.
Without it, the value is "marked": only elements with data-espejo-mask.
Network requests
Section titled “Network requests”By default every fetch, XMLHttpRequest and sendBeacon is recorded with
its method, URL, status, duration, redacted headers and the request and
response bodies (text and JSON only, up to a size limit, with secret keys
redacted). Personal data that is not a secret, such as an email or a name, is
not removed from bodies.
| Attribute | Effect |
|---|---|
data-network-bodies="off" | No request or response body is recorded. Method, URL, status, duration and redacted headers remain. |
data-network-body-exclude="/api/contacts,/api/tickets" | Everything is recorded except the bodies of requests whose URL contains one of the fragments. |
data-network-ignore="/api/contacts" | Requests whose URL contains one of the fragments are not recorded at all. |
Fragments are separated by commas and matched as plain text against the URL
as the page wrote it. There are no wildcards or regular expressions. An
absolute URL (https://api.example.com/contacts) and a relative one
(/contacts) both match /contacts.
<script src="https://app.espejo.dev/sdk/espejo.dom.js" data-key="pk_live_…" data-mask-text="all" data-network-body-exclude="/api/"></script>With a bundler, the options are networkBodies: "off", networkBodyExclude: string[] and networkIgnore: string[].
Screen video
Section titled “Screen video”A recording of the screen shows what the screen shows, so masking attributes do
not apply to it. It is optional and the person chooses to start it. Automatic
reports never include video. If your pages show personal data, turn it off:
data-video="off" on the script (or video: "off" with a bundler), or the
Screen recording switch in the console. The report button then no longer
offers it, and espejo.startVideo() fails.
What these options do not cover
Section titled “What these options do not cover”- Console output. Do not log personal data to the console.
- Identity.
data-user-refandidentify()take an opaque id, never an email or a name.