Alhena
  • Introduction
  • Getting Started
  • Architecture
  • Reference
    • Website SDK
      • Configure Proactive Nudges
    • Product FAQs
    • Website chatsdk events
    • Website chatsdk APIs
    • Chat SDK api and events examples
      • Open other external widget once human transfer is initiated
      • Show the Alhena AI widget only when someone scroll the page by 5 px
    • Website SDK - Custom data
      • Website SDK - Customer data with Agent
    • Website SDK - Internationalization
    • API Reference
      • API calls
    • Device Compatibility
  • Tutorials
    • AI Training
      • Training Steps
      • Training Data Sources
        • Websites
        • Youtube videos
        • Google Drive
        • Twitter Pages
        • Discord Messages
        • Confluence Pages
        • Upload Documents
        • Github
        • Zendesk Tickets
        • Freshdesk Tickets
        • Freshchat Tickets
        • Custom data sources
        • Shopify API
        • Woocommerce API
        • PDF Crawling
      • Training Frequently Asked Questions
    • Tuning Alhena AI Post Training
      • Best Practices for configuring the Alhena AI’s personality and guidelines
      • Adding Human Feedback for improving specific Questions
      • Adding to your knowledge base with FAQs
      • Frequently Asked Questions - Tuning Responses
    • QAing Al Conversations
      • Smart Flagging: Streamline Your AI Quality Assurance
    • Integrations
      • Alhena Website Chat SDK
        • Customizing Your Alhena Chat Widget
      • Integrating Alhena AI With Slack
      • Integrating Alhena AI With Discord
      • Integrating Alhena With Freshdesk
      • Integrating Alhena AI With Zendesk
      • Integrating Alhena AI With Email
      • Integrating Alhena AI With Shopify
      • Integration Alhena AI With Trustpilot
      • Integrating Alhena With Gorgias
    • Notifications
    • Alhena Dashboard
      • Managing Team
Powered by GitBook
On this page
  1. Reference

Website chatsdk events

Alhena AI chat sdk emits the following js events, that can be used to customize the user expriences

widget:opened - This is called when widget successfully get opened

widget:closed - This is called when the widget successfully get closed

widget:loaded - This is called when the widget successfully loaded and reading to do the integration

ticket:agent_handoff: This is called when AI successfully created the ticket in help desk after human user has submitted the email in human hand off.

ticket:agent_handoff_initiated: This is called when AI detects that it needs to send the prompt for email ask. At this stage AI is awaiting email from user to submit in the form. Once user submits the form a ticket is created and ticket:agent_handoff is called.

ticket:message_submitted: This is called when user sends a message in the widget.

ticket:bot_response_finished: This is called when AI response is delivered in the widget

For e-commerce companies there are additional chat events sent in the sdk

product:added_to_cart : This is called when customer clicks add to cart inside the chat widget

product:page_opened : This is called when custome opens a product link rendered inside the chat widget

product:displayed: This is called when a product is rendered as a card inside the Gleen chat widget.

faqs:question_clicked : This is called when AI generated FAQ is clicked

 window.gleenWidget.on('faqs:question_clicked', function(question_text) {
   console.log('question text clicked. Question Text ' + question_text);
 });

faqs:message_submitted : This is called when end user submits message in text box in product FAQ.

 window.gleenWidget.on('faqs:message_submitted', function(user_message) {
   console.log('User asked question in product FAQ. User message is' + user_message);
 });

faqs:bot_response_finished: This is called when AI completes the streaming of response. It is applicable for both Product FAQ question clicked and message submitted in the text box.

 window.gleenWidget.on('faqs:bot_response_finished', function(response_text) {
   console.log('AI Finished the response. Response is ' + response_text);
 });
PreviousProduct FAQsNextWebsite chatsdk APIs

Last updated 14 days ago