Temporary API token #841
-
|
I'm coming from AssemblyAI to get real-time diarization and ran into an issue: the need for a temporary token that goes away after a certain amount of time, like 60 minutes. This will provide an additional layer of security when calling Deepgram from a Chrome extension, as I can generate a temporary token from my server for the client to use. I searched the group and found a mention of an API to create a new API key (https://github.com/deepgram/deepgram-js-sdk/?tab=readme-ov-file#create-key) and one to delete a key, but those are permanent. If my program crashes or the user closes the browser, I might not get a chance to delete the key. I just want a key or token that is only valid for a limited time, similar to https://www.assemblyai.com/docs/speech-to-text/streaming#authenticate-with-a-temporary-token . I know I could stream all the audio data to a proxy on my server, but that would incur CPU and data transfer charges that I'd like to avoid. Having everyone's browser connect directly to Deepgram is much more scalable. I'm assuming I can get around the CORS problem mentioned by the doc in my Chrome extension—if not, then I'll just have to use a proxy. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
See https://deepgram.com/learn/protecting-api-key