ShowbugInstall guide
Dashboard

On this page

  • Quick start
  • Next.js and React
  • Identify your users
  • Hide sensitive content
  • What your users need
  • Content Security Policy
  • Limits and pausing
  • Troubleshooting

Add Showbug to your site

Showbug adds a “Report a problem” button to your product. When someone clicks it, they share their tab, talk through the problem with a voice agent, and you get the recording, the transcript and what the page was doing. Installing it is one script tag.

Quick start

  1. Sign in and create an organisation.
  2. Create a project. Add every origin the widget will run on, for example https://app.example.com. Add http://localhost:3000 too if you want to test locally. A key only works from origins on this list.
  3. Copy the snippet from the project page (it has your key filled in) and paste it before </body> on every page where people should be able to report a problem:
<script
  src="https://app.showbugai.com/sdk/loader.js"
  data-key="pk_live_your_key"
  data-api="https://api.showbugai.com"
  async
></script>

Reload your site. A “Report a problem” button appears in the bottom-right corner. Record a test report; it shows up under Sessions in the dashboard when you end it.

The script is about 9 KB and does not record anything by itself. The recorder only downloads after a click. data-api is where reports are sent; keep the value from your project page.

Next.js and React

In Next.js, load the same script from the root layout so it is on every route:

// app/layout.tsx
import Script from "next/script";

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Script
          src="https://app.showbugai.com/sdk/loader.js"
          data-key="pk_live_your_key"
          data-api="https://api.showbugai.com"
          strategy="afterInteractive"
        />
      </body>
    </html>
  );
}

In any other React app, this small component does the same and keeps the signed-in user in sync. Copy it into your project; it has no dependencies:

// showbug.tsx — render <Showbug /> once, near the root of your app.
import { useEffect } from "react";

type ShowbugUser = { userId?: string; accountId?: string; plan?: string };

export function Showbug({ user }: { user?: ShowbugUser }) {
  useEffect(() => {
    if (document.querySelector("script[data-showbug]")) return;
    const script = document.createElement("script");
    script.src = "https://app.showbugai.com/sdk/loader.js";
    script.async = true;
    script.dataset.showbug = "";
    script.dataset.key = "pk_live_your_key";
    script.dataset.api = "https://api.showbugai.com";
    document.body.appendChild(script);
  }, []);

  useEffect(() => {
    // Runs without a user too, so a sign-out clears the one the widget remembers.
    const identify = () => (window as any).Showbug?.identify(user ?? {});
    identify();
    const script = document.querySelector("script[data-showbug]");
    script?.addEventListener("load", identify);
    return () => script?.removeEventListener("load", identify);
  }, [user?.userId, user?.accountId, user?.plan]);

  return null;
}

Load the script once. The widget lives outside your React tree, in its own shadow root, so your styles do not affect it and it survives client-side navigation.

Identify your users

Tell Showbug who is signed in and each report carries that with it. Call it after the script has loaded and again when the user changes. All three fields are optional strings.

window.Showbug?.identify({
  userId: "u_123",     // your id for the person
  accountId: "acme",   // the customer account they belong to
  plan: "pro",
});

Send ids, not names or email addresses, unless you want them stored with the report. Values are cut at 200 characters.

Hide sensitive content

Mark anything that should not be captured in the page replay with data-private:

<div data-private>
  Card ending 4242
</div>
  • Marked elements are left out of the page replay. Password fields are always left out.
  • The tab video is a real screen recording. data-private does not blur it. If a page shows data that must never be recorded, do not load the widget on that page.
  • Network diagnostics keep the method, the address without its query string, the status and the timing. Headers and bodies are never collected.

What your users need

  • Chrome on a desktop computer. Other browsers are not supported yet.
  • A page served over HTTPS (or localhost while you develop).
  • To allow tab sharing and the microphone when the browser asks. Nothing is recorded before that.

Content Security Policy

If your site sends a Content Security Policy, allow these. Sites without one need no change.

script-src   https://app.showbugai.com
connect-src  https://api.showbugai.com https://api.openai.com
style-src    'unsafe-inline'
  • connect-src also needs your storage bucket host if your Showbug workspace stores recordings in S3.
  • A Permissions-Policy header must not deny display-capture or microphone.
  • Trusted Types enforcement is not supported.

This list is derived from what the widget does and has not been tested against every policy. Ship it as Content-Security-Policy-Report-Only first and watch for violations.

Limits and pausing

Each project has limits you can change in its settings: the longest a recording may run (default 3 minutes), and how many reports it accepts per hour, per month and per visitor. When a limit is reached the widget tells the person to try again later.

Pausing a project stops new reports without touching your site. Revoking a key does the same for that key; it can take up to 30 seconds to take effect.

Troubleshooting

The button does not appear
Open the browser console. “missing data-key” means the script tag has no data-key. A blocked script means your CSP needs the script-src entry above.
The button appears but a report will not start
Check that the page’s exact origin (scheme, host and port) is in the project’s allowed origins, that the key is active and that the project is not paused.
“Try again later”
The project reached one of its limits. Raise it in the project’s settings.