11.14.0-rc.053e3fe • Published 6 months ago

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

Weekly downloads
-
License
MIT
Repository
github
Last release
6 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

7 months ago

11.11.1-rc.8be83f9

9 months ago

10.12.0-rc.bfdbbcc

10 months ago

11.11.0-rc.5951c36

10 months ago

10.13.0-rc.266829d

8 months ago

11.10.1-rc.63188d3

10 months ago

11.8.1-rc.322145e

12 months ago

11.8.1-rc.e4e8f8d

12 months ago

11.13.1-rc.6e5d816

7 months ago

11.12.1-rc.ad440e4

8 months ago

11.9.1-rc.fd1e19a

10 months ago

10.10.1-rc.59bd3f3

10 months ago

11.9.0-rc.429cdbb

12 months ago

11.13.1-rc.c8e6213

7 months ago

11.9.1-rc.65e7c53

10 months ago

11.9.1-rc.26ccead

10 months ago

11.12.0-rc.3487a55

8 months ago

10.12.1-rc.f272f08

9 months ago

11.12.1-rc.806f8a1

8 months ago

11.8.1-rc.8c3605d

12 months ago

11.11.0-rc.021fc7c

10 months ago

11.9.1-rc.a52af47

10 months ago

11.13.1-rc.3187427

7 months ago

11.9.0-rc.60c226c

11 months ago

11.13.0-rc.21d419f

8 months ago

11.9.1-rc.bea113f

11 months ago

11.9.0-rc.d37e8f3

11 months ago

10.10.0-rc.325241d

12 months ago

11.9.0-rc.e0a3396

11 months ago

11.13.1-rc.f6fb8fb

7 months ago

11.11.1-rc.c55adaf

9 months ago

11.13.1-rc.0df5765

7 months ago

10.12.1-rc.f5688b5

9 months ago

11.13.1-rc.d7122ad

7 months ago

11.9.0-rc.6331ff2

12 months ago

10.10.0-rc.87f3a7b

11 months ago

11.8.1-rc.4cba721

12 months ago

11.9.1-rc.2cb3c80

11 months ago

11.11.1-rc.14fc9ae

9 months ago

11.9.1-rc.012f17e

10 months ago

10.10.1-rc.6cbf29a

10 months ago

11.10.1-rc.9b8a78f

10 months ago

11.14.0-rc.39e4f60

6 months ago

11.11.0-rc.4bcafb2

10 months ago

11.11.0-rc.5c05e84

10 months ago

11.10.0-rc.62e8378

10 months ago

11.12.0-rc.dab762e

8 months ago

11.9.0-rc.882d7ba

12 months ago

10.3.0-rc.bb1a795

7 months ago

11.9.1-rc.50a6a2d

11 months ago

10.10.1-rc.f0deb99

11 months ago

10.10.0-rc.533efd5

12 months ago

10.13.1-rc.6ca1438

8 months ago

11.9.0-rc.b1b4542

12 months ago

11.13.1-rc.295622d

7 months ago

11.10.1-rc.860da8d

10 months ago

10.10.1-rc.6a33dd2

11 months ago

10.9.1-rc.ab8a7f1

12 months ago

11.11.1-rc.ba238f3

9 months ago

11.10.0-rc.52ea069

10 months ago

10.10.1-rc.6264383

10 months ago

11.8.1-rc.3a63457

12 months ago

10.15.0-rc.de6926a

7 months ago

11.9.1-rc.ceaa91b

10 months ago

11.12.1-rc.142af00

8 months ago

11.8.1-rc.165c5ec

12 months ago

11.9.1-rc.5883d46

10 months ago

11.9.1-rc.ee83136

10 months ago

11.9.1-rc.f5b3cf9

11 months ago

11.10.1-rc.fcc58c9

10 months ago

11.8.1-rc.a3c2f44

12 months ago

10.10.1-rc.386e038

11 months ago

10.13.0-rc.25a26f6

9 months ago

11.9.1-rc.15ab03e

11 months ago

11.10.1-rc.7596001

10 months ago

11.10.1-rc.5e004ec

10 months ago

11.8.1-rc.3459eb2

12 months ago

11.9.0-rc.ab36c93

12 months ago

10.14.0-rc.9b4e8b7

8 months ago

11.9.0-rc.0557ea1

11 months ago

11.9.0-rc.9d91139

12 months ago

11.12.0-rc.5986eb1

9 months ago

11.9.1-rc.c896fdc

11 months ago

11.9.1-rc.f798039

10 months ago

11.10.1-rc.ed38066

10 months ago

11.9.1-rc.617b873

10 months ago

11.10.1-rc.0f2cc35

10 months ago

11.9.1-rc.ce38ed7

11 months ago

10.10.0-rc.c4768f0

12 months ago

11.14.0-rc.3ee35a9

7 months ago

11.9.1-rc.44e543f

10 months ago

11.9.1-rc.040c68a

10 months ago

11.9.0-rc.b7ba88e

11 months ago

10.10.0-rc.0548bfb

11 months ago

11.13.1-rc.cbf2336

7 months ago

11.11.1-rc.10d5c67

9 months ago

11.8.1-rc.02b75b5

12 months ago

11.10.1-rc.8c7d297

10 months ago

11.11.1-rc.dcdc0e8

9 months ago

10.10.0-rc.ab16458

11 months ago

10.13.0-rc.6a14a7f

8 months ago

11.8.1-rc.261dfdc

12 months ago

11.9.1-rc.1e0aa7e

11 months ago

11.13.1-rc.eb3b58a

7 months ago

11.10.0-rc.cc7e1bf

10 months ago

11.13.1-rc.2d50f37

7 months ago

11.9.1-rc.95b83a7

10 months ago

10.12.1-rc.1c34b86

9 months ago

11.12.1-rc.4199f60

8 months ago

11.9.0-rc.4c6a4b5

11 months ago

10.11.0-rc.03fd2d0

10 months ago

11.8.1-rc.303d7b5

12 months ago

11.11.1-rc.4f5bcc5

9 months ago

11.9.1-rc.ec66369

11 months ago

11.10.0-rc.02c2e14

10 months ago

11.14.0-rc.053e3fe

6 months ago

11.11.0-rc.f4da2c6

10 months ago

11.8.1-rc.8ff1d26

12 months ago

11.10.1-rc.3c545fc

10 months ago

10.15.0-rc.fbb5ef6

7 months ago

10.14.1-rc.74e0baf

7 months ago

11.9.1-rc.56c7fc1

10 months ago

11.12.1-rc.6d7bc80

8 months ago

11.9.1-rc.3db583a

10 months ago

11.14.0-rc.fe9603d

6 months ago

10.10.1-rc.16c79b9

11 months ago

11.8.1-rc.e020366

12 months ago

11.9.1-rc.06c7240

10 months ago

11.8.1-rc.36bb02c

12 months ago

11.9.1-rc.f020cdc

10 months ago

11.11.1-rc.030ea82

9 months ago

10.11.0-rc.e34674e

10 months ago

10.1.0-rc.962376

2 years ago