Domain whitelist
Restrict your API key so it only works on domains you control. This limits exposure if your key is ever scraped from your front-end code. A key with an empty domain list is unrestricted: no origin check is made and it works from any website or server.How to configure
- In your dashboard, go to API Keys.
- Click Security on the key you want to restrict.
- Under Allowed domains, add your domains.
https://www.example.com/page becomes example.com).
How matching works
The server reads the request origin from the first of these headers that is present:X-Widget-Origin, Origin, Referer. It keeps the hostname, removes a leading www., and compares it with each entry (also stripped of www.).
No regex, no wildcard syntax — entering
kookai.fr is enough to cover your entire domain and all its subdomains.
Effect on requests
- Widget requests include an
Originheader automatically (set by the browser) - Direct API calls must include an
Origin(orReferer) header manually when restrictions are active - Requests with no such header receive
403 Origin header required when domain restrictions are active - Requests from a non-whitelisted origin receive
403 Domain not authorized for this API key
Server-to-server calls
Server-side calls don’t have a browserOrigin. Two options:
- Remove domain restrictions for keys used exclusively server-side
- Add your server’s domain to the whitelist and send it as the
Originheader
The origin header is set by the caller, so this check protects against accidental use from other sites, not against a caller who sets the header deliberately. Keep server-side keys on your server.