Guides

How to Integrate SnagRelay Widget into a Vue.js Application

Integrate visual bug reporting into Vue 2, Vue 3, Nuxt 2, and Nuxt 3. Capture the element, requests, session replay and errors with minimal setup.

How to Integrate SnagRelay Widget into a Vue.js Application

Overview

Add SnagRelay to your Vue.js application for comprehensive bug reporting. The widget configuration is managed in your dashboard, making integration simple.

Prerequisites

  • A SnagRelay account (sign up free)
  • Your SnagRelay API key
  • A Vue.js application (Vue 2, Vue 3, or Nuxt)

Vue 3 Integration

Add the script in your App.vue or main component:

<script setup>
import { onMounted } from 'vue';

onMounted(() => {
  window.onSnagRelayLoad = function (api) {
    api.init();
  };

  const script = document.createElement('script');
  script.defer = true;
  script.src = 'https://app.snagrelay.com/widget/load/YOUR_API_KEY?onload=onSnagRelayLoad';
  document.head.appendChild(script);
});
</script>

Replace YOUR_API_KEY with your actual API key.

Vue 2 Integration

// main.js or App.vue
export default {
  mounted() {
    window.onSnagRelayLoad = function (api) {
      api.init();
    };

    const script = document.createElement('script');
    script.defer = true;
    script.src = 'https://app.snagrelay.com/widget/load/YOUR_API_KEY?onload=onSnagRelayLoad';
    document.head.appendChild(script);
  }
}

Nuxt 3 Integration

Create a client-side plugin:

// plugins/snagrelay.client.js
export default defineNuxtPlugin(() => {
  window.onSnagRelayLoad = function (api) {
    api.init();
  };

  const script = document.createElement('script');
  script.defer = true;
  script.src = 'https://app.snagrelay.com/widget/load/YOUR_API_KEY?onload=onSnagRelayLoad';
  document.head.appendChild(script);
});

Nuxt 2 Integration

// plugins/snagrelay.client.js
export default function () {
  if (process.client) {
    window.onSnagRelayLoad = function (api) {
      api.init();
    };

    const script = document.createElement('script');
    script.defer = true;
    script.src = 'https://app.snagrelay.com/widget/load/YOUR_API_KEY?onload=onSnagRelayLoad';
    document.head.appendChild(script);
  }
}

That's It!

The widget configuration (position, colors, button text, session replay settings, etc.) is managed in your SnagRelay dashboard. Any changes you make there will automatically apply to your widget.

Best Practices

  • Use environment variables — Store API keys in .env files
  • Client-side only — The widget runs in the browser; mark plugins as client-only in Nuxt

Next Steps

  • Configure integrations with Jira, Linear, or GitHub
  • Set up team notifications
  • Customize the widget in your dashboard

Further Reading

After install

What you get after install

Every report arrives in your inbox or tracker with the evidence already attached:

  • The element

    What the reporter pointed at: label, component and selector. Errors tied to it are outlined in red.

  • Console and JS errors

    With file and line, captured up to the moment of the report.

  • Network requests

    Status, URL and request and response bodies, failed and successful.

  • Session replay

    The moments leading up to the bug, with repro steps.

  • Environment

    URL, browser, OS and viewport, plus the screenshot. On paid plans, also video.

Optional

Connect your agent

Add the SnagRelay MCP server once, then paste a prompt that tells your agent to call get_issue_context. After you review the fix, mark_issue_resolved emails the reporter. MCP is on every plan.

https://mcp.snagrelay.com/v1

Add this URL as a remote MCP server, then click Allow. Paste a prompt that tells the agent to call get_issue_context, then mark_issue_resolved only after you have reviewed the fix.

More articles

Fix bugs with Cursor, Claude Code or Codex

Send your agent the whole bug, not a screenshot.

Add one script tag. Every report reaches your agent over MCP with the element, the console error and the failing request.

Start free, connect my agent

Free plan. No card. Set up in minutes.

See the agent flow