11.6.1-rc.e152598 • Published 8 months ago

@koredev/kore-web-sdk v11.6.1-rc.e152598

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.6.1/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.6.1-rc.5ac4dc0

8 months ago

11.6.1-rc.1c40027

8 months ago

11.6.1-rc.5d68655

8 months ago

11.6.1-rc.3153337

8 months ago

11.6.1-rc.36fe24e

8 months ago

11.6.1-rc.f64f6b4

8 months ago

11.6.1-rc.e152598

8 months ago

11.6.1-rc.74cbd55

8 months ago

11.6.1-rc.7e8aeb8

8 months ago

11.6.0-rc.8797df4

8 months ago

10.7.1-rc.f402a1f

8 months ago

10.7.0-rc.3e7b015

8 months ago

11.6.0-rc.f7643ec

8 months ago

11.6.0-rc.c4f5052

8 months ago

10.7.1-rc.2caf3ab

8 months ago

10.7.0-rc.0d4bac5

9 months ago

11.6.0-rc.2e56472

9 months ago

10.7.0-rc.36f7b81

9 months ago

11.6.0-rc.d6b8a29

9 months ago

11.6.0-rc.14091f8

9 months ago

11.6.0-rc.bc5c4e7

9 months ago

11.6.0-rc.0fe663e

9 months ago

11.6.0-rc.ec4fe81

9 months ago

11.6.0-rc.358af27

9 months ago

11.6.0-rc.ee77c09

9 months ago

11.5.1-rc.7e177eb

9 months ago

11.5.1-rc.72c7384

9 months ago

11.5.0-rc.cd82574

9 months ago

11.5.0-rc.877bafe

9 months ago

11.5.0-rc.3fa1a3d

9 months ago

10.6.1-rc.96c0112

9 months ago

11.5.0-rc.70f35c8

9 months ago

10.6.1-rc.ff6b688

9 months ago

10.6.1-rc.d192da7

9 months ago

11.5.0-rc.76afb82

10 months ago

11.5.0-rc.788de2a

10 months ago

11.5.0-rc.9602787

10 months ago

11.5.0-rc.345313

10 months ago

11.5.1-rc.05fd429

10 months ago

10.6.1-rc.1fa14ae

10 months ago

11.5.0-rc.76f2eff

10 months ago

11.5.0-rc.9d99b3b

10 months ago

10.6.0-rc.6466970

10 months ago

11.5.0-rc.01f4d53

10 months ago

11.5.0-rc.18b7707

10 months ago

11.5.0-rc.99c74c1

10 months ago

11.5.0-rc.3a5981f

10 months ago

11.5.0-rc.333886

10 months ago

11.5.0-rc.f7ed798

10 months ago

11.5.0-rc.f72f972

10 months ago

11.5.0-rc.0f80d93

10 months ago

11.5.0-rc.32b7c1f

10 months ago

11.5.0-rc.77fd08f

10 months ago

11.5.0-rc.dbeee04

10 months ago

11.5.0-rc.9aa6951

10 months ago

10.6.0-rc.419f940

10 months ago

10.6.0-rc.97adf52

10 months ago

11.5.0-rc.2980df8

10 months ago

10.6.0-rc.4915908

10 months ago

10.5.1-rc.6b023fc

10 months ago

10.5.1-rc.546cc30

10 months ago

11.5.0-rc.2deb061

10 months ago

11.4.1-rc.bea8c7a

10 months ago

11.4.1-rc.3649d8b

10 months ago

11.4.1-rc.6ee88c6

10 months ago

11.4.1-rc.3b991ad

10 months ago

11.4.1-rc.bbb3292

10 months ago

11.4.1-rc.67034ee

10 months ago

11.4.1-rc.88e9ab7

10 months ago

11.4.1-rc.57bdf05

10 months ago

10.4.1-rc.e2983f8

12 months ago

11.4.1-rc.f6018b2

11 months ago

11.3.1-rc.0acf96f

12 months ago

11.3.1-rc.44cdd14

12 months ago

11.3.0-rc.f496868

12 months ago

11.3.0-rc.ff4d202

12 months ago

11.3.1-rc.d04670c

12 months ago

10.5.1-rc.dbd04fd

10 months ago

11.3.1-rc.9abef70

12 months ago

10.4.1-rc.4a1d3a1

12 months ago

11.3.1-rc.04eb8a4

12 months ago

11.3.1-rc.e6d3aab

12 months ago

10.5.1-rc.55edf8a

11 months ago

11.3.1-rc.5075d73

12 months ago

10.5.0-rc.727d232

11 months ago

11.3.1-rc.0f702e5

12 months ago

11.4.0-rc.05fb106

11 months ago

11.3.1-rc.907e067

12 months ago

11.3.1-rc.586755b

12 months ago

10.5.0-rc.35ec069

11 months ago

11.3.1-rc.00adcfe

11 months ago

11.4.1-rc.4ad8793

11 months ago

11.4.0-rc.f29616c

11 months ago

10.5.0-rc.c9901be

11 months ago

10.5.0-rc.4190d85

11 months ago

10.5.0-rc.c9be4e7

11 months ago

11.3.1-rc.be8f08f

12 months ago

11.4.1-rc.a774f1d

10 months ago

11.3.1-rc.b61a52f

12 months ago

10.4.1-rc.a4b4d92

12 months ago

10.5.0-rc.61b4b35

11 months ago

10.4.1-rc.c795e21

12 months ago

11.3.1-rc.54d5563

12 months ago

11.3.1-rc.d656fbd

12 months ago

11.3.0-rc.2ce9bc8

12 months ago

11.3.0-rc.1ac007b

12 months ago

11.3.1-rc.9dd3668

11 months ago

10.5.0-rc.8dc13c0

11 months ago

11.3.0-rc.e7ed7b2

12 months ago

10.5.0-rc.4b07705

11 months ago

11.3.1-rc.c193267

12 months ago

10.5.1-rc.623251a

10 months ago

11.3.1-rc.d5de76d

12 months ago

11.3.0-rc.60537a1

12 months ago

11.3.0-rc.5d2b843

12 months ago

11.3.1-rc.0b6a4c7

12 months ago

11.3.0-rc.280e387

12 months ago

10.5.1-rc.76f77a9

11 months ago

10.1.0-rc.962376

2 years ago