Gateway Kit security
The Gateway Kit runs in the browser. It authenticates with a gateway key: the ID of a live API key that carries the Gateway scope. The ID is not the key's secret, and the gateway key is designed to ship in client-side JavaScript. Anyone can copy it from your page, though, so treat it as public.
What makes it safe to expose is not secrecy but the limits you put on where funds can settle: turn on Require same owner or set a destination whitelist before the key goes into a browser. You set them in the Stridge Dashboard under Developer → Gateway Kit, in the kit's Settings. On a key you manage under API Keys, the same limits appear as Referrer whitelist and Gateway configuration.
Referrer whitelist
List the origins allowed to use the key, such as app.example.com or *.example.com. A browser request from any other origin is refused with 403, so another site can't embed your key in its own pages. Leave the list empty and any origin can use the key.
The whitelist is not caller authentication. Stridge reads the origin from the request's Origin or Referer header, and a script or server that copied your key can send whatever header it likes. Rely on Require same owner or a destination whitelist to decide where funds can settle; the referrer whitelist only keeps ordinary browsers on other sites out.
Require same owner
When Require same owner is on, every settlement must go to the owner address itself. Each deposit then settles back to the depositor's own wallet (the same-owner pattern), so the key can't move one user's funds to another address at all. It is on for every kit you create from Gateway Kit.
Destination whitelist
With Require same owner off, list the addresses funds may settle to. A request can then only ever settle to an address on the list, never to an attacker's. Leave the list empty to allow any destination.
The referrer whitelist and a destination limit are complementary: the first keeps other sites' browsers from using the key, the second controls where funds can go, and only the second holds against a caller that fakes its headers. Pick the destination limit that fits, a fixed whitelist for a treasury-style destination or Require same owner for same-owner funding, then set the referrer whitelist.
Next
- Gateway Kit — the integration and where these settings live.
- API keys — how a gateway key relates to your API keys.
- Usecases — the same-owner funding pattern in practice.
- IP allowlist — the equivalent control for server-side keys.