Skip to main content

Privacy: Report

Beta

This page documents Bugsee React Native SDK 7.x, which is in beta and can change between betas. The stable release is 6.x: see the 6.x documentation. Upgrading? See Migrating from 6.x to 7.x.

A report bundles what the SDK captured with what the user, or your code, put into it. The capture streams have their own controls, covered on the other privacy pages. This page covers the rest: the report's own fields, attributes and the user identifier, and what a report handler can do about them before the report is sent.

What a report carries​

PartWhere it comes fromControl
Video, screenshot, touches, view hierarchyScreen capturePrivacy: Video
Console and native logsLog capture and Bugsee.logPrivacy: Console logs
Network trafficNetwork capture and Bugsee.addNetworkEventPrivacy: Network
BreadcrumbsBugsee.addBreadcrumb and the native SDKsPrivacy: Breadcrumbs
Custom events and tracesBugsee.event, Bugsee.traceWhat you pass in. See Custom events & traces.
Summary, description, labels, severityThe report dialog, upload, createReport, or the error that raised the reportA report handler
E-mail addressThe report dialog's e-mail fieldThe report handler cannot read or change it in this beta.
Attributes and the user identifierBugsee.setAttribute, Bugsee.setUserIdentifierAttributes and the user identifier; per report, a report handler
AttachmentsYour report handler or created reportYou add them; see below.

What a report handler can change​

A report handler runs before a report is sent and can rewrite its text fields. Use it to remove what a user typed into the dialog, or what an error message quoted:

import Bugsee from '@bugsee/react-native';

const CARD_NUMBER = /\b\d(?:[ -]?\d){12,18}\b/g;
const EMAIL = /[\w.%+-]+@[\w-]+(?:\.[\w-]+)+/g;

function scrub(text: string | undefined): string | null {
return text === undefined ? null : text.replace(CARD_NUMBER, '[CARD]').replace(EMAIL, '[EMAIL]');
}

Bugsee.setReportHandler({
onAfterReportCreated: async (report) => {
const { summary, description } = await report.read();
await report.update({
summary: scrub(summary),
description: scrub(description),
// Keep this attribute off reports, but not off the device
attributes: { accountEmail: null },
});
},
});

Run the redaction in onAfterReportCreated: for the report dialog, onBeforeReportCreated runs before the dialog opens, so it does not see what the user types. onAfterReportCreated can run more than once for the same report, which is harmless for a redaction like this one. Install the handler before Bugsee.launch.

You canWith
Rewrite or clear the summary and the descriptionsetSummary, setDescription, or update; null clears
Replace the labelssetLabels (replaces the whole list)
Change the severitysetSeverity
Remove one attribute, or all of them, from this reportsetAttribute(name, null), clearAttributes(), or update
Add attachmentsaddFileAttachment, addDataAttachment

A change made in the report handler applies to that report only. It does not touch the attributes stored on the device.

What it cannot do​

  • It cannot drop a report. To keep data out of one, redact it.
  • It cannot remove the video, the screenshot, the logs or the network traffic. Neither SDK can leave the video out of a single report. Keep sensitive content out of the capture itself.
  • It cannot remove an attachment once added.
  • It does not see every report. An Android native (NDK) crash, Android's early recovery at startup, and reports recovered before JavaScript runs under Android auto-launch never reach it. On iOS, a report recovered at launch gets only a short, best-effort window. See Async callbacks and deadlines.

So a report handler is the place to scrub user-entered text and adjust what your own code put in, not a guarantee for data that must never leave the device. A callback that throws does not stop the report: the changes made before the throw are kept, and the report is sent.

Attributes and the user identifier​

The user identifier and every attribute are sent with every report, and with every Bugsee.notify notification. Attributes persist across launches until you clear them.

  • Do not put passwords, tokens or other secrets in them.
  • Keep personal data to what you need to find a user's reports. An internal user ID is usually enough; you rarely need an e-mail address or a name.
  • Clear them when the user signs out, and when they withdraw consent:
import Bugsee from '@bugsee/react-native';

async function onSignOut(): Promise<void> {
Bugsee.clearUserIdentifier();
await Bugsee.clearAllAttributes();
}

The feedback chat uses the user identifier too: on both platforms, an identifier that contains an @ is taken as the user's e-mail address, and on iOS the chat's messages carry the identifier when the user gave no e-mail address.

See User & session data for the attribute API.

Reports you build yourself​

A report from createReport carries the fields you set on it, and the report handler still runs on it. See Bug reporting.

Found an issue, typo, or wrong statement on this page? Report it now →