@koredev/kore-web-sdk 10.1.0-rc.dce2a56 → 10.1.0-rc.de8b2f6

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 CHANGED
@@ -1,151 +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
-
19
- ## 💡 Getting Started
20
-
21
- First, install kore web SDK via the [npm](https://www.npmjs.com/get-npm) package manager:
22
-
23
- ```bash
24
- npm install --save kore-web-sdk
25
- ```
26
-
27
- Get chatWindow and chatConfig
28
-
29
- ```js
30
- import { chatConfig, chatWindow } from 'kore-web-sdk';
31
-
32
- ```
33
- Configure ChatConfig
34
-
35
-
36
-
37
- ```js
38
-
39
- let botOptions=chatConfig.botOptions;
40
-
41
- botOptions.JWTUrl = "PLEASE_ENTER_JWTURL_HERE";
42
- botOptions.userIdentity = 'PLEASE_ENTER_USER_EMAIL_ID';// Provide users email id here
43
- botOptions.botInfo = { name: "PLEASE_ENTER_BOT_NAME", "_id": "PLEASE_ENTER_BOT_ID" }; // bot name is case sensitive
44
- botOptions.clientId = "PLEASE_ENTER_CLIENT_ID";
45
- botOptions.clientSecret = "PLEASE_ENTER_CLIENT_SECRET";
46
- /*
47
- Important Note: These keys are provided here for quick demos to generate JWT token at client side but not for Production environment.
48
- Refer below document for JWT token generation at server side. Client Id and Client secret should maintained at server end.
49
- https://developer.kore.ai/docs/bots/sdks/user-authorization-and-assertion/
50
- **/
51
-
52
- ```
53
-
54
-
55
- Create chat window instance and trigger show method
56
- ```js
57
- var chatWindowInstance = new chatWindow(chatConfig);
58
- chatWindowInstance.show(chatConfig);
59
-
60
- ```
61
- ### Examples
62
- Click [here](/docs/sdkdeveloper) to explore different variations how SDK can be consumed
63
-
64
- ### Other options
65
- <details>
66
- <summary>Legacy</summary>
67
-
68
- include the following script in your html file and configure bot configurations
69
-
70
- ```js
71
-
72
- <script src="https://cdn.jsdelivr.net/npm/kore-web-sdk@10.1.0/dist/umd/kore-web-sdk-umd-chat.min.js"></script>
73
- <script>
74
- //chat window declaration
75
- var chatConfig=KoreChatSDK.chatConfig;
76
- var chatWindow=KoreChatSDK.chatWindow;
77
-
78
- //create chat window instance
79
- var chatWindowInstance = new chatWindow();
80
-
81
- //configure bot configurations
82
- var botOptions=chatConfig.botOptions;
83
- botOptions.JWTUrl = "PLEASE_ENTER_JWTURL_HERE";
84
- botOptions.userIdentity = 'PLEASE_ENTER_USER_EMAIL_ID';
85
- botOptions.botInfo = { name: "PLEASE_ENTER_BOT_NAME", "_id": "PLEASE_ENTER_BOT_ID" }; // bot name is case sensitive
86
- botOptions.clientId = "PLEASE_ENTER_CLIENT_ID";
87
- botOptions.clientSecret = "PLEASE_ENTER_CLIENT_SECRET";
88
- /*
89
- Important Note: These keys are provided here for quick demos to generate JWT token at client side but not for Production environment.
90
- Refer below document for JWT token generation at server side. Client Id and Client secret should maintained at server end.
91
- https://developer.kore.ai/docs/bots/sdks/user-authorization-and-assertion/
92
- **/
93
-
94
- //show chatwindow
95
- chatWindowInstance.show(chatConfig);
96
-
97
- </script>
98
-
99
- ```
100
-
101
- </details>
102
-
103
-
104
- <details>
105
- <summary>For quick demo</summary>
106
-
107
-
108
-
109
- #### Instructions
110
- 1.Open examples/umd/chat-with-plugins/index.html
111
- 2.configure bot configurations
112
- 3.Open same file in any browser
113
-
114
-
115
-
116
-
117
- </details>
118
-
119
- ## 💡 Custom Templates
120
-
121
- In addition to the kore message templates, new custom templates can be intstalled into kore chat window with *installTemplate* method
122
-
123
- ```bash
124
- class customTemplateComponent{
125
- renderMessage(msgData){
126
- if(msgData?.message[0]?.component?.payload?.template_type==='custom_stock_template'){
127
- return '<h2>My Template HTML</h2>';
128
- }else{
129
- return false;
130
- }
131
- }
132
- }
133
-
134
- chatWindowInstance.templateManager.installTemplate(new customTemplateComponent());
135
- ```
136
- Other framework UI components like angular and react can also be injected with this
137
-
138
- ## 💡 Plugins
139
-
140
- Kore's chatwindow functionlity can be extended with the help of plugins.Newly created plugins can be installed with *installPlugin* method
141
-
142
- ```bash
143
- class KoreCustomPlugin{
144
-
145
- }
146
-
147
- chatWindowInstance.installPlugin(new KoreCustomPlugin());
148
- ```
149
- Kore offered plugins are listed [here](./docs/plugins)
150
-
151
-
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.0/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;