11.14.0-rc.053e3fe • Published 8 months ago

@koredev/kore-web-sdk v11.14.0-rc.053e3fe

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Kore.ai SDK

Kore.ai offers Bots SDKs as a set of platform-specific client libraries that provide a quick and convenient way to integrate Kore.ai Bots chat capability into custom applications.

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

Bot SDKs

Web Socket Endpoints and Events

SDK Security

SDK App Registration

Message Templates

API Referernce

FAQ's

💡 Getting Started

First, install kore web SDK via the npm package manager:

npm install --save kore-web-sdk

Get chatWindow and chatConfig

import { chatConfig, chatWindow } from 'kore-web-sdk';

Configure ChatConfig

let botOptions=chatConfig.botOptions;
	
 botOptions.JWTUrl = "PLEASE_ENTER_JWTURL_HERE";
 botOptions.userIdentity = 'PLEASE_ENTER_USER_EMAIL_ID';// Provide users email id here
 botOptions.botInfo = { name: "PLEASE_ENTER_BOT_NAME", "_id": "PLEASE_ENTER_BOT_ID" }; // bot name is case sensitive
 botOptions.clientId = "PLEASE_ENTER_CLIENT_ID";
 botOptions.clientSecret = "PLEASE_ENTER_CLIENT_SECRET";
 /* 
 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 chat window instance and trigger show method

var chatWindowInstance = new chatWindow(chatConfig);
chatWindowInstance.show(chatConfig);

Examples

Click here to explore different variations how SDK can be consumed

Other options

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

<script  src="https://cdn.jsdelivr.net/npm/kore-web-sdk@11.14.0/dist/umd/kore-web-sdk-umd-chat.min.js"></script>
<script>
        //chat window declaration
        var chatConfig=KoreChatSDK.chatConfig;
        var chatWindow=KoreChatSDK.chatWindow;
        
        //create chat window instance
        var chatWindowInstance = new chatWindow();

        //configure bot configurations
        var botOptions=chatConfig.botOptions;
        botOptions.JWTUrl = "PLEASE_ENTER_JWTURL_HERE";
        botOptions.userIdentity = 'PLEASE_ENTER_USER_EMAIL_ID';
        botOptions.botInfo = { name: "PLEASE_ENTER_BOT_NAME", "_id": "PLEASE_ENTER_BOT_ID" }; // bot name is case sensitive
        botOptions.clientId = "PLEASE_ENTER_CLIENT_ID";
        botOptions.clientSecret = "PLEASE_ENTER_CLIENT_SECRET";
	/* 
	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/
	**/

        //show chatwindow
        chatWindowInstance.show(chatConfig);

</script>

Instructions

1.Open examples/umd/chat-with-plugins/index.html  
2.configure bot configurations   
3.Open same file in any browser 

💡 Custom Templates

In addition to the kore message templates, new custom templates can be intstalled into kore chat window with installTemplate method

class customTemplateComponent{
  renderMessage(msgData){
      if(msgData?.message[0]?.component?.payload?.template_type==='custom_stock_template'){
          return '<h2>My Template HTML</h2>';      
      }else{
          return false;
      }
  } 
}

chatWindowInstance.templateManager.installTemplate(new customTemplateComponent());

Other framework UI components like angular and react can also be injected with this

💡 Plugins

Kore's chatwindow functionlity can be extended with the help of plugins.Newly created plugins can be installed with installPlugin method

class KoreCustomPlugin{
  
}

chatWindowInstance.installPlugin(new KoreCustomPlugin());

Kore offered plugins are listed here

11.13.1-rc.1fd9cc5

8 months ago

11.11.1-rc.8be83f9

11 months ago

10.12.0-rc.bfdbbcc

11 months ago

11.11.0-rc.5951c36

11 months ago

10.13.0-rc.266829d

10 months ago

11.10.1-rc.63188d3

12 months ago

11.13.1-rc.6e5d816

8 months ago

11.12.1-rc.ad440e4

10 months ago

11.9.1-rc.fd1e19a

12 months ago

10.10.1-rc.59bd3f3

12 months ago

11.13.1-rc.c8e6213

8 months ago

11.9.1-rc.65e7c53

12 months ago

