bugsnap

guide ยท nuxt & vue

Add a Free Bug Report Widget to Vue 3 & Nuxt 3

How do you add a bug report widget to Nuxt 3 or Vue 3? Add BugSnap's 18 KB defer script to app.head.script in nuxt.config.ts (SSR-safe) or index.html in Vue 3. It auto-masks sensitive fields, captures up to 20 recent errors, and exports 1-click Markdown at $0 forever.

1. nuxt 3: add it to nuxt.config.ts

Nuxt renders app.head scripts into the server HTML, and the browser runs them after parsing, so there is no window is not defined error during SSR and no client-only plugin to write:

export default defineNuxtConfig({
  app: {
    head: {
      script: [
        {
          src: 'https://getbugsnap.pages.dev/widget.js',
          'data-project-key': 'YOUR_PROJECT_KEY',
          'data-trigger': 'on-error',
          defer: true,
        },
      ],
    },
  },
})

2. vue 3 (vite): add it to index.html

For a plain Vue 3 app, paste the tag into index.html before </body>. No npm package and no plugin registration:

<script
  src="https://getbugsnap.pages.dev/widget.js"
  data-project-key="YOUR_PROJECT_KEY"
  data-trigger="on-error"
  defer
></script>

The widget listens at the window level, so it keeps working across Vue Router and Nuxt page navigations.

3. why it fits vue and nuxt

  • Zero runtime dependencies: 18 KB minified (about 8 KB gzipped), loaded with defer so it never blocks Vue hydration.
  • Invisible by default: with data-trigger="on-error" it stays hidden until a JavaScript crash, failed API call, broken image or dead click.
  • Masked before capture: passwords, emails, phones, card and checkout inputs, payment iframes and data-bugsnap-mask elements never reach the screenshot.
  • Markdown for AI fixes: each report includes up to 20 recent errors and copies as Markdown for Claude Code, Cursor or Codex.

Using another stack? See the Next.js, React & Vite and Astro guides. Testing a bug yourself? Scrub your console output with the free log privacy redactor, then turn it into an agent prompt with the bug report to AI prompt generator. Or go back to the BugSnap homepage.

frequently asked questions

Does BugSnap work with Nuxt 3 SSR?

Yes. Add it to app.head.script in nuxt.config.ts. Nuxt puts the tag in the server-rendered HTML and the browser runs it, so nothing executes on the server.

Do I need an npm package or a Vue plugin?

No. One deferred script tag handles error detection, masked screenshots and delivery, with zero runtime dependencies.

What does it cost?

$0 forever on the hosted tier (5 projects and 100 reports a month), or unlimited when self-hosted under the MIT license.

add bugsnap in one line.

$0 free forever and MIT open source. Hidden until a real bug, privacy masking always on.

<script src="https://getbugsnap.pages.dev/widget.js" data-project-key="YOUR_PROJECT_KEY" data-trigger="on-error" defer></script>