Documentation & Integration Guide

Learn how to install the lightweight Bug Reporter SDK, configure Content Security Policies (CSP), enforce client-side privacy masking, and integrate notifications.

1. Installation

Add the script tag to your website's HTML. The SDK weighs less than 20 KB and initializes silently without affecting host page runtime or performance.

<script async src="https://cdn.bugreporter.dev/widget.js" data-key="pk_your_project_key"></script>

2. Content Security Policy (CSP) Requirements

If your website uses strict Content Security Policy headers, whitelist the following origins to allow the SDK to load, send reports, and upload screenshots:

script-srchttps://cdn.bugreporter.dev https://cdn.jsdelivr.net

Allows loading the initial widget script and lazy-loaded screenshot modules.

connect-srchttps://your-domain.com https://api.cloudinary.com

Permits sending diagnostic payloads and direct signed screenshot uploads.

img-srcblob: data: https://res.cloudinary.com

Enables local canvas WebP generation and Cloudinary delivery.

3. Privacy by Design & DOM Masking

Sensitive information is stripped in the browser before transmission, never after reaching the server.

Automatic Protection

  • All input[type="password"] fields are replaced with solid blocks.
  • Credit card and CVV fields are automatically masked.
  • Sensitive query parameters (token, jwt, secret, key) are redacted to [REDACTED] in all URLs.
  • No cookies, request/response bodies, or Authorization headers are ever recorded.

Custom Elements Masking

Add data-bug-mask="true" to any element to completely hide its content in both screenshots and click breadcrumbs:

<div data-bug-mask="true">
  SSN: 000-12-3456
</div>

4. Security Controls

Origin Allowlists

Configure authorized domain origins in your Project Settings. Submissions originating from unauthorized hosts or domains are rejected with 403 Forbidden.

Rate Limiting

Built-in Upstash Redis sliding window enforcement limits traffic to 20 reports per 10 minutes per IP and 100 reports per hour per project to prevent denial-of-service and telemetry spam.

Honeypot Protection

Forms feature hidden honeypot fields that trap automated bots and scrapers without affecting genuine user workflows.