{"id":17989,"date":"2017-04-14T14:09:38","date_gmt":"2017-04-14T14:09:38","guid":{"rendered":"http:\/\/developer.kore.ai\/v10-1\/?post_type=docs&#038;p=11246"},"modified":"2024-03-06T11:56:46","modified_gmt":"2024-03-06T11:56:46","slug":"kore-ai-web-sdk-tutorial","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/sdks\/kore-ai-web-sdk-tutorial\/","title":{"rendered":"Kore.ai Web SDK Tutorial"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>This tutorial is an end-to-end walkthrough for setting up and running an instance of the Kore.ai Bots Web SDK which is a collection of libraries that you can use to integrate Kore.ai bots with your own web applications.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2><span class=\"ez-toc-section\" id=\"Web_SDK_Tutorial_Overview\">Web SDK Tutorial Overview<\/span><\/h2>\n<p>In this tutorial, you will install a Kore.ai sample bot, a test\u00a0application to host the bot, and then a JSON Web Token (JWT) generation web service using your local host server to communicate between\u00a0the bot on your local server and the Kore.ai Bots Platform.<br \/>\nThe following list describes the general steps you will take to install and configure the Web SDK.<\/p>\n<ol>\n<li><strong>Build the Bot to be integrated &#8211; <\/strong>For this tutorial, you will install the <em>Travel Planning Sample<\/em> bot that uses open APIs to get flight and location information, along with weather reports.<\/li>\n<li><strong>Configure Web\/Mobile Client channel<\/strong> &#8211; To use the <em>Travel Planning Sample<\/em> bot with the Web SDK, you must configure the bot for\u00a0the Web\/Mobile Client channel.<\/li>\n<li><strong>Create a new Client App<\/strong> &#8211; When you configure the Web\/Mobile Client channel for the <em>Travel Planning Sample<\/em> bot, you must create a client app and select the JWT signing algorithm used to generate the authentication tokens.<\/li>\n<li><strong>Publish the bot<\/strong> &#8211; After you have configured the <em>Travel Planning Sample<\/em> bot, you must publish the bot which sends the bot to the Bots Admin for approval.<\/li>\n<li><strong>Approve and Deploy the bot<\/strong> &#8211; In the Bots Admin Console, the published bot and tasks must be approved to deploy.<\/li>\n<li><strong>Download and install Node.js<\/strong> &#8211; You will need to install <span style=\"color: #0000ff;\">Node.js<\/span> used to host the JWT token generation web service for the Web SDK to communicate between the bot in the test\u00a0application and the Kore.ai Bots Platform.<\/li>\n<li><strong>Download and uncompress the test application<\/strong> &#8211; \u00a0The test application,\u00a0<a href=\"https:\/\/s3.amazonaws.com\/static-kore\/downloads\/SDKApp.zip\">SDKApp<\/a>\u00a0is used to simulate your application that will host the Kore.ai bot as a channel on a web page using your computer local host server.<\/li>\n<li><strong>Download and uncompress the Kore.ai Web SDK<\/strong> &#8211; The Web SDK contains the libraries used to communicate and run the bot in the test\u00a0application using the Web\/Mobile Client channel. You will need to configure settings in the <span style=\"color: #0000ff;\">index.html<\/span> file for your computer.<\/li>\n<li><strong>Start your application and view the bot in a web browser<\/strong> &#8211; In a <strong>Terminal<\/strong> window, you will start the JWT service, and then view the bot in a web browser.<\/li>\n<\/ol>\n<p>Now let us see detailed step by step implementation.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h2><span class=\"ez-toc-section\" id=\"Installing_and_Running_the_Koreai_Web_SDK\">Installing and Running the Kore.ai Web SDK<\/span><\/h2>\n<p>This section provides detailed steps on how to run a Kore.ai sample bot using the Web SDK and a test application running on your computer local host server.<\/p>\n<p><strong>Step 1:<\/strong> Build a bot to run in the test application, and then configure the bot to run in the Web\/Mobile Client channel.<\/p>\n<ol>\n<li>Log on to Bot\u00a0Builder, and click the\u00a0<strong>down-arrow<\/strong>\u00a0next to the\u00a0\u00a0<strong>+New Bot<\/strong>\u00a0and select\u00a0<strong>Install Sample Bots.<\/strong><\/li>\n<li>Hover over\u00a0<strong>Travel Planning Sample<\/strong>, and then click <strong>Install<\/strong>.<\/li>\n<li>The <em>Travel Planning Sample installed successfully<\/em> message is displayed and the sample bot is added to your <strong>Bots<\/strong> left-hand navigation menu.<\/li>\n<\/ol>\n<p><strong>Step 2:<\/strong> Define the Web\/Mobile Client channel for the Travel Planning Sample bot by creating a new client app and defining channel settings. (For more information, see <a href=\"\/docs\/bots\/bot-builder-tool\/channel-enablement\/adding-the-webmobile-client-channel\/\" target=\"_blank\" rel=\"noopener noreferrer\">Adding the Web\/Mobile Client Channel<\/a>.)<\/p>\n<ol>\n<li>On the bot builder top menu, select the <strong>Deploy<\/strong> tab<\/li>\n<li>From the left menu, click <strong>Integrations &gt; Web\/Mobile SDK<\/strong>.<\/li>\n<li>In the <strong>Select App<\/strong> drop-down list, click <strong>Create App<\/strong>.\u00a0The <strong>Create Client App<\/strong> dialog is displayed.<\/li>\n<li>In the <strong>Name<\/strong> field,\u00a0enter a name for your app, for example, <span style=\"color: #0000ff;\">My SDK Client App<\/span>.<\/li>\n<li>In the <strong>JWT Signing Algorithms<\/strong> section, select <strong>HS256<\/strong>\u00a0to generate the authentication tokens.<\/li>\n<li>Click <strong>Next -&gt; Done<\/strong>.<\/li>\n<li>The <strong>Web\/Mobile Client Channel<\/strong> page is displayed with the following JWT credentials, make a note of all these details. We will be using them later in the Web SDK setup:\n<ul>\n<li>Bot Name<\/li>\n<li>Bot ID<\/li>\n<li>Client ID<\/li>\n<li>Client Secret<\/li>\n<\/ul>\n<\/li>\n<li>Click <strong>Save<\/strong>.<\/li>\n<\/ol>\n<p>Now that the bot is created and defined for the Web\/Mobile Client channel.<\/p>\n<p><strong>Step 3:<\/strong> Publish and deploy your bot.<\/p>\n<div class=\"alert alert-info\"><em><strong>Note:<\/strong> By default, the Travel Sample Planning bot is configured with <strong>Target Audience<\/strong> set to <strong>Enterprise Users<\/strong>\u00a0on the <strong>Build<\/strong> tab in the <strong>Configurations -&gt; General Settings.\u00a0<\/strong>Optionally, you can define this bot for <strong>General Public<\/strong> use. Once this bot is published, the <strong>Target Audience<\/strong> cannot be changed.<\/em><\/div>\n<div><\/div>\n<ol>\n<li>On the <strong>Deploy<\/strong> tab, click <strong>Bot Management -&gt; Publish<\/strong>.<\/li>\n<li>On <b>Publish <\/b>page, select all tasks, and then click <strong>Proceed<\/strong>.<\/li>\n<li>Enter a comment and <strong>Confirm<\/strong> publish.<br \/>\nAfter an enterprise developer publishes a bot, it must be approved and assigned to the users for use.<\/li>\n<li>Complete one of the following bot deployments in the Bots Admin Console depending if\u00a0your bot <strong>Target Audience<\/strong> is set to <strong>Enterprise Users\u00a0<\/strong>or <strong>General Public<\/strong>. Complete one of the following:\n<ol>\n<li>In the Bots Admin Console, in the <strong>Bots Management<\/strong> module, on the <strong>Enterprise\u00a0Bots<\/strong> page,\u00a0click the <strong>Ellipses<\/strong>\u00a0\u00a0icon for the <em>Travel Planning Sample<\/em> bot that you want to deploy,\u00a0and then click <strong>Manage bot tasks<\/strong>. The <strong>Manage Bot Tasks<\/strong> dialog is displayed.<\/li>\n<li>In the <strong>Bot tasks<\/strong> field, click the <strong>Expand<\/strong>\u00a0<img loading=\"lazy\" decoding=\"async\" class=\"icon alignnone wp-image-6276 size-full\" src=\"\/wp-content\/uploads\/sites\/35\/ExpandIcon.png\" alt=\"BotsAdminExpandRight\" width=\"20\" height=\"32\" \/> icon to display the available and deployed tasks, select all tasks for this bot,\u00a0and then click <strong>Confirm<\/strong>.<\/li>\n<li>In the <strong>Manage bots tasks<\/strong> dialog, click <strong>Confirm<\/strong>. The <em>Bot status changed successfully<\/em> message is displayed.<\/li>\n<li>On the <strong>Enterprise\u00a0Bots<\/strong> page,\u00a0click the <strong>Ellipses<\/strong> icon for the<em>Travel Planning Sample<\/em> bot\u00a0that you want to assign the users to,\u00a0and then click <strong>Bot &amp; task assignments<\/strong>.<\/li>\n<li>The <strong>Bot &amp; task assignments<\/strong>\u00a0dialog is displayed. Assign the bot to your users, for all tasks, including yourself.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><strong>Step 4:<\/strong> Now it is time to download, un-compress, install, and configure the software packages required for the Web SDK and a test application to run the bot locally on your local host server.<\/p>\n<ol>\n<li>To download and install <span style=\"color: #0000ff;\"><em>node.js<\/em><\/span> on your computer, go to\u00a0<a href=\"https:\/\/nodejs.org\/en\/download\/\">https:\/\/nodejs.org\/en\/download\/<\/a>, and then select your OS as <span style=\"color: #0000ff;\">.pkg<\/span> for Mac, and <span style=\"color: #0000ff;\">.msi <\/span>for Windows.<\/li>\n<li>In a <strong>Terminal<\/strong> window,\u00a0run the <code>node -v<\/code> command to verify installation\u00a0and version, for example, <code>v6.10.2<\/code>.<\/li>\n<li>Locate the <strong>SDKApp\/sdk<\/strong> folder of your <span style=\"text-decoration: underline;\">web server hosting the app<\/span> where you want to integrate the Kore bot. For this tutorial, to download the test application and\u00a0JWT web service, click\u00a0<a href=\"https:\/\/s3.amazonaws.com\/static-kore\/downloads\/SDKApp.zip\">SDKApp<\/a>, and unzip it.<\/li>\n<li>To download the Kore.ai Web SDK, go to\u00a0<a href=\"https:\/\/github.com\/Koredotcom\/web-kore-sdk\">https:\/\/github.com\/Koredotcom\/web-kore-sdk<\/a>, and then click <strong>Download<\/strong>. Extract all files to the <span style=\"color: #0000ff;\"><em>&#8230;\/SDKApp\/sdk<\/em><\/span> folder mentioned in step above. Check for the release compatibility from the <a href=\"\/docs\/bots\/whats-new\/whats-new-in-this-release-bot-builder\/#SDK_Versions\" target=\"_blank\" rel=\"noopener noreferrer\">release notes<\/a>.<\/li>\n<li>From the Bot Builder\u00a0<strong>Web\/Mobile Client Channel<\/strong> page on the <strong>Deploy -&gt; Channels<\/strong> menu, copy the following (as mentioned in Step 2 (7) above):\n<ul>\n<li>clientSecret<\/li>\n<li>clientId<\/li>\n<li>Bot Name<\/li>\n<\/ul>\n<\/li>\n<li>Make the following changes to the downloaded Web SDK file:\n<ol>\n<li>Open the <span style=\"color: #0000ff;\">index.html<\/span> file from the\u00a0<em><span style=\"color: #0000ff;\">&#8230;\/SDKApp\/sdk\/UI<\/span><\/em> folder using a text editor.\u00a0Update the following lines to add the path to the <em><span style=\"color: #0000ff;\">UI<\/span><\/em> folder:<br \/>\n<code>&lt;script src=\"libs\/jquery.js\" type=\"text\/javascript\"&gt;&lt;\/script&gt;<br \/>\n&lt;script src=\"libs\/jquery.tmpl.min.js\" type=\"text\/javascript\"&gt;&lt;\/script&gt;<br \/>\n&lt;script src=\"libs\/jquery-ui.min.js\" type=\"text\/javascript\"&gt;&lt;\/script&gt;<br \/>\n&lt;link href=\"libs\/jquery-ui.min.css\" rel=\"stylesheet\"&gt;&lt;\/link&gt;<br \/>\n&lt;script src=\"chatWindow.js\" type=\"text\/javascript\"&gt;&lt;\/script&gt;<br \/>\n&lt;link href=\"chatWindow.css\" rel=\"stylesheet\"&gt;&lt;\/link&gt;<\/code><\/li>\n<li>Open the <span style=\"color: #0000ff;\">kore-config.js<\/span> and update the <em>botOptions<\/em> parameters botInfo, clientId and clientSecret, and your email id as userIdentity.\n<pre><code>\u201cclientSecret\u201d: \u201c{client secret}\u201d\r\n$.ajax({\r\n   url: \u201chttp:\/\/localhost:3000\/api\/users\/getJWT\u201d,\r\n     \/\/this is sample url of a localhost. \r\n     \/\/This should include the url where you are hosting the bot.\r\n   botOptions.userIdentity = \u2018 \u2018;\r\n     \/\/ Provide users email id here\r\n   botOptions.clientId= \"{client id} \";\r\n     \/\/ secure client-id\r\n   _botOptions.botInfo= {name:\"{bot name}\",\"id\":\"{bot id\"};\r\n     \/\/ Kore bot name is case sensitive\r\n })\r\n<\/code><\/pre>\n<p>The JWTUrl refers to the location where your app (where you want the Kore.ai Bot to be integrated) is hosted. For this tutorial, we are using the JWT server and hence using the same here.<\/li>\n<li>Ensure that in <span style=\"color: #0000ff;\">kore-config.js <\/span>you set the audience for your bot. Choose one of the following:\n<ol>\n<li><code>\"isAnonymous\": &lt;\u00a0<strong><em>false<\/em>\u00a0<\/strong>&gt;;<\/code>\u00a0if bot is deployed for\u00a0the <strong>enterprise users<\/strong>, and then set <code>botOptions.userIdentity = '<strong>&lt;<\/strong>\u00a0<strong><em>Your email ID<\/em> &gt;<\/strong>';<\/code><br \/>\n<strong>\u00a0 \u00a0 \u00a0 \u00a0&#8211; or &#8211;<\/strong><\/li>\n<li><code>\"isAnonymous\": &lt;\u00a0<strong><em>true<\/em>\u00a0<\/strong>&gt;;<\/code> if bot is deployed for <strong>Consumer Use<\/strong><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<li>Save your changes.<br \/>\nYou are ready to start the JWT token generation service and access the test application with the configured Web SDK in your local web browser.<\/li>\n<li>Go to home directory: <code>cd SDKApp<\/code><\/li>\n<li>Install dependencies using the following command:<br \/>\n<code>npm install<\/code><br \/>\n<a ref=\"magnificPopup\" href=\"\/wp-content\/uploads\/sites\/35\/start-server.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-15228\" src=\"\/wp-content\/uploads\/sites\/35\/start-server.png\" alt=\"\" width=\"668\" height=\"179\" \/><\/a><\/li>\n<li>Start SDKApp:<br \/>\n<code>node startServer.js<\/code><\/li>\n<li>Access the application in any browser using <em>localhost:3000<\/em><\/li>\n<\/ol>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Passing_data_via_webSDK\">Passing data via webSDK<\/span><\/h3>\n<p>You can pass additional information of the user accessing the channel by adding the custom data at <strong>botInfo<\/strong> inside the <em>index.html<\/em> file.<\/p>\n<pre>botOptions.botInfo = {name: \"Banking Bot\", \r\n                              \"_id\": \"&lt;bot_id&gt;\", \r\n                              customData: \"value\"\r\n              };<\/pre>\n<p>Details like phone number, address, or location, etc., are examples of data that can be passed inside the <em><span style=\"text-decoration: underline;\">customData<\/span><\/em>.<\/p>\n<p><em><code>customData<\/code><\/em> can be accessed from <code>lastMessage<\/code> under the <code>BotUserSession<\/code> of the context object. This data will be specific to the user using webSDK and will last for the user session.<\/p>\n<p>Multiple values can also be added to the <code>customData<\/code> in the <code>index.html<\/code> file as key-value pairs:<\/p>\n<pre>botOptions.botInfo = {name:\"&lt;bot_name&gt;\",\r\n                      \"_id\":\"&lt;bot_id\",\r\n                      customData:{\"name\":\"John\",\r\n                                  \"age\":30,\r\n                                   \"cars\": {\"car1\":\"Ford\",\r\n                                            \"car2\":\"BMW\",\r\n                                            \"car3\":\"Fiat\"\r\n                                             }\r\n                                   }\r\n                           };<\/pre>\n<p><a ref=\"magnificPopup\" href=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20200723122801\/customData.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-24099\" src=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20200723122801\/customData.png\" alt=\"\" width=\"444\" height=\"492\" srcset=\"https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20200723122801\/customData.png 444w, https:\/\/kore-wordpress.s3.us-east-2.amazonaws.com\/developer.kore.ai\/v10-1\/wp-content\/uploads\/sites\/35\/20200723122801\/customData-271x300.png 271w\" sizes=\"auto, (max-width: 444px) 100vw, 444px\" \/><\/a><\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Passing_Mapped_Identities\">Passing Mapped Identities<\/span><\/h3>\n<p>The Web\/Mobile SDKs support the passing of mapped identities of the users when they switch from one identity to another while interacting with the bot. This process allows the users to continue any ongoing conversation initiated using a previous identity.<br \/>\nFor example, a user may have started the conversation with the bot using an anonymous or randomly generated identity. After exchanging a few messages, the user may become an authenticated or known user by logging into your website or any application. At this point, the user\u2019s known identity can be passed to the bot from the SDK as part of the \u2018<a href=\"\/docs\/bots\/sdks\/user-authorization-and-assertion\/#About_JWT\" target=\"_blank\" rel=\"noopener noreferrer\">JWT Grant API<\/a>\u2019 call using the parameter identityToMerge. The Platform uses this information to merge the user identities and allows the user to resume an ongoing conversation using the new known identity.<\/p>\n<pre>{\r\n \"iat\": 1611810186883,\r\n \"exp\": 1611813786.883,\r\n \"aud\": \"https:\/\/idproxy.kore.com\/authorize\",\r\n \"iss\": \"cs-d3042d3e-7da4-55da-a94d-783349270cc0\",\r\n \"sub\": \"knowuser1@test.com\",\r\n \"isAnonymous\": \"false\",\r\n \"identityToMerge\": \"anonymoususer1@test.com\"\r\n}<\/pre>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>The following scenarios describe the bot behavior when dealing with the new identity and merged identity:<\/p>\n<ul>\n<li>When both the new and merged identities are not present in the system, then the new identity is created and a new conversation is started using new identity<\/li>\n<li>When the new identity is present but the merged identity is not present in the system, then the conversation is started or continued (in case of an active session) using new identity<\/li>\n<li>When the merged identity is present but the new identity is not present in the system, then the new identity is created and the conversation is continued using the new identity. All references to the merged identity are replaced with the new identity and the merged identity is removed.<\/li>\n<li>When both the merged identity and the new identity are present in the system and the new identity does not have an active session, then the conversation is continued using the new identity. All references to the merged identity are replaced with the new identity and the merged identity is removed.<\/li>\n<li>When both the merged identity and the new identity are present in the system and both have an active session, then the merged identity&#8217;s conversation is continued using the new identity. All references to the merged identity are replaced with the new identity and the merged identity is removed. The active session of the new identity is marked as &#8220;Drop-off&#8221; and closed<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>Due to the above-mentioned behavior in the user identity following changes can be seen:<\/p>\n<ul>\n<li>Analytics and Chat History will be updated associating all the sessions related to the merged identity with the new identity<\/li>\n<li>The sessions data is updated replacing the merged identity with the new identity<\/li>\n<li>The Billing Session tracking merged identity&#8217;s conversation will be marked as new identity<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Custom_Meta_Tags_via_webSDK\">Custom Meta Tags via webSDK<\/span><\/h3>\n<p>With the release of ver8.0 of the platform, you can directly add Custom Meta Tags from all supported internal channels (Web SDK\/IVR \/ IVRVoice \/ Webhook channels). You can define Session, User, and Message level meta-tags. These tags will be added to the Conversation Session as soon as it is created.<\/p>\n<pre>botOptions.botInfo = {name:\"&lt;bot_name&gt;\", \"_id\":\"&lt;bot_id\",\r\n                           customData :{\"name\":\"John\"},\r\n                           \"metaTags\": { \r\n                                 \"messageLevelTags\": [{ \"name\": \"tag1\", value: \"message\"}],\r\n                                 \"sessionLevelTags\": [{ \"name\": \"tag2\", value: \"session\"}],\r\n                                 \"userLevelTags\": [{ \"name\": \"tag3\", value: \"user\"}]\r\n                                 }  \r\n                          };<\/pre>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Some_commonly_encountered_errors\">Some commonly encountered errors<\/span><\/h3>\n<ul>\n<li><em>A wrong URL<\/em> is given in index.html, users see a 404 error. Double check the URL. URL changes depending on whether you are hosting the bot on your own web SDK or on Kore\u2019s web SDK. If its Kore web SDK, then the URL is <code>http:\/\/demo.kore.net:3000\/users\/sts 7<\/code>.<br \/>\nIf you are hosting on your in-house web SDK, then provide the respective URL.<\/li>\n<li><em>missing\/Invalid jwt.sub():<\/em>\u00a0This error occurs for enterprise Bots, when the user&#8217;s email id is not given in the index.html file.\u00a0Provide users identity as shown below in index.html<br \/>\n<code>botOptions.userIdentity = \u2018x@gmail.com\u2019;\/\/ Provide users email id here.<\/code><\/li>\n<li><em>Not found:\u00a0<\/em>User sees this error when either wrong clientID or no clientID is given. Check the correct ClientID from Bot \u2013 API Extensions option<br \/>\n<code>botOptions.clientId = \u201c{clientID}\u201d; \/\/ secure client-id<\/code><\/li>\n<li><em>error verifying the jwt: the\u00a0<\/em>Wrong clientSecret is given in index.html: Check the correct clientSecret you get from Bot \u2013 API Extensions option<br \/>\n<code>\u201cclientSecret\u201d: \"{clientSecret}\u201d \/\/provide clientSecret here<\/code><\/li>\n<\/ul>\n<p>After you install and test the Web SDK using the test application and your local host server, you can use the same concept to install and configure the Web SDK in your own enterprise application. You will just need to reconfigure the file paths and URLs in the index.html file of the Web SDK to point to your website and servers, and configure a Kore.ai bot for the Web\/Mobile Client channel with JWT credentials for your enterprise.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h4>Related Links<\/h4>\n<ul>\n<li class=\"w-post-elm post_title entry-title vc_custom_1629095808124\"><a href=\"https:\/\/developer.kore.ai\/v10-1\/docs\/bots\/sdks\/message-templates\/\">Web &amp; Mobile SDK: Message Formatting and Templates<\/a><\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae879c9c33de\" data-id=\"6ae879c9c33de\" data-height=\"10\" data-height-mobile=\"10\" data-height-tab=\"10\" data-height-tab-portrait=\"\" data-height-mobile-landscape=\"\" style=\"clear:both;display:block;\"><\/div><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"This tutorial is an end-to-end walkthrough for setting up and running an instance of the Kore.ai Bots Web SDK which is a collection of libraries that you can use to integrate Kore.ai bots with your own web applications. Web SDK Tutorial Overview In this tutorial, you will install a Kore.ai sample bot, a test\u00a0application to...","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-17989","post","type-post","status-publish","format-standard","hentry","category-sdks"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/17989","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/comments?post=17989"}],"version-history":[{"count":45,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/17989\/revisions"}],"predecessor-version":[{"id":61366,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/posts\/17989\/revisions\/61366"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/media?parent=17989"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/categories?post=17989"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-1\/wp-json\/wp\/v2\/tags?post=17989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}