API Authentication
API Keys
Section titled “API Keys”Generate API keys in your workspace settings:
- Go to Settings → API Keys
- Click Create API Key
- Copy the key (shown only once)
Key Types
Section titled “Key Types”| Type | Prefix | Use Case |
|---|---|---|
| Public | pk_ | Client-side tracking |
| Secret | sk_ | Server-side API calls |
Using API Keys
Section titled “Using API Keys”Include in the Authorization header:
curl -X GET \ https://analyze-api.thismatters.workers.dev/api/v1/analytics/overview \ -H "Authorization: Bearer sk_live_xxxxx"Key Rotation
Section titled “Key Rotation”To rotate a key:
- Create a new key
- Update your applications
- Delete the old key
Security
Section titled “Security”- Never expose secret keys in client-side code
- Use public keys only for tracking
- Rotate keys if compromised