bugsnap

bugsnap blog

How BugSnap auto-masks passwords, cards, and Stripe iframes before taking a bug screenshot

Masking happens in the browser, before the screenshot exists. Here is what gets masked, scrubbed and offered to the visitor.

· by the BugSnap team

If you embed a bug-reporting widget on a live SaaS app, you run into an immediate privacy problem: users hit bugs on login screens, settings pages, and checkout forms.

If your widget takes a screenshot first and asks questions later—or relies on a developer remembering to add a CSS class to every sensitive field—you end up storing user emails, passwords, API tokens, or payment details in your bug tracker.

When I built BugSnap (getbugsnap.pages.dev · GitHub), I wanted privacy masking to happen by default, before the screenshot is even captured, without forcing teams to configure a long list of selectors first.

Here is how BugSnap handles screenshot masking, log scrubbing, and user consent out of the box.

1. Masking happens before screenshot capture

BugSnap does not upload a raw screenshot and blur it on a server. All masking runs client-side in the browser before the screenshot is generated.

By default, BugSnap automatically masks:

  • Password inputs (type="password" and password fields)
  • Email and phone inputs
  • Card and checkout inputs
  • Stripe and PayPal payment iframes
  • Any custom element tagged with data-bugsnap-mask

If you have an internal admin table, an API key reveal box, or a custom billing component, adding data-bugsnap-mask to that container ensures it is masked before a single pixel leaves the visitor's browser.

2. Log and URL scrubbing out of the box

Screenshots are only half the leak risk. Console logs and URLs often carry even more sensitive data—especially auth tokens in query parameters or Authorization headers logged during a failed API call.

Before sending a report, BugSnap automatically scrubs:

  • Tokens, Bearer headers, and JWTs from captured logs
  • Email addresses from logs
  • Card numbers from logs
  • URL query strings (stripped from the reported page URL so reset tokens, OAuth codes, or session parameters are not stored)

3. Giving the visitor explicit screenshot control

Even with automatic masking, a user might simply prefer not to include a full-page screenshot—or not to include a screenshot at all.

Inside the BugSnap report modal, visitors get a clear Cropped / Full / No screenshot switch:

  • Cropped: Captures the relevant area without exposing the entire screen.
  • Full: Captures the visible viewport (with all sensitive fields and payment iframes masked).
  • No screenshot: Submits only the description and scrubbed technical context.

There is no hidden background recording and no session replay running on your pages.

Lightweight, open-source, and verifiable

All of this—including Shadow DOM isolation, silent on-error auto-detection, and privacy masking—fits inside 18 KB minified (~8 KB gzipped) with 0 runtime dependencies.

Because BugSnap is MIT open-source, you do not have to take my word for what it captures or masks. You can inspect the widget source on GitHub, use the $0 free hosted tier (up to 5 projects and 100 reports/month), or self-host it on Cloudflare Workers + D1 or Node 24 with no limits.

frequently asked questions

When does BugSnap mask sensitive fields?

BugSnap masks sensitive fields before the screenshot is captured in the browser—not on the server after upload.

What does BugSnap mask automatically?

BugSnap automatically masks passwords, emails, phone numbers, card and checkout inputs, Stripe and PayPal payment iframes, and any element with the data-bugsnap-mask attribute.

Does BugSnap scrub console logs and URLs too?

Yes. BugSnap scrubs tokens, Bearer/JWTs, emails, and card numbers from logs, and strips URL query strings before sending the report.

Can a visitor opt out of sending a screenshot?

Yes. Every visitor can use the Cropped / Full / No screenshot switch in the BugSnap modal before submitting a report.

add bugsnap in one line.

Free and MIT open source. Hidden until a real bug, privacy masking always on.

<script src="https://getbugsnap.pages.dev/widget.js" data-project-key="YOUR_PROJECT_KEY" data-trigger="on-error" defer></script>