Skip to main content
The relay is your own code that calls @waniwani/relay. It runs in front of your website, as a proxy, a Worker or a Lambda@Edge function. For ASP.NET on IIS, the relay is a NuGet package that runs as an IIS module. The package is open source under Apache 2.0, and it has no runtime dependencies. The README is the full API reference.

Functions

The setup screen uses these functions: The setup screen adds serveAgentPage or handleViewerRequest when the website serves agent pages or blocks an agent. No function throws an error, and no promise rejects. An error in the relay does not break your page. Your code always sends the request on to your site.

The key

All websites of your organization use one key. Copy it from the setup screen and keep it secret. Without a valid key, the relay sends nothing. For an organization in the EU region, the code from the setup screen has region: "eu".

What Waniwani receives

For each agent request, Waniwani receives one JSON event. The event has the method, the host, the path, the time and a short list of request headers.
  • The client IP does not leave your server. Waniwani gets only an HMAC-SHA256 hash of it, made with your key.
  • Cookies and the request body do not leave your server.
  • For Authorization, only the scheme name leaves, for example Bearer.
Use the omit option to send less. The README has the full field list and the options.

Which requests are agent requests

A request is an agent request when one of these is true:
  • Its User-Agent has a name from the Waniwani AI bot list.
  • It has a Signature-Agent or a DPoP header.
  • Its IP is in a range that an AI company publishes.
Googlebot, Bingbot, browsers and curl are not agent requests. The relay gets the newest list every 12 hours. You do not deploy again. Source: src/logic.

Relay status

Open the website and go to Settings. The Relay card shows the status of the relay: The Relay package row shows the version of the relay: The Relay code row shows which relay functions your code calls:

Update the relay

  • On Vercel, Cloudflare and self-hosted Next.js, update the @waniwani/relay package and deploy.
  • On ASP.NET, update the Waniwani.Relay.AspNet NuGet package and deploy.
  • On CloudFront, download the zip again from the setup screen and deploy it.

Troubleshooting

The page must be a public https page of the website. The deploy must be complete. A firewall or a bot protection rule can stop the check. The check sends one GET request.
Make sure that the key is set for production. Make sure that you deployed after you set the key. Make sure that the relay runs on the path that you check. After 10 minutes, the setup screen shows Still no agent request.
Keep it. Put the lines of the relay at the top of your function.