How to keep your tokens safe
1. Use environment variables and a proper secret store
Never hardcode yourclient_secret in source files. Use environment variables and a secure secret manager provided by your cloud platform or infrastructure. Rotate secrets if exposure is suspected.
2. Never expose credentials in frontend or untrusted environments
Client credentials must only live on trusted servers. Do not embed them in browser code, mobile apps, desktop apps, or any environment you cannot fully control. Instead, your backend should request access tokens, validate requests, and decide what your users can do.You should never expose client credentials to a frontend application. In some applications it is however not possible to avoid passing anaccessTokento the frontend. In these cases, you can limit the scope of the token by requesting a token with an explicit scope of eithertranscribeand/orstreamsset. This will restrict the token to streaming APIs.
3. Use a backend proxy to handle all Corti API calls from frontends
When you need a frontend to be able to call the Corti API, it is advised to use a proxy. This means all requests are through a proxy that you control. The proxy injects authentication, performs validation, and enforces user-level rules.

How your proxy authenticates and forwards requests between the client and the Corti API.