Authentication
The DGI API uses API keys to authenticate requests. You can view and manage your API keys in the DGI Dashboard.
API Key Authentication
Include your API key in the Authorization
header with the Bearer
prefix:
text
1
2
Authorization: Bearer YOUR_API_KEY
Example Request
text
1
2
3
curl https://api.dgi.com/v1/users/me \
-H "Authorization: Bearer sk_live_abc123..."
Security Best Practices
Keep Your Keys Safe
- Never commit API keys to version control
- Use environment variables to store keys
- Rotate keys regularly for enhanced security
- Use different keys for development and production
Environment Variables
text
1
2
3
4
5
6
// .env.local
DGI_API_KEY=sk_live_your_api_key_here
// Usage
const apiKey = process.env.DGI_API_KEY;
Rate Limiting
API keys are subject to rate limiting:
- Free tier: 100 requests per minute
- Pro tier: 1,000 requests per minute
- Enterprise: Custom limits
OAuth 2.0 (Coming Soon)
We're working on OAuth 2.0 support for more granular permissions and third-party integrations.