Docs

Privacy and masking

The privacy defaults of the SDKs, every option and attribute that masks more, how to keep whole areas of your app out, and how to see for yourself what is sent.

Applies to EngineCloud At launch

View as Markdown
On this page
  1. The defaults you do not have to set
  2. Mask more
  3. One element: data-sypnia-mask
  4. One element, completely: data-sypnia-block
  5. Without touching the markup: maskSelector and blockSelector
  6. Every text: maskAllText
  7. Keep parts of the app out
  8. Asking for consent
  9. beforeSend
  10. What you send on purpose
  11. See what is sent
  12. What the agent sees
  13. Next

This page is for whoever is responsible for what leaves the app. It gives the names in code: options, attributes and functions. The rules behind them, in plain words, are in Masking and What is collected. Everything here happens inside the SDK, in the person’s browser or on your server, so it is the same for the open-source engine and for Sypnia Cloud.

At the end you will have: an app where you can state, and check, what Sypnia receives.

The defaults you do not have to set

DefaultCan it be turned off?
Everything a person types is masked, always. Text fields, text areas, dropdown choices and editable areas (contenteditable) are recorded as asterisks, one for each character.No. There is no option to record typed input.
Password, card and one-time-code fields are masked.No.
Hidden fields lose their value.No.
Events never carry a field’s value: a click on a field reports its label or placeholder.No.
url is the path only: no origin, no query, no hash. Routes replace ids by :id.No.
Request and response bodies, cookies and headers are never read. From a failed API call the SDK keeps a code of at most 40 characters and a message of at most 160.The code and message: yes, with capture.requestFailureDetail: false.
E-mail addresses in error messages, error stacks and failure messages are replaced by [email].No.
On the server, the message of a failed database or service call is redacted before it leaves: e-mail addresses, URLs, UUIDs, quoted values, long tokens and every run of digits.No.
Sign-in parameters (access_token, refresh_token, token, code) are removed from links inside recordings.No.
Frames and videos are left out of recordings. Canvas drawings are not recorded. Images are not copied.No.
No cookies. Two random ids in localStorage, which identify nobody.See optOut below.

What is recorded as shown, unless you change it: the text your pages display, and with it the labels of what people click.

Mask more

One element: data-sypnia-mask

checkout.html
<section data-sypnia-mask>
  <h2>Shipping address</h2>
  <p>Ada Park, 12 Elm Street, Springfield</p>
</section>

Inside it, letters and digits become asterisks in recordings and page snapshots, now and when the content changes later. A click inside it is reported without a label. Use it for names, addresses, amounts, messages: any text that belongs to a person.

One element, completely: data-sypnia-block

account.html
<div data-sypnia-block>
  <img src="/documents/id-card.jpg" alt="Identity card" />
</div>

The element is not recorded. The recording shows an empty box of the same size. Use it for images, maps, charts, embedded widgets: anything whose shape alone says too much.

Without touching the markup: maskSelector and blockSelector

For elements you cannot put an attribute on, such as a third-party widget:

src/main.ts
init({
  project: 'spk_7d1f0c9e4b8a2f6d3c5e1a9b0f4d8c2e',
  maskSelector: '.customer-name, .order-total, [data-private]',
  blockSelector: '#support-chat, .map',
});

Every text: maskAllText

src/main.ts
init({
  project: 'spk_7d1f0c9e4b8a2f6d3c5e1a9b0f4d8c2e',
  maskAllText: true,
});

Recordings then show the layout, the clicks and the movement, with every word replaced. Events change too: clicks carry no label and no context, and form failures no field name. Problems become harder to read («a button was clicked five times» instead of «Pay was clicked five times»). Choose it for an app that is sensitive throughout: health, finance, anything about children.

A project can also turn this on for every browser at once, without a deploy, with the project setting replay.mask_all_text. Either one is enough: the SDK masks all text when the option or the setting says so.

Keep parts of the app out

You wantUseEffect
No recording on some routesreplay: { blockedRoutes: ['/account/cards'] } in init, or the project setting replay.blocked_routesNo replay and no page snapshot there. Recording stops on entering and resumes on leaving. Events are still sent, so problems are still found. The engine also refuses recordings of routes in the project’s list, so an old tab cannot send them.
No recording anywherereplay: false, snapshots: falseThe recorder is never loaded.
Nothing at all on some routesignoreRoutes: ['/admin']The SDK is inactive there: no events, no recording.
Nothing at all for one personoptOut()Remembered in that browser until optIn().
To change or drop an event yourselfbeforeSendSee below.

