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,idorplaceholdermentions 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
AuthorizationandCookieheaders, 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
- Masking runs in the browser, before any image exists.
- Payment iframes and card fields are masked without configuration.
- You can mask your own components with one attribute.
- Tokens, cards and emails are scrubbed from logs, and URLs lose their query strings.
- The visitor sees exactly what is sent and can send no screenshot.
- The code is open source, so you can verify all of the above.