Website SDK

Install via Alhena JS SDK

You can install Alhena chat widget though the JavaScript SDK, allowing the users to interact with your AI agent through any page on your website.

Example Alhena AI Widget

Make sure to replace company with your company. company is the word after dashboard in the dashboard url e.g. If this is your dashboard url https://app.alhena.ai/dashboard/gleen/ then company is gleen

You can also find the snippet code in the Alhena dashboard by navigating to Integrations > Website > Installation.

Based on your region, API_BASE_URL can be

Final snippet code after updating URL will be if API_BASE_URL = https://eu.alhena.ai

Alhena SDK JavaScript functions

The Alhena Chat SDK has a number of functions that can be configured to change the experience.

The Following methods are exposed in the SDK

open - Opens the chat window. If it is already opened it will leave the chat widget as it is

close - Closes the chat window. If it is already closed it will leave the chat sdk as it is on UI.

toggle - Closes the chat window if it is opened and vice - versa.

sendMessage - Opens the widget with the given message send from the user's perspective.

See Website SDK JavaScript APIs for more details and APIs available.

Example code

Loading the widget only after the user has scrolled

On page load, you can set the SDK to not show the chat widget and only show it after user has scrolled some number of pixels.

Customize the look and feel

You can customize the general look and feel from the Website settings under Integrations in the dashboard. The SDK has some properties that can be customize as per the need.

styles can take the parameter fontFamily

Please make sure your website has logic to load the font. The SDK doesn't load any font. Any font famility passed in must be loaded by your site's own code.

Last updated