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 SDK - Custom data

Passing custom data to AI and Gleen system through SDK

Alhena AI chat SDK allows you to pass custom data to enhance user interactions. This data can be leveraged by the AI to provide more relevant responses and early processing for better user experience.

Example Usage

<script>
document.gleenConfig = {
    company: 'gleen',
    userMetadata: {
        'email': '<loggedin_user_email>',
        'firstName': '<loggedin_user_firstname>',
        'lastName': '<loggedin_user_lastname>'
    },
};
</script>
<script src="https://app.gleen.ai/sdk/gleenWidget.js"></script>

Custom User Data Guidelines

  • User Metadata Usage: You can include any fields within userMetadata to give the AI more context about the user.

    <script>
    document.gleenConfig = {
        company: 'gleen',
        userMetadata: {
            'firstName': 'John',
            'lastName': 'Doe'
        },
    };
    </script>
    <script src="https://app.alhena.ai/sdk/gleenWidget.js"></script>

    Including the user's name allows the AI to address them personally, creating a more engaging experience.

  • Data Passed to AI: Any field included in userMetadata will be available to the AI, unless the field key starts with an underscore (_). For instance:

    <script>
    document.gleenConfig = {
        company: 'gleen',
        userMetadata: {
            'firstName': 'John',
            '_internalId': '12345'
        },
    };
    </script>
    <script src="https://app.alhena.ai/sdk/gleenWidget.js"></script>

    In this example, firstName is available to the AI, while _internalId is not.

  • Handling Private Information: If you need to pass private data that should not be accessible to the AI (e.g., tokens, internal IDs), simply prefix the key with an underscore (_). For example:

    <script>
    document.gleenConfig = {
        company: 'gleen',
        userMetadata: {
            '_token': 'secretToken123'
        },
    };
    </script>
    <script src="https://app.gleen.ai/sdk/gleenWidget.js"></script>

    This ensures the data is only used internally by Alhena AI systems and not exposed to AI interactions.

  • Custom Fields in Helpdesk Tickets: If you wish to have certain metadata fields inserted as custom fields in your helpdesk system when a ticket is created, please contact the Alhena AI team. Our team can enable these fields for you from the backend. A user-friendly interface to manage this process directly from the dashboard will be available soon.

For any questions or assistance, feel free to reach out to our support team.

PreviousShow the Alhena AI widget only when someone scroll the page by 5 pxNextWebsite SDK - Customer data with Agent

Last updated 14 days ago