@koredev/kore-web-sdk 11.18.0-rc.f92a18a → 11.19.0-rc.b432c67

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
@@ -71,7 +71,7 @@ include the following script in your html file and configure bot configurations
71
71
 
72
72
  ```js
73
73
 
74
- <script src="https://cdn.jsdelivr.net/npm/kore-web-sdk@11.18.0/dist/umd/kore-web-sdk-umd-chat.min.js"></script>
74
+ <script src="https://cdn.jsdelivr.net/npm/kore-web-sdk@11.19.0/dist/umd/kore-web-sdk-umd-chat.min.js"></script>
75
75
  <script>
76
76
  //chat window declaration
77
77
  var chatConfig=KoreChatSDK.chatConfig;
@@ -125,9 +125,9 @@ In addition to the kore message templates, new custom templates can be intstalle
125
125
  ```bash
126
126
  class customTemplateComponent{
127
127
  renderMessage(msgData){
128
- if(msgData?.message[0]?.component?.payload?.template_type==='custom_stock_template'){
129
- return '<h2>My Template HTML</h2>';
130
- }else{
128
+ if (msgData?.message[0]?.component?.payload?.template_type === 'custom_stock_template') {
129
+ return '<h2 data-kr-msg-id=' + msgData.messageId + ' data-time=' + msgData.createdOnTimemillis + '>My Template HTML</h2>';
130
+ } else {
131
131
  return false;
132
132
  }
133
133
  }
@@ -137,6 +137,10 @@ chatWindowInstance.templateManager.installTemplate(new customTemplateComponent()
137
137
  ```
138
138
  Other framework UI components like angular and react can also be injected with this
139
139
 
140
+ > [!NOTE]
141
+ > - Please add the following two attributes for parent div in the custom template html
142
+ > - `data-kr-msg-id` with value `msgData.messageId` and `data-time` with value `msgData.createdOnTimemillis`
143
+
140
144
  ## 💡 Plugins
141
145
 
142
146
  Kore's chatwindow functionlity can be extended with the help of plugins.Newly created plugins can be installed with *installPlugin* method