The two keys
Publishable — pk_…
Public by construction. It ships in your page source, where any script
on the page can read it. That is expected. What controls access is the
request origin, not secrecy.
Secret — sk_…
A bearer credential with full workspace authority. Server-to-server
only. Never in a browser, never in client-side code, never in a repository.
Which key reaches what
The gate is exact in both directions.
/v1/users resolves your key with a
publishable key explicitly excluded, so a pk_… lifted from a page cannot reach
it — and it emits no CORS headers at all, so it is not callable from a page by
construction. Equally, the widget’s endpoints resolve with a secret key
excluded, so a secret key sent there returns 401.
How to send a key
Secret key — as a bearer token, or in the Peeve header:Sending an
Origin header matters. From a browser it is set for you. From
cURL or a server you must set it yourself, or the origin check will refuse the
request in production.What a key resolves to
A key resolves to exactly one workspace, and that is the tenant boundary. The workspace id comes from the validated key — never from anything in the request body — so nothing a caller sends can reach another workspace’s data. Key lookups are cached briefly (20 seconds). This is what bounds how long a revoked key or a flipped kill switch takes to take effect: within 30 seconds, and immediately for the kill switch, which clears the cache when it flips.Next
Creating and rotating keys
Where keys come from, how they are stored, and how to rotate one safely.
Origins
The exact rule that makes a public key safe to publish.