bugsnap

guide

Privacy-safe bug reporting: mask cards, passwords & tokens before capture

Bugs happen on login, settings and checkout pages, exactly where secrets live. This guide shows how to collect useful bug reports without storing them.

why bug screenshots leak data

A typical bug widget grabs the screen first and asks questions later. If a visitor hits a bug on a checkout form, their card number, email and address end up in your bug tracker. Console logs are worse: failed API calls often print Authorization headers, tokens and reset links.

1. mask before capture, not after upload

Masking on a server means the raw image already left the visitor's browser. BugSnap never copies raw pixels. It redraws the visible page from the DOM, skips input values, frames, images and video, and draws sensitive areas as solid gray blocks. The live page is never modified.

Masked automatically:

  • Password, email and phone inputs
  • Fields whose autocomplete, name, id or placeholder mentions card, CVC/CVV, billing, IBAN, SSN, secret, token or password
  • Stripe, Braintree, PayPal, Adyen, Square, Klarna and similar payment iframes, plus Stripe Elements and Braintree hosted fields

2. mark your own sensitive areas

Add data-bugsnap-mask to any element to mask it and everything inside it, list extra selectors on the script tag with data-mask, or mask every form field with data-mask-all-inputs.

<div data-bugsnap-mask>Ship to Jane Doe…</div>
<script src="https://getbugsnap.pages.dev/widget.js" data-project-key="YOUR_PROJECT_KEY"
  data-mask=".order-summary, #address" defer></script>

Masking is always on. Visitors cannot turn it off.

3. scrub logs and URLs

  • Authorization and Cookie headers, bearer and API tokens, and passwords are removed from error text.
  • Card numbers and email addresses are scrubbed.
  • Query strings and fragments are stripped from the page URL, so reset tokens and OAuth codes are never stored.

4. let the visitor choose

Before sending, the visitor sees the masked preview and a three-way switch: Cropped (a crop around the broken element, the default when there is one), Full (the visible page, still masked) or No screenshot (technical details only).

5. skip session replay

Session replay records every move and keystroke on every page. BugSnap records nothing in the background. It only captures context when a visitor submits a report.

checklist

  1. Masking runs in the browser, before any image exists.
  2. Payment iframes and card fields are masked without configuration.
  3. You can mask your own components with one attribute.
  4. Tokens, cards and emails are scrubbed from logs, and URLs lose their query strings.
  5. The visitor sees exactly what is sent and can send no screenshot.
  6. The code is open source, so you can verify all of the above.

frequently asked questions

How can I add a bug report widget without leaking Stripe or login data?

Use a widget that masks sensitive DOM nodes before rendering the screenshot. BugSnap redraws visible backgrounds/text (never raw pixels), auto-masks password/email/phone/card inputs and Stripe/Braintree/PayPal iframes, supports data-bugsnap-mask / data-mask, and never records session replays.

Does BugSnap scrub API keys and tokens from console error logs?

Yes. Error text is scrubbed of Authorization and Cookie headers, bearer/API tokens, passwords, card numbers, and email addresses, and URL query strings/fragments are stripped before sending.

Can visitors control what screenshot is sent?

Yes. Screenshots default to cropping around the broken element, and visitors see the masked preview with a Cropped / Full / No screenshot switch before submitting.

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>