Installation
Paste one script tag. Keep shipping. The snippet loads the StageWhisper widget
asynchronously from our CDN, and the data-sw-key attribute identifies
your site — no build step, no SDK, and no redeploy when you change what the
widget shows.
Add the snippet
Copy the one-liner below and swap pub_your_site_key for the public
site key shown on your site’s install page in the dashboard.
<script async src="https://cdn.stagewhisper.co/loader.js" data-sw-key="pub_your_site_key"></script>
Where to paste it
Paste it before the closing </head> tag of every page where you
want feedback. The tag is async, so it never blocks your page render
— the widget mounts quietly once the page is up.
Advanced: call the JS API before load or strict CSP nonce
Most installs never need this. Reach for the queue stub instead of the one-liner when either applies:
-
You want to call the JS API before the widget finishes loading. The stub defines
window.StageWhisperimmediately and queues your calls, then replays them once the bundle is ready. -
You run a strict Content Security Policy and need to carry a nonce on the inline
tag. The stub reads the nonce from its own tag (with a
meta[name="csp-nonce"]fallback) and propagates it to the loader.
<script>
(function(w,d,k){w.StageWhisper=w.StageWhisper||function(){(w.StageWhisper.q=w.StageWhisper.q||[]).push(arguments)};
var c=d.currentScript,m=d.querySelector('meta[name="csp-nonce"]'),n=c&&(c.nonce||c.getAttribute('nonce'))||m&&m.content;
var s=d.createElement('script');s.async=1;s.src='https://cdn.stagewhisper.co/loader.js';
s.setAttribute('data-sw-key',k);if(n)s.setAttribute('nonce',n);d.head.appendChild(s)})(window,document,'pub_your_site_key');
</script>
Running a strict CSP? The Content Security Policy guide covers the exact directives and where the nonce goes for both install variants.
Install by framework
Prefer steps written for your stack? Every guide installs the same snippet — each one just shows its natural home in your framework.
Single-page apps
Keep the loader on the shell page — the document that boots your app — and install it once. The widget re-evaluates your URL rules whenever your app updates history state, so client-side navigation needs no extra wiring.
Verify your install
Refresh your app, then watch the site’s install status in the dashboard — it flips the moment the first ping arrives. New to StageWhisper? Getting Started walks the whole path from signup to first ping in about five minutes.
Widget not showing up? Head to Troubleshooting for the usual suspects — blocked origins, CSP, localhost, and stale config.