Website SDK - Customer data with Agent
Alhena’s Chat SDK lets you pass both public metadata (for AI prompts) and private tokens (for internal API calls) in a single config—so you can personalize conversations without ever exposing secrets.
1. Public vs. Private Metadata
Private: any key starting with
_
(e.g._bearer_token
) is hidden from the AI and only available to your custom agents.Public: keys without an underscore (e.g.
email
,locale
) are merged into the AI context for personalization.
2. API Tools in the Dashboard
If you'd like to pass API credentials that will be used to call custom tools, letting the AI take actions or gather extra information, you can create custom API tools in the dashboard self‑serve, or let Alhena build it for you (additional service fee applies).
Example of how to pass a private API token
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<!-- Loading of chat SDK -->
<script>
// NOTE: the bearer token can be extracted from the browser/network call
// using javascript
let user_bearer_token = "<bearer_token_value>"
document.gleenConfig = {
company: 'gleen',
userMetadata: {
"_bearer_token" : user_bearer_token
},
};
</script>
<script src="https://app.alhena.ai/sdk/gleenWidget.js"></script>
</body>
</html>
Last updated