A string in these lists covers the route and everything under it. Project settings are changed in the app on Sypnia Cloud, and through the API on any engine.

If your visitors must agree before analytics start, start the SDK switched off and switch it on when they agree:

src/main.ts
import { init } from '@sypnia/browser';

init({
  project: 'spk_7d1f0c9e4b8a2f6d3c5e1a9b0f4d8c2e',
  enabled: localStorage.getItem('analytics-consent') === 'yes',
});

export function onConsent(agreed: boolean) {
  localStorage.setItem('analytics-consent', agreed ? 'yes' : 'no');
  if (agreed) location.reload();
}

With enabled: false the SDK stores nothing in the browser and sends nothing. The reload starts it for a visitor who has just agreed.

beforeSend

The last word on any event. It runs in the browser (or on your server, in the Node SDK) before the event is queued.

src/main.ts
init({
  project: 'spk_7d1f0c9e4b8a2f6d3c5e1a9b0f4d8c2e',
  beforeSend(event) {
    if (event.type === 'error' && event.msg.includes('order #')) {
      event.msg = event.msg.replace(/order #\w+/g, 'order #[id]');
    }
    if (event.type === 'custom' && event.name === 'internal_debug') return null;
    return event;
  },
});

It is not called for recording content, which is masked by the rules above and cannot be edited event by event.

What you send on purpose

The defaults cover what the SDK collects by itself. Three functions send what you give them, as you give it:

  • identify() sends the person’s id and, only if you pass them, a name and an e-mail. Send the id alone if you do not want personal data in Sypnia. See Identifying people.
  • track() sends the properties you choose. Never pass what a person typed.
  • reportError() sends the error’s message. Do not build error messages out of personal data.

See what is sent

  1. Set debug: true in init. The SDK prints every event to the console before it is queued, and says why when it sends nothing.
  2. Open the developer tools, tab Network, filter by ingest. Events go to …/v1/ingest/events, recordings to …/v1/ingest/replay, page snapshots to …/v1/ingest/snapshot. Bodies above 2,048 characters are gzipped.
  3. To check masking, type something into a form, cause an error (so the session is recorded), and watch the replay: what you typed is asterisks. A recording’s piece carries mask: 1 for the default rules and mask: 2 when all text is masked.

Every field of every event is listed in the event schema.

What the agent sees

The agent reads events: what was clicked, which requests failed, which error was thrown. It never reads recordings or typed input, and masked content never reaches Sypnia at all, so it cannot be sent to a model. See Models and what is sent.

Next

Sections

Start hereWhat Sypnia is, how it works, what is open source and what is the paid cloud, and the two ways to get your first problem in plain words.ConceptsThe ten ideas Sypnia is made of, each defined precisely, from a project and its keys to problems, traces and alerts.SDKsHow your app sends data to Sypnia. One SDK for the browser, one for Node, one for Next.js, and the OpenTelemetry intake for every other backend.The agentHow Sypnia analyses a problem, what it writes, what it sends to a model and what it never does.MCP and skillsConnect your coding agent to Sypnia so it can ask what is failing in production, read what it needs to fix it, and set Sypnia up for you.API referenceThe Sypnia HTTP API: one API for the open-source engine and for Sypnia Cloud, with every endpoint, parameter, response and error.CLI referenceThe sypnia command: how to install it, the variables it reads, what its exit codes mean, and where each command is documented.Self-hostingWhat you run when you host the Sypnia engine yourself, what you need, what it costs, and what you do not get compared with Sypnia Cloud.How the engine is builtThe whole Sypnia engine on one page, from a click in your app to the sentence your coding agent reads, with the design rules and the code that holds them.Sypnia CloudHow the paid service works, from organizations and roles to plans, limits, billing, where your data lives, the GitHub App and support.Privacy and securityWhat Sypnia collects from your app and its users, what it never collects, how masking works, how to delete data, and how the service is protected.LicensingWhich licence covers each part of Sypnia, what you may do with it, how the name may be used, and the terms of a contribution.GuidesStep-by-step recipes for the common ways to use Sypnia, from apps made with AI builders and Next.js on Vercel to Supabase, source maps in CI, alert e-mails from your own engine, and moving from Sentry.ReferenceThe pages you look things up in, from the event schema and the glossary to what is planned, the changelog and the common questions.
↑↓ to move↵ to openEsc to close