On this page
A SMALL ADDITION TO YOUR SITE
From install to
your first report.
Add the widget, send a report, and find the context in your workspace. Start with the quickstart, then make it fit your site.
Building a website with an AI assistant? Use the agent installation guide and OpenAPI schema to prepare a widget and give its owner a direct setup link.
Get your first report in.
- Create a project and copy its public key.
In Projects, create a project and use its public widget key. Keep private keys on your server.
- Add the script and initialize once.
Place this just before your closing
</body>tag. ReplaceYOUR_PUBLIC_KEYwith your project's public key.
<script src="https://bugerz.com/javascripts/bugerz.min.js"></script>
<script>
BugerZ.init({
publicKey: 'YOUR_PUBLIC_KEY'
});
</script>The widget adds a “Report Bug” button in the bottom-right corner. Click tracking and automatic error reporting are off by default; you do not need to set either option in the basic initializer. The reporter can describe the problem and submit it without a Bugerz account.
Finish with a real check. Open the widget, send a disposable report, and find it in your Issues list. Delete the test report when you're done; normal report and storage limits apply.
The screenshot helper loads on demand when a screenshot is needed. Use one script source and one initializer per page.
The browser client is also available from jsDelivr and GitHub Pages. These mirror the public client repository; choose one script host. Branch and CDN copies may be cached. Download the client from GitHub if you prefer to host it yourself.
Use your own button.
Keep a report action in your header, help menu, or anywhere it belongs. Set addButton: false and open the form with BugerZ.show().
Use this initializer instead of the quickstart version above.
<button id="report-a-bug" type="button">Report a bug</button>
<script src="https://bugerz.com/javascripts/bugerz.min.js"></script>
<script>
BugerZ.init({
publicKey: 'YOUR_PUBLIC_KEY',
addButton: false
});
document.getElementById('report-a-bug').addEventListener('click', () => {
BugerZ.show();
});
</script>Style the button with your site's CSS. A native <button> also works with a keyboard.
Make it fit your site.
Pass configuration to BugerZ.init(). These are the current defaults for the most-used options.
| Option | Default | What it does |
|---|---|---|
publicKey | Required | The project's public widget key. |
addButton | true | Add the built-in report button. |
buttonText | 'Report Bug' | Change the built-in button's label. |
placement | 'bottom-right' | bottom-right, bottom-left, top-right, or top-left. |
openOnInit | false | Open the form immediately after initialization. |
screenshot | true | Try to attach a capture of the page. |
screenshotOptions.mode | 'viewport' | Visible area: capture what the reporter can see at their current scroll position. Use 'full-page' for the entire page. |
screenshotOptions.imagePlaceholder | true | Replace unavailable images with the built-in placeholder. Supply an image data URL for a custom fallback, or false to disable replacement. |
trackConsole | true | Buffer console messages for the next report. |
trackEvents | false | Opt in to click breadcrumbs, available in Basic and Pro. This does not record typing. |
autoSendOnError | false | Legacy opt-in automatic reporting when console.error is called. Prefer report() for deliberate application errors. |
showEmailField | true | Show the optional reporter email field. |
showPublicCheckbox | false | Show a “Make public” checkbox. Server-side plan and privacy rules still apply. |
consoleBufferSize | 100 | Maximum console entries buffered in memory. |
eventBufferSize | 100 | Maximum click entries when tracking is enabled. |
screenshotTimeout | 8000 ms | Total time allowed for screenshot loading, capture, and a fallback attempt. |
requestTimeout | 15000 ms | Time allowed for the report's HTTP request. |
filterCrossOrigin | false | Exclude selected cross-origin images, iframes, and stylesheet elements from captures. |
endpoint | Hosted API | Defaults to https://bugerz.com/api/report. |
Match your colors and typography.
Use cssVars inside your initializer. Your overrides merge with the widget's defaults.
cssVars: {
'--bz-primary': '#b64e22',
'--bz-bg': '#ffffff',
'--bz-color': '#25211e',
'--bz-radius': '10px',
'--bz-font': 'system-ui, sans-serif'
}The JavaScript API.
The browser global is BugerZ, with a capital B and Z.
BugerZ.init(options)Configure the widget once. Requires publicKey.
BugerZ.show()Open the report form.
BugerZ.hide()Close the report form.
BugerZ.toggle()Open or close the form.
BugerZ.report(fields, options)Send a report from your application and return a Promise.
Report an application error deliberately.
Call report() after initialization, at a point where your app knows what happened. Choose which fields are safe to send.
async function reportSaveFailure() {
try {
const result = await BugerZ.report(
{ description: 'The save operation failed.', action: 'save_failed' },
{ screenshot: false }
);
return result;
} catch (error) {
// Show a useful error in your app. Avoid an automatic retry loop.
console.warn('Report not sent:', error.message);
throw error;
}
}report() doesn't open the form or invoke the widget's onSuccess/onError UI callbacks. Handle the returned Promise yourself. The per-call screenshot: false option skips the image for that report.
Handle widget submission callbacks.
Callbacks receive the saved report response or an error. Supplying a callback replaces the default success or error message.
onSuccess: (result) => {
// A URL is present only when the project allows sharing this report.
if (result.showLink && result.url) {
console.info('Report link:', result.url);
}
},
onError: (error) => {
console.warn('Report not sent:', error.message);
}Choose what gets captured.
Reports can include a screenshot, the page URL and title, browser information, and buffered console messages. Optional click tracking records the element tag, click coordinates, and timestamp.
Exclude private page sections.
Add data-bugerz-private to a section to exclude it from screenshots and click breadcrumbs. Password inputs and the widget itself are also excluded from screenshots.
<section data-bugerz-private>
<p>Account or billing information</p>
</section>Console output is separate. The private marker doesn't redact anything your application writes to the console. Set trackConsole: false and screenshot: false on sensitive pages when appropriate.
Click tracking is off by default. When enabled, it skips inputs, textareas, editable content, and marked private sections. It doesn't record keystrokes or field values. Check your application logs and page URLs before enabling capture on pages with sensitive data.
Keep the picture useful.
Set the screenshot area in your initializer with screenshotOptions.mode. Visible area ('viewport', the default) captures what the reporter can see at their current scroll position. Full page ('full-page') captures the entire page from top to bottom, including content outside the visible area.
The configured area is used for reports submitted through the widget.
Capture happens when the report is sent. The widget uses PNG by default, at a pixel ratio of 1, and skips font embedding. If a scrolled capture fails or stalls, the widget retries a standard capture from the top, keeping the configured image dimensions and privacy filters without scrolling your live page. If media also prevents standard capture, a final retry omits media to retain the page’s text and layout. All attempts share the screenshot timeout. If every attempt fails, the description still sends. Full-page captures can produce larger attachments.
For smaller screenshots, choose JPEG. Unavailable images are replaced with the built-in placeholder by default so the rest of the screenshot can still be captured.
screenshot: true,
filterCrossOrigin: false,
screenshotOptions: {
mode: 'viewport', // 'full-page' captures the entire page
imagePlaceholder: true, // built-in fallback for unavailable images
type: 'jpeg',
quality: 0.8,
pixelRatio: 1,
skipFonts: true,
cacheBust: false
}To choose a different area for one programmatic report, pass { screenshotOptions: { mode: 'full-page' } } as the second argument to BugerZ.report(). Later reports keep the configured default.
Keep useful screenshots when images fail.
The widget embeds an “Image unavailable” placeholder when an image fetch fails, including missing files and cross-origin images that block access. Image elements also recover when the response cannot be decoded as an image. The built-in image needs no separate download or hosting. Replacement happens in the screenshot copy; your live page is unchanged.
| imagePlaceholder | Behavior |
|---|---|
true (default) | Use the built-in placeholder. |
| An image data URL | Use your own PNG, JPEG, or SVG fallback. Image elements use the built-in image if the custom fallback fails. |
false | Disable image replacement. A failed image may prevent a screenshot from being attached; the report can still send. |
You can download the built-in SVG placeholder to adapt it. To use a custom SVG, pass 'data:image/svg+xml;charset=utf-8,' + encodeURIComponent(yourSvgMarkup) as screenshotOptions.imagePlaceholder.
Leave filterCrossOrigin: false to try embedding external images and replace failures. Set it to true when you want to omit external images and iframes entirely. Filtered elements are removed before placeholders are applied.
Decode recovery applies to image elements; malformed CSS background images may remain blank. Placeholders do not bypass cross-origin restrictions or make iframe content capturable. Other capture failures, including an unavailable screenshot helper or a timeout, can still leave the report without an image.
For finer control, pass a screenshotOptions.filter(node) function that returns false for nodes to omit. The widget's private-section and password filters still apply.
When something doesn't look right.
The report button doesn't appear.
Confirm that the script loaded, your public key is set, and BugerZ.init() runs after the page is ready. With addButton: false, use your own button and call BugerZ.show().
The screenshot is missing.
External images, stylesheets, iframes, or a blocked screenshot helper can prevent capture. Try the options in Screenshots. The description can still be submitted without an image.
I sent a report but can't find it.
Open the project associated with the public key used in the initializer. A homepage demo report appears at its temporary link rather than inside your customer project.
The server rejected my report.
Check that the key is valid and hasn't been revoked, that your server configuration allows requests from your site's origin, and that the project has space for another report. If submission fails, the widget keeps the description so the visitor can retry.
The success message has no report link.
Check your project's sharing settings and plan. A private report doesn't become shareable simply because an email address was entered.
Current widget behavior
Click tracking and automatic reporting are off by default. Screenshot capture and report requests have timeouts. BugerZ.report() supports deliberate reporting from your app.