Privacy: Report
This page documents the Bugsee JavaScript SDK, which is in beta (0.1.x) and can change between betas.
A report is a bundle: the rolling capture window at the moment of the incident, plus the details of the incident itself. This page lists what is in it, and the controls you have over each part.
What a report carries
| Part | Contents | Control |
|---|---|---|
| Report details | Summary, description, severity, labels, the source of the report, and the reporter email or user identifier. | Report handler |
| Session replay | The page DOM and its changes, in the browser and Electron. | Privacy: Replay |
| Input | Pointer presses and named key presses, with a description of the target element. Typed characters are not recorded. | captureInteractions |
| Console logs | Console output and lines you write with log. | Privacy: Console logs |
| Network | Requests, responses, headers and bodies. | Privacy: Network |
| Breadcrumbs | Your breadcrumbs and the automatic ones. | Privacy: Breadcrumbs |
| Events and traces | Your event and trace calls, and the system events and traces the SDK records. | captureSystemEvents, captureSystemTraces |
| View hierarchy | A description of the DOM at report time, in the browser. | captureViewHierarchy |
| Crash detail | For an error or crash, the structured stack with source positions. | None. It is the stack of the error. |
| Environment | App id, version and build, the runtime and operating system, device and screen details. | Launch options for the identity fields |
| User and attributes | The user identifier and the attributes you set. | Below |
| Attachments | Files you add, up to 3 of 3 MB each. | Below |
| Performance | Transactions and spans, with the performance extension. | performanceMonitoring, setSpanFilter |
On Node.js and Bun a report can also carry a CPU profile and the local variables of a stack frame, but only when you turn those diagnostics on. They are off by default. See Diagnostics.
What a report handler can change
A report handler can change the report details: summary, description, severity, labels, email and attachments. It can also veto the report.
import { bugsee } from './bugsee';
// Replace with your own check: true when the signed-in account is staff
const isStaffAccount = (): boolean => false;
bugsee.setReportHandler({
before: (request) => {
const { report } = request;
// Do not send a report about a certain error at all. Clearing the description
// would not help: the message and stack are also in the crash detail.
// The summary of an error report is its message, so match on message text.
if (report.summary?.includes('Card declined')) {
return null;
}
// Do not report on behalf of staff accounts. Use a flag your app sets for staff,
// not the email: the report email may be an opaque user identifier.
if (isStaffAccount()) {
return null;
}
return request;
},
});
Where bugsee is the client launch returned:
import { launch } from '@bugsee/bugsee';
export const bugsee = await launch('<your_app_token>');
Capture covers only what runs after launch(), and code that runs earlier is not recorded. Top-level await delays only the modules that import this one: an unrelated app module that your entry file imports next can still run while launch() is pending. Either import this module from every app module that needs the client or capture, or have the entry file load the app after launch settles, with import './bugsee'; await import('./app');. Install any filter in this module too, right after launch and before the export, so no application code runs before the filter exists.
What it cannot do
- It cannot remove console logs, network events, breadcrumbs, replay or traces from the bundle. Control these where they are recorded, with the filters and options on the pages above.
- It does not change the structured crash detail. The error message and stack are in the report's summary, description and crash detail, so keep personal data out of error messages.
Attributes and the user identifier
Both are uploaded with every report, and neither is redacted. You decide what they contain.
- Use an opaque id, not an email address, in
setUserIdentifier. The identifier is sent as the reporter email unless a report has its own email. - Do not put secrets or personal data in
setAttribute. - Call
clearUserIdentifier()andclearAllAttributes()at sign-out, so the next reports do not carry them. - A report carries the identifier and attributes as they were when the report was created. Clearing them later does not rewrite a report that has already been created and is waiting in the upload queue.
- In the browser, the identifier stays in memory unless you set
persistUserIdentifier: true.
See User & session data.
Attachments
An attachment is exactly what you pass. It is not redacted, masked or filtered. Do not attach files that hold secrets, and review what a helper such as a config dump contains.
Error messages
The summary and description of an error report come from the error's message and stack. A message such as User jane@example.com not found ends up in the report. Keep personal data out of error messages. The handler cannot remove the message or stack from the crash detail; veto the report with return null if it must not be sent.
Related pages
- Report handler — the callbacks and examples.
- Privacy overview — all privacy controls.
- User & session data — identifier and attributes.
- Privacy: Cleanup — where data is stored and how to limit it.