@koreai/agentai-web-sdk
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

Agent AI Web SDK

Kore.ai offers the Agent AI Web SDK, a versatile and customizable solution for integrating Agent AI into your web application. It is built using JavaScript, Preact, and CSS/SCSS, enabling dynamic HTML generation and customization through a comprehensive event system.

With just few lines of code, you can embed our Kore.ai Agent AI Web SDK into your applications to enable end-users to interact with your applications using Natural Language. For more information, refer to

Agent AI Web SDK

💡 Getting Started

First, install Agent AI web SDK via the npm package manager:

npm install --save npm i @koreai/agentai-web-sdk

Get AAWindow and AAConfig

import { AAConfig, AAWindow } from '@koreai/agentai-web-sdk';

Configure AAConfig

    let aaConfig = AAConfig;
    aaConfig.connectionDetails = {
        conversationId: "PLEASE_ENTER_CONVERSATION_ID",
        botId : "PLEASE_ENTER_BOT_ID",
        domainURL: "PLEASE_ENETR_DOMAIN_URL",
        token: "PLEASE_ENTER_TOKEN",
        interactiveLanguage: "PLEASE_ENTER_LANGUAGE",
        customData: "PLEASE_ENTER_CUSTOM_DATA",
        userName: "PLEASE_ENTER_USER_NAME",
        channel: "PLEASE_ENTER_CHANNEL",
        sessionId: "PLEASE_ENTER_SESSION_ID",
        summaryEnabled: "PLEASE_ENTER_SUMMARY_ENABLED"
    };
    aaConfig.container = 'aa-web-sdk';
    aaConfig.branding.colors.primay = '#2970FF';

    /* 
        Important Note: These keys are provided here for quick demos to generate JWT token at client side but not for Production environment.
        Refer below document for JWT token generation at server side. Client Id and Client secret should maintained at server end.
        https://developer.kore.ai/docs/bots/sdks/user-authorization-and-assertion/
    **/

Create AAWindow instance and trigger show method

    var chatWindowInstance = new AAWindow(aaConfig);
    chatWindowInstance.show(aaConfig);

💡 Using Agent AI via CDN

include the following script in your html file and configure bot configurations

<script src="https://cdn.jsdelivr.net/npm/@koreai/agentai-web-sdk@1.0.0/dist/umd/agentai-web-sdk-umd.min.js"></script> 
<script>
        var aaWindow=KoreAASDK.AAWindow;
        var aaConfig=KoreAASDK.AAConfig;

        aaConfig.connectionDetails = {
            conversationId: "PLEASE_ENTER_CONVERSATION_ID",
            botId : "PLEASE_ENTER_BOT_ID",
            domainURL: "PLEASE_ENETR_DOMAIN_URL",
            token: "PLEASE_ENTER_TOKEN",
            interactiveLanguage: "PLEASE_ENTER_LANGUAGE",
            customData: "PLEASE_ENTER_CUSTOM_DATA",
            userName: "PLEASE_ENTER_USER_NAME",
            channel: "PLEASE_ENTER_CHANNEL",
            sessionId: "PLEASE_ENTER_SESSION_ID",
            summaryEnabled: "PLEASE_ENTER_SUMMARY_ENABLED"
        };
        aaConfig.container = 'aa-web-sdk';
        aaConfig.branding.colors.primay = '#2970FF';

        /* 
            Important Note: These keys are provided here for quick demos to generate JWT token at client side but not for Production environment.
            Refer below document for JWT token generation at server side. Client Id and Client secret should maintained at server end.
            https://developer.kore.ai/docs/bots/sdks/user-authorization-and-assertion/
        **/

        var chatWindowInstance = new aaWindow(aaConfig);
        chatWindowInstance.show(aaConfig);
        
</script>

/@koreai/agentai-web-sdk/

    Package Sidebar

    Install

    npm i @koreai/agentai-web-sdk

    Weekly Downloads

    10

    Version

    3.0.0

    License

    ISC

    Unpacked Size

    16.3 MB

    Total Files

    66

    Last publish

    Collaborators

    • rajasekharba-kore
    • sathishrambathini-kore