Skip to content

feat: add article managing-short-lived-api-keys #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 21, 2024
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Managing Short-Lived API Keys in Deepgram

Managing API keys efficiently is crucial for establishing secure and effective connections to Deepgram's speech-to-text API. Implementing short-lived API keys is a robust method to enhance security, particularly for in-browser applications. This article will guide you through key considerations when using short-lived API keys.

## Understanding API Key Management

When designing your system to handle short-lived API keys, it's essential to consider the lifecycle of these keys — from creation, active use, to deletion. Here's a basic run-through of the actions:

1. **Creating API Keys**: Generate API keys for user sessions and associate them with user profiles to track usage.
2. **Using API Keys**: Establish a secure connection using the API key. Ensure API keys are never exposed in client-side code.
3. **Deleting API Keys**: After successfully establishing a connection, delete the API key to prevent unauthorized reuse.

### Additional Considerations:

- **Tracking Usage**: By associating API keys with users, you can monitor and detect any suspicious activity.
- **Setting Expiration**: Assign a short expiration to API keys (e.g., 10 seconds) to limit potential misuse.
- **Rate Limiting**: Implement rate limiting to safeguard against abuse of API calls.

## Conclusion

By implementing short-lived keys with these considerations, you can maintain a secure connection environment for your Deepgram integrations. Remember, owing to no automatic expiration policy in Deepgram, manual cleanup is crucial.

## References
- [Deepgram SDK Documentation](https://developers.deepgram.com/docs/getting-started-with-pre-recorded-audio)
- [Deepgram API Management](https://developers.deepgram.com/docs/security)