Overview
Integrating SnagRelay into a static HTML website is straightforward. With just a few lines of JavaScript, you can add a powerful bug reporting widget that captures the element the user points at, requests with bodies, console errors and a session replay automatically, plus a screenshot the reporter can mark up.
Prerequisites
- A SnagRelay account (sign up free)
- Your SnagRelay API key (shown on your project's Install step)
- Access to edit your HTML files
Installation
Add the Script to Your HTML
Add the following code just before the closing </body> tag of your HTML file:
<script>
window.onSnagRelayLoad = function (api) {
api.init();
};
var script = document.createElement('script');
script.defer = 1;
script.src = 'https://app.snagrelay.com/widget/load/YOUR_API_KEY?onload=onSnagRelayLoad';
document.getElementsByTagName('head')[0].appendChild(script);
</script>Replace YOUR_API_KEY with your actual API key from the SnagRelay dashboard.
Verify Installation
After adding the script:
- Open your website in a browser
- Look for the SnagRelay feedback button (usually in the bottom-right corner)
- Click it to test the bug reporting flow
That's It!
The widget configuration (position, colors, button text, etc.) is managed in your SnagRelay dashboard. Any changes you make there will automatically apply to your widget.
Best Practices
- Load asynchronously — The
deferattribute ensures the widget doesn't block page load - Add to all pages — Include the script in your main template or layout file
- Test in staging first — Verify the integration works before deploying to production
Troubleshooting
Widget not appearing?
- Check browser console for JavaScript errors
- Verify your API key is correct
- Ensure the script is loaded (check Network tab in DevTools)
- Check for CSS conflicts that might hide the widget
Next Steps
Once installed, you can:
- Customize the widget appearance in your dashboard settings
- Connect a tracker (Jira, Linear, GitHub, GitLab, Trello or Azure DevOps), or keep reports in the SnagRelay inbox
- Connect your coding agent over MCP: Cursor, Claude Code or Codex
- Invite your team members
Further Reading
- SnagRelay for coding agents: how a report reaches Cursor, Claude Code or Codex
- The MCP server: the tools your agent can call
- What every report includes
- Pricing
- Start free, no credit card required
