SnagRelayDocs
Installation

Script Tag

Add SnagRelay to any website or web app with one script tag.

The widget is a small button (or your own link, or a keyboard shortcut) that opens the report flow. It loads asynchronously and doesn't block your page.

On the project's Install tab, choose Script. The snippet there already contains your API key.

Install

Paste this before the closing </head> tag, on every page where people should be able to report:

<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>

Open your site. The Install tab's status flips to Live on your-site.com within a few seconds, with no refresh.

Shorter form

The loader initialises itself, so this one-liner works too. The setup wizard uses it:

<script src="https://app.snagrelay.com/widget/load/YOUR_API_KEY" async></script>

Use the longer form if you want a callback when the widget is ready.

Position, colours, button text, capture mode, markup tools, and form fields are all set from the dashboard (Project Setup). You don't touch the snippet again.

<!-- in <head> -->
<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>

Reporters don't need the floating button. Call SnagRelay.open() from anywhere on the page:

<a href="#" onclick="SnagRelay.open(); return false">Report a problem</a>

Handy in a help menu, a footer, or your own error message. You can also turn on a keyboard shortcut (default Alt+Shift+B) under Widget → Launch. See Launch.

Invited reporters only

Turn on Invited reporters only on the Install tab to keep the widget hidden until someone unlocks it from their invite email. Enter your site's address (for example example.com). See Your access.

A site behind a password

If your site or staging environment sits behind HTTP Basic Auth, turn on Site behind a password on the Install tab and enter the username and password. SnagRelay uses them so screenshots can load the page.

Prefer no embed script?

Use the Chrome extension channel instead. It injects the widget on the sites you list, after each person signs in.

On this page