Key types
Secret key (sk_*)
The secret key grants full access to all API endpoints. Use it server-side only — in your backend, serverless functions, or CI pipelines. Never expose it in client-side code, browser bundles, or mobile apps.
Public key (pk_*)
The public key is restricted to a single endpoint: /v1/track. It is safe to expose in client-side applications because it can only track events — it cannot read or modify any project data.
Which key to use
| Endpoint | Key required |
|---|---|
/v1/track (event tracking) | Public key (pk_*) or secret key |
| All other endpoints | Secret key (sk_*) |
Passing a key in requests
All API requests authenticate using theAuthorization header with a Bearer token.
Managing API keys in the dashboard
You can find your API keys in Project Settings → API Keys.Navigate to API Keys
Select the API Keys tab. Your public key and secret key are both displayed here.
Regenerating keys
If you believe a key has been compromised, regenerate it immediately from Project Settings → API Keys.Security best practices
- Store secret keys in environment variables, not in source code or version control.
- Use the public key in any code that runs in the browser or on a user’s device.
- Rotate keys periodically as part of your security hygiene.
- Audit access logs if you suspect unauthorized use.
- Never log API keys in application output or error messages.