Secure API access with authentication keys and tokens, including best practices for key management.
API Key Types
Different key types for different use cases:
- Public Keys: Client-side integrations (limited access)
- Secret Keys: Server-side integrations (full access)
- Read-only Keys: Data access without modification
- Scoped Keys: Limited to specific endpoints
Generating API Keys
Create API keys from your dashboard:
- Go to Settings > API Keys
- Click "Generate New Key"
- Select key type and permissions
- Add description and expiration date
- Save the key securely
Authentication Methods
Bearer Token (Recommended)
Authorization: Bearer YOUR_API_KEY
Query Parameter
GET /api/v1/visitors?api_key=YOUR_API_KEY
Header Authentication
X-API-Key: YOUR_API_KEY
Security Best Practices
- Store keys securely in environment variables
- Use HTTPS for all API requests
- Rotate keys regularly
- Monitor API usage for anomalies
- Revoke compromised keys immediately