kore-web-sdk 10.1.0 → 10.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,153 @@
1
+ # Kore.ai SDK
2
+ 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.
3
+
4
+ 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
5
+
6
+ [Bot SDKs](https://developer.kore.ai/docs/bots/kore-web-sdk/)
7
+
8
+ [Web Socket Endpoints and Events](https://developer.kore.ai/docs/bots/sdks/bots-platform-api-reference/)
9
+
10
+ [SDK Security](https://developer.kore.ai/docs/bots/sdks/user-authorization-and-assertion/)
11
+
12
+ [SDK App Registration](https://developer.kore.ai/docs/bots/sdks/sdk-app-registration/)
13
+
14
+ [Message Templates](https://developer.kore.ai/docs/bots/sdks/message-templates/)
15
+
16
+ [API Referernce](https://rajasekharba-kore.github.io/web-kore-sdk/)
17
+
18
+ [FAQ's](/docs/faqs)
19
+
20
+
21
+ ## 💡 Getting Started
22
+
23
+ First, install kore web SDK via the [npm](https://www.npmjs.com/get-npm) package manager:
24
+
25
+ ```bash
26
+ npm install --save kore-web-sdk
27
+ ```
28
+
29
+ Get chatWindow and chatConfig
30
+
31
+ ```js
32
+ import { chatConfig, chatWindow } from 'kore-web-sdk';
33
+
34
+ ```
35
+ Configure ChatConfig
36
+
37
+
38
+
39
+ ```js
40
+
41
+ let botOptions=chatConfig.botOptions;
42
+
43
+ botOptions.JWTUrl = "PLEASE_ENTER_JWTURL_HERE";
44
+ botOptions.userIdentity = 'PLEASE_ENTER_USER_EMAIL_ID';// Provide users email id here
45
+ botOptions.botInfo = { name: "PLEASE_ENTER_BOT_NAME", "_id": "PLEASE_ENTER_BOT_ID" }; // bot name is case sensitive
46
+ botOptions.clientId = "PLEASE_ENTER_CLIENT_ID";
47
+ botOptions.clientSecret = "PLEASE_ENTER_CLIENT_SECRET";
48
+ /*
49
+ Important Note: These keys are provided here for quick demos to generate JWT token at client side but not for Production environment.
50
+ Refer below document for JWT token generation at server side. Client Id and Client secret should maintained at server end.
51
+ https://developer.kore.ai/docs/bots/sdks/user-authorization-and-assertion/
52
+ **/
53
+
54
+ ```
55
+
56
+
57
+ Create chat window instance and trigger show method
58
+ ```js
59
+ var chatWindowInstance = new chatWindow(chatConfig);
60
+ chatWindowInstance.show(chatConfig);
61
+
62
+ ```
63
+ ### Examples
64
+ Click [here](/docs/sdkdeveloper) to explore different variations how SDK can be consumed
65
+
66
+ ### Other options
67
+ <details>
68
+ <summary>Legacy</summary>
69
+
70
+ include the following script in your html file and configure bot configurations
71
+
72
+ ```js
73
+
74
+ <script src="https://cdn.jsdelivr.net/npm/kore-web-sdk@10.1.1/dist/umd/kore-web-sdk-umd-chat.min.js"></script>
75
+ <script>
76
+ //chat window declaration
77
+ var chatConfig=KoreChatSDK.chatConfig;
78
+ var chatWindow=KoreChatSDK.chatWindow;
79
+
80
+ //create chat window instance
81
+ var chatWindowInstance = new chatWindow();
82
+
83
+ //configure bot configurations
84
+ var botOptions=chatConfig.botOptions;
85
+ botOptions.JWTUrl = "PLEASE_ENTER_JWTURL_HERE";
86
+ botOptions.userIdentity = 'PLEASE_ENTER_USER_EMAIL_ID';
87
+ botOptions.botInfo = { name: "PLEASE_ENTER_BOT_NAME", "_id": "PLEASE_ENTER_BOT_ID" }; // bot name is case sensitive
88
+ botOptions.clientId = "PLEASE_ENTER_CLIENT_ID";
89
+ botOptions.clientSecret = "PLEASE_ENTER_CLIENT_SECRET";
90
+ /*
91
+ Important Note: These keys are provided here for quick demos to generate JWT token at client side but not for Production environment.
92
+ Refer below document for JWT token generation at server side. Client Id and Client secret should maintained at server end.
93
+ https://developer.kore.ai/docs/bots/sdks/user-authorization-and-assertion/
94
+ **/
95
+
96
+ //show chatwindow
97
+ chatWindowInstance.show(chatConfig);
98
+
99
+ </script>
100
+
101
+ ```
102
+
103
+ </details>
104
+
105
+
106
+ <details>
107
+ <summary>For quick demo</summary>
108
+
109
+
110
+
111
+ #### Instructions
112
+ 1.Open examples/umd/chat-with-plugins/index.html
113
+ 2.configure bot configurations
114
+ 3.Open same file in any browser
115
+
116
+
117
+
118
+
119
+ </details>
120
+
121
+ ## 💡 Custom Templates
122
+
123
+ In addition to the kore message templates, new custom templates can be intstalled into kore chat window with *installTemplate* method
124
+
125
+ ```bash
126
+ class customTemplateComponent{
127
+ renderMessage(msgData){
128
+ if(msgData?.message[0]?.component?.payload?.template_type==='custom_stock_template'){
129
+ return '<h2>My Template HTML</h2>';
130
+ }else{
131
+ return false;
132
+ }
133
+ }
134
+ }
135
+
136
+ chatWindowInstance.templateManager.installTemplate(new customTemplateComponent());
137
+ ```
138
+ Other framework UI components like angular and react can also be injected with this
139
+
140
+ ## 💡 Plugins
141
+
142
+ Kore's chatwindow functionlity can be extended with the help of plugins.Newly created plugins can be installed with *installPlugin* method
143
+
144
+ ```bash
145
+ class KoreCustomPlugin{
146
+
147
+ }
148
+
149
+ chatWindowInstance.installPlugin(new KoreCustomPlugin());
150
+ ```
151
+ Kore offered plugins are listed [here](./docs/plugins)
152
+
153
+
@@ -190,6 +190,7 @@ declare class chatWindow extends EventEmitter {
190
190
  renderType: string;
191
191
  fromHistorySync: any;
192
192
  } | any): false | undefined;
193
+ prepareAriaTagsOnMessage(msgData: any, messageHtml: any): void;
193
194
  generateMessageDOM(msgData?: any): any;
194
195
  pushTorenderMessagesQueue(msgItem: any): void;
195
196
  startRenderEventLoop(): void;
@@ -198,6 +199,7 @@ declare class chatWindow extends EventEmitter {
198
199
  openExternalLink(link_url: any): void;
199
200
  getChatTemplate(tempType: string): string;
200
201
  historyLoadingComplete(): void;
202
+ historySyncing(msgData: any, res: any, index: any): void;
201
203
  chatHistory(res: {
202
204
  messages: string | any[];
203
205
  }[] | any): false | undefined;
@@ -11,6 +11,8 @@ export{KorePickersPlugin}from"./plugins/kore-picker-plugin.js";
11
11
  // @ts-ignore
12
12
  export{GraphTemplatesPlugin}from"./plugins/kore-graph-templates-plugin.js";
13
13
  // @ts-ignore
14
+ export {SolutionsTemplatesPlugin} from './plugins/kore-solutions-plugin.js'
15
+ // @ts-ignore
14
16
  export{WebKitSTT}from"./plugins/webapi-stt-plugin.js";
15
17
  // @ts-ignore
16
18
  export{BrowserTTS}from"./plugins/browser-tts-plugin.js";
@@ -1 +1 @@
1
- export{chatWindow}from"./kore-web-sdk-chat.min.js";export{chatConfig}from"./kore-web-sdk-chat.min.js";export{KoreWidgetSDK}from"./kore-web-sdk-widgets.js";export{widgetsConfig}from"./kore-web-sdk-widgets.js";export{KorePickersPlugin}from"./plugins/kore-picker-plugin.js";export{GraphTemplatesPlugin}from"./plugins/kore-graph-templates-plugin.js";export{WebKitSTT}from"./plugins/webapi-stt-plugin.js";export{BrowserTTS}from"./plugins/browser-tts-plugin.js";export{AgentDesktopPlugin}from"./plugins/agent-desktop.js";export{GoogleSTT}from"./plugins/google-stt-plugin.js";export{GoogleTTS}from"./plugins/google-tts-plugin.js";export{AzureSTT}from"./plugins/azure-stt-plugin.js";export{AzureTTS}from"./plugins/azure-tts-plugin.js";export{SpeakTextWithAWSPolly}from"./plugins/koreawspolly-st-plugin.js";export{KoreDesktopNotificationPlugin}from"./plugins/kore-desktop-notification.js";export{SearchSuggestionsPlugin}from"./plugins/search-suggestions.js";export{KoreFileUploaderPlugin}from"./plugins/file-upload.js";
1
+ export{chatWindow}from"./kore-web-sdk-chat.min.js";export{chatConfig}from"./kore-web-sdk-chat.min.js";export{KoreWidgetSDK}from"./kore-web-sdk-widgets.js";export{widgetsConfig}from"./kore-web-sdk-widgets.js";export{KorePickersPlugin}from"./plugins/kore-picker-plugin.js";export{GraphTemplatesPlugin}from"./plugins/kore-graph-templates-plugin.js";export{WebKitSTT}from"./plugins/webapi-stt-plugin.js";export{BrowserTTS}from"./plugins/browser-tts-plugin.js";export{AgentDesktopPlugin}from"./plugins/agent-desktop.js";export{GoogleSTT}from"./plugins/google-stt-plugin.js";export{GoogleTTS}from"./plugins/google-tts-plugin.js";export{AzureSTT}from"./plugins/azure-stt-plugin.js";export{AzureTTS}from"./plugins/azure-tts-plugin.js";export{SpeakTextWithAWSPolly}from"./plugins/koreawspolly-st-plugin.js";export{KoreDesktopNotificationPlugin}from"./plugins/kore-desktop-notification.js";export{SearchSuggestionsPlugin}from"./plugins/search-suggestions.js";export{KoreFileUploaderPlugin}from"./plugins/file-upload.js";export{SolutionsTemplatesPlugin}from"./plugins/kore-solutions-plugin.js";