Website SDK - Customer data with Agent

Gleen chat sdk allows passing the custom data. This data will be passed to AI for early processing or giving more context about the users. There are cases when this data is too big and shouldn't be passed to AI e.g. if user data is behind an API. This can be done with custom agent that will accepts the token/api_call params from chat sdk.

To get started:

We need to create an API agent in Gleen helpdesk (Gleen team can help build api agent). These agents may require token specific to each user to fetch the information.This is how we can support via Gleen AI chat SDK. In this case tokens needs to be passed as a private variable. This token needs to pass from chat sdk init.

Sample code example showing how to pass the 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.gleen.ai/sdk/gleenWidget.js"></script>

</body>
</html>

Last updated