Skip to content

Privacy and CSP

Only the public project key belongs in SDK configuration. Never include a project secret, CI credential, server admin key, or AI provider key in client-side code.

Use privacy.maskSelectors to hide selected content and privacy.blockSelectors to exclude selected elements from captured evidence:

BugFence.init({
projectKey: 'pk_live_your_public_key',
endpoint: 'https://bugs.example.com/api/v1/reports',
privacy: {
maskInputs: true,
maskEmails: true,
maskCreditCards: true,
maskSelectors: ['.account-balance', '[data-bugfence-mask]'],
blockSelectors: ['#payment-frame', '[data-bugfence-block]']
}
});

Masking is best-effort; it cannot detect every sensitive value or pixel. Ask reporters to review screenshots and recordings before sending, and avoid capturing sensitive pages where possible. An explicit block is preferable for content that must not be captured.

When add-ons load from the BugFence endpoint or a CDN, allow those script origins in script-src. The widget injects styles, so review the required style-src policy for your deployment. Requests to the report endpoint and widget configuration endpoint must be allowed by connect-src.

Static bundling can remove separate add-on script origins, but the widget’s style policy still applies. See Add-ons.