Authentication
How to authenticate with the Drimer Partner API and generate session tokens.
Amelia uses a two-step authentication flow. Your backend generates a session token from the Partner API using your secret key, then passes the token to the frontend widget.
Flow overview
1. Generate a token
Make a server-side POST request with your secret key in the Authorization header:
curl -X POST https://api-core.drimer.io/api/partners/v1/generate-token \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk_live_your_secret_key" \
-d '{
"name": "Agent Name",
"email": "[email protected]"
}'Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Name of the agent |
email | string | Yes | Email of the agent |
Response
{
"token": "session_token_string..."
}2. Pass the token to the frontend
The token from the response is the token parameter in Drimer.init():
Drimer.init({
publicKey: "pk_live_your_key_here",
token: tokenFromBackend,
element: "#amelia",
});Security considerations
- Never expose your secret key in client-side code. Token generation must happen server-side.
- Generate a fresh token for each agent session.
- The
publicKeyis safe to include in frontend code — it only identifies your partner account.