Control the widget on your site

Start with the script from Project Settings. If you have not added it yet, follow Add a report button to your website. Change the widget only when your site needs different placement, consent control, or a custom report button.

Move the report button

The default position is bottom-right. Use data-placement to move it.

html
<script
  type="module"
  src="https://app.disbug.io/static/disbug/widget/v1.js"
  data-project-key="YOUR_PROJECT_KEY"
  data-placement="bottom-center"
></script>

The supported positions are bottom-right, bottom-center, and top-center. You can also use data-bar-placement for the open report bar.

The open widget report bar at the bottom right with one pin and a Save button
The open report bar in the default bottom-right position, after one pin

Open Disbug from your own button

Keep the generated widget script on the page. Call open() after the script loads.

html
<button type="button" id="report-problem">Report a problem</button>
<script>
  document.getElementById("report-problem")
    .addEventListener("click", () => window.Disbug.open());
</script>

Use this method when your product already has a support or feedback menu.

Use the replay controls when your consent or privacy settings must start and stop capture.

js
await window.Disbug.enableReplay();
window.Disbug.disableReplay();
const enabled = window.Disbug.isReplayEnabled();

Replay starts from the time that you enable it. It does not recover earlier activity. Capture hard-to-reproduce bugs explains what replay shows a developer.

Remove the widget at runtime

Use destroy() when a user signs out or when a page must remove the report interface.

js
window.Disbug.destroy();

Use destroy({ purgeStorage: true }) to also remove widget settings, unsaved pins, and replay data from that browser. Submitted reports stay in Disbug.

Fix a strict Content Security Policy

Most sites need no extra browser configuration. A strict Content Security Policy can block the script or report upload.

Permit the Disbug script origin in script-src. Permit the blocked Disbug connection or upload origin in connect-src. Use the exact origin from the browser error. Do not add a broad wildcard.

If the widget still fails, make sure that the key belongs to an enabled project. Open Project Settings for the project and check the Widget section.

Was this page helpful?

How can we improve?