11.9.1-rc.26ccead

12 months ago

11.12.0-rc.3487a55

10 months ago

10.12.1-rc.f272f08

11 months ago

11.12.1-rc.806f8a1

9 months ago

11.11.0-rc.021fc7c

11 months ago

11.9.1-rc.a52af47

12 months ago

11.13.1-rc.3187427

8 months ago

11.13.0-rc.21d419f

9 months ago

11.13.1-rc.f6fb8fb

8 months ago

11.11.1-rc.c55adaf

11 months ago

11.13.1-rc.0df5765

8 months ago

10.12.1-rc.f5688b5

10 months ago

11.13.1-rc.d7122ad

8 months ago

11.11.1-rc.14fc9ae

10 months ago

11.9.1-rc.012f17e

12 months ago

10.10.1-rc.6cbf29a

12 months ago

11.10.1-rc.9b8a78f

11 months ago

11.14.0-rc.39e4f60

8 months ago

11.11.0-rc.4bcafb2

11 months ago

11.11.0-rc.5c05e84

11 months ago

11.10.0-rc.62e8378

12 months ago

11.12.0-rc.dab762e

10 months ago

10.3.0-rc.bb1a795

8 months ago

11.9.1-rc.50a6a2d

12 months ago

10.13.1-rc.6ca1438

10 months ago

11.13.1-rc.295622d

9 months ago

11.10.1-rc.860da8d

11 months ago

10.10.1-rc.6a33dd2

12 months ago

11.11.1-rc.ba238f3

11 months ago

11.10.0-rc.52ea069

12 months ago

10.10.1-rc.6264383

12 months ago

10.15.0-rc.de6926a

8 months ago

11.9.1-rc.ceaa91b

12 months ago

11.12.1-rc.142af00

10 months ago

11.9.1-rc.5883d46

12 months ago

11.9.1-rc.ee83136

12 months ago

11.10.1-rc.fcc58c9

12 months ago

10.13.0-rc.25a26f6

10 months ago

11.10.1-rc.7596001

12 months ago

11.10.1-rc.5e004ec

11 months ago

10.14.0-rc.9b4e8b7

9 months ago

11.12.0-rc.5986eb1

10 months ago

11.9.1-rc.f798039

12 months ago

11.10.1-rc.ed38066

11 months ago

11.9.1-rc.617b873

12 months ago

11.10.1-rc.0f2cc35

11 months ago

11.14.0-rc.3ee35a9

8 months ago

11.9.1-rc.44e543f

12 months ago

11.9.1-rc.040c68a

12 months ago

11.13.1-rc.cbf2336

8 months ago

11.11.1-rc.10d5c67

11 months ago

11.10.1-rc.8c7d297

11 months ago

11.11.1-rc.dcdc0e8

11 months ago

10.13.0-rc.6a14a7f

10 months ago

11.9.1-rc.1e0aa7e

12 months ago

11.13.1-rc.eb3b58a

8 months ago

11.10.0-rc.cc7e1bf

12 months ago

11.13.1-rc.2d50f37

8 months ago

11.9.1-rc.95b83a7

12 months ago

10.12.1-rc.1c34b86

11 months ago

11.12.1-rc.4199f60

9 months ago

10.11.0-rc.03fd2d0

12 months ago

11.11.1-rc.4f5bcc5

11 months ago

11.9.1-rc.ec66369

12 months ago

11.10.0-rc.02c2e14

12 months ago

11.14.0-rc.053e3fe

8 months ago

11.11.0-rc.f4da2c6

11 months ago

11.10.1-rc.3c545fc

11 months ago

10.15.0-rc.fbb5ef6

8 months ago

10.14.1-rc.74e0baf

9 months ago

11.9.1-rc.56c7fc1

12 months ago

11.12.1-rc.6d7bc80

9 months ago

11.9.1-rc.3db583a

12 months ago

11.14.0-rc.fe9603d

8 months ago

10.10.1-rc.16c79b9

12 months ago

11.9.1-rc.06c7240

12 months ago

11.9.1-rc.f020cdc

12 months ago

11.11.1-rc.030ea82

10 months ago

10.11.0-rc.e34674e

12 months ago

10.1.0-rc.962376

2 years ago