AmikaClient needs a credential for every request. Provide exactly one of
three options:
apiKey: a static Amika API key. This is the usual choice.accessToken: a static bearer token.tokenSource: an object the client calls each time it needs a token.
Static key
The simplest case: pass a key string you already have.The TokenSource interface
For tokens that need to be fetched or refreshed, implement TokenSource:
token() for every request. Returning a promise lets you
fetch or refresh on demand.
A refreshing token source
The client awaitstoken() on each request, so you can cache and refresh
inside it.
fetchTokenFromYourAuthService stands in for your own credential-loading
code.
The SDK never reads
AMIKA_API_KEY from the environment or disk on your
behalf. Sourcing the credential, from an env var, a secret manager, or an
auth service, is always the caller’s responsibility.