The middleware handles verification, SSR and WebSocket without exposing secrets to the browser.
Next.js, PHP/PSR-15, Laravel, React, Vue and Ruby are presented as complementary integration examples in this documentation. For a commercial deployment, use only generic Node, Express 4/5 or Fastify, inject secrets through a secret manager and verify the healthcheck and WebSocket after deployment. Never copy the secret into a client bundle.
SDK
Choose your framework.
Install
Configure
Test
Depending on your rules, Shugoi can reject clients that execute neither JavaScript nor the proof of work. A plain User-Agent is not enough.
Automated testing
Test locally with a dedicated database, then in production with separate secrets. Always restore configuration in a finally block.
Playwright / Node.js
cURL, Puppeteer and Selenium
Scenarios and troubleshooting
- whitelist and native error pages on/off
- SSR rendering and WebSocket bootstrap
- revoked key, then rejected
- 200/400/401/403/404 responses
- Tor, headless and regular browser
Check HTTP status, console, MIME type, WebSocket and SDK version. Redact secrets and use a key identifier.
Internal API keys
The internal key automates configuration; it is distinct from the siteKey and middleware secret. Create it in the dashboard and copy it once.
Endpoints
Payload and statuses
200 applied; 400 invalid payload; 401 missing or revoked key; 403 operation not permitted; 404 site or key not found. Writes are audited, caches invalidated and WebSocket streams notified.
Rotation and security
- Create a new key.
- Deploy it through a secret manager.
- Verify the call, then revoke the old key.
- Never expose it in a browser, Git, screenshot or client bundle.


