Key types
| Key | Use | Where it belongs |
|---|---|---|
| Secret key (sk_) | Server-side API requests | Your trusted backend only |
| Publishable key (pk_) | Embed widget; GET /me can also identify the key | Public widget configuration |
Key prefixes also include mode: sk_live_ / pk_live_ for production, and sk_test_ / pk_test_ for the sandbox.
Send keys
For server-side API routes, send a secret key as Authorization: Bearer sk_live_xxx. GET /me accepts either Authorization or X-PrinPoll-Key. Widget routes use a publishable key in the key query parameter and, except frame-policy, the embed_origin query parameter; widget browser calls are made by PrinPoll's iframe.
Server-side authorization header
Authorization: Bearer sk_live_xxxLive and test modes
Live keys work on the production deployment. Test keys work only on the separate sandbox deployment. Production rejects test keys, and the sandbox rejects live keys. Sandbox payments are simulated and do not move real money.
Key lifecycle
- A secret key is displayed only once at creation or regeneration. Store it securely when it is issued.
- Revoke a key to stop it immediately.
- Regenerate a key to revoke the old key and issue a replacement. Update your server configuration with the new key.
- Publishable keys are public by design and may be shown again in the dashboard.