SDK Reference
Usage in Production
Securely deploy Anam AI in production environments
Overview
When deploying to production, it’s important not to expose your API key publicly. Instead, you should:
- Exchange your API key for a short-lived session token on the server side
- Pass this token to the client
- Initialize the Anam SDK with the session token
Getting a Session Token
From your server, make a request to get a session token:
Client Initialization
Once you have a session token, use the createClient
method to initialize the Anam client:
The client exposes the same methods whether initialized with an API key or session token.
Understanding a Session
The sequence diagram below shows how a typical session is started.
Next Steps
Was this page helpful?