{"id":1877,"date":"2022-01-07T01:20:04","date_gmt":"2022-01-07T01:20:04","guid":{"rendered":"https:\/\/multisite.korebots.com\/SearchAssist\/?p=1877"},"modified":"2022-02-23T08:19:05","modified_gmt":"2022-02-23T08:19:05","slug":"how-to-use-the-web-sdk","status":"publish","type":"post","link":"https:\/\/multisite.korebots.com\/SearchAssist\/concepts\/deploying-your-search-assistant\/how-to-use-the-web-sdk\/","title":{"rendered":"Deploying your Search Assistant"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row via_grid cols_1 laptops-cols_inherit tablets-cols_inherit mobiles-cols_1 valign_top type_default stacking_default\"><div class=\"wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_text_column\"><div class=\"wpb_wrapper\"><p><span style=\"font-weight: 400;\">SearchAssist grants access to the folder required for the Web SDK and a test application to run the Search Assistant <\/span><span style=\"font-weight: 400;\">on your machine as a local host server<\/span><span style=\"font-weight: 400;\"> for testing purposes.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Once the end user experience offered by the Search Assistant meets your expectations you can launch it in your desired channel.\u00a0<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">To get the SearchAssist Web SDK, write to &lt;emailSA&gt;@kore.ai<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Extract all files to your local folder<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">From the SearchAssist Business Portal -&gt; Manage -&gt; Web\/Mobile Client Channel page on the Channels menu, copy the following: (These values needs to updated in the \u2018findly-config.js\u2019 file)<\/span>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">App Name\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">App ID<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Client ID\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Client secret ID<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Search ID<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Open the extracted folder, locate and navigate to \/<\/span><i><span style=\"font-weight: 400;\">web-kore-sdk-private\/findly\/demo\/<\/span><\/i><span style=\"font-weight: 400;\"> folder<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Open \u2018<\/span><i><span style=\"font-weight: 400;\">findly-config.js\u2019 <\/span><\/i><span style=\"font-weight: 400;\">\u00a0file in any of the editors(Ex:- Notepad++, Visual studio)<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Update the botOptions parameters botInfo, clientId and clientSecret, and your emailID as userIdentity. modify the host URLs as per your instance<\/span><\/p>\n<p><span style=\"font-weight: 400;\">botOptionsFindly.koreAPIUrl = &#8220;Host URL&#8221;; (Ex: \u2018<\/span><span style=\"font-weight: 400;\">https:\/\/searchassist.kore.ai\/<\/span><span style=\"font-weight: 400;\">\u2019)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">botOptionsFindly.baseAPIServer = \u201c\u201d; \u00a0 (<\/span><span style=\"font-weight: 400;\">Ex: \u2018https:\/\/searchassist.kore.ai\/\u2019<\/span><span style=\"font-weight: 400;\">)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">botOptionsFindly.botInfo = { chatBot: &#8220;&#8221;, &#8220;taskBotId&#8221;: &#8220;&#8221;};<\/span><\/p>\n<p><span style=\"font-weight: 400;\">botOptionsFindly.clientId = &#8220;&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">botOptionsFindly.clientSecret = &#8220;&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">botOptionsFindly.searchIndexID = &#8220;&#8221;;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">botOptionsFindly.reWriteSocketURL = {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0protocol: &#8216;wss&#8217;,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0hostname: &#8221;\u00a0 (Ex: \u2018qa.kore.ai\u2019)<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0};<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Save the changes done in the \u2018Findly-config.js\u2019 file<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Locate and navigate to \/<\/span><i><span style=\"font-weight: 400;\">web-kore-sdk-private\/demo\/<\/span><\/i><span style=\"font-weight: 400;\"> folder<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Right-click \u201c<\/span><i><span style=\"font-weight: 400;\">index.html<\/span><\/i><span style=\"font-weight: 400;\">\u201d file and open with any one of the browsers<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">End User SDK will be opened with the changes done in the configured Search Assistant<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Start the searches in the SDK and relevant results are displayed.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Data searched in the End User SDK (\u201csearches\u201d,\u201dUsers\u201d,\u201dClicks\u201d and \u201cAppearance of Sources data\u201d) are displayed in the Business user portal.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">When you host the Search Assistant on a local system, it&#8217;s deployed on a given demo website template to demonstrate functionality and lets\u00a0 you evaluate how it\u00a0 performs on\u00a0 your content.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The UIs customized in the SearchAssist platform as a Business user can be viewed once the Search Assistant is hosted with the SDK or in the <\/span><b>Test <\/b><span style=\"font-weight: 400;\">mode prior to launching.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Note: If the Search Assistant is running in a <\/span><span style=\"font-weight: 400;\">local box<\/span><span style=\"font-weight: 400;\">, to validate it the following steps are mandatory<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">We need to run SDK in chrome browser in security disability mode to allow the Cross-Origin Resource Sharing (CORS)\u00a0\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">For that open windows run command and paste <\/span><i><span style=\"font-weight: 400;\">chrome.exe \u2013disable-web-security \u2013user-data-dir=c:\\my-chrome-data\\data<\/span><\/i><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Hit enter chrome will be opened in disabled security disabled mode paste the <\/span><i><span style=\"font-weight: 400;\">index.html<\/span><\/i><span style=\"font-weight: 400;\"> path here to run the sdk<\/span><\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Passing_data_via_webSDK\"><\/span><span style=\"font-weight: 400;\">Passing data via webSDK<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Pass additional information of the user accessing the channel by adding the custom data at botInfo inside the <\/span><i><span style=\"font-weight: 400;\">SearchAssist-config.js <\/span><\/i><span style=\"font-weight: 400;\">file.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">botOptionsFindly.botInfo = { <\/span><i><span style=\"font-weight: 400;\">chatBot: &#8220;&lt;App Name&gt;&#8221;,<\/span><\/i><i><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/i> <i><span style=\"font-weight: 400;\"> \u00a0 \u00a0 &#8220;taskBotId&#8221;: &#8220;&lt;App ID&gt;&#8221;<\/span><\/i><span style=\"font-weight: 400;\">,<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">&#8220;customData&#8221;:{<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\"> } };<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">Example:<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">botOptionsFindly.botInfo = {<\/span><i><span style=\"font-weight: 400;\">chatBot: &#8220;&lt;App Name&gt;&#8221;,\u00a0<\/span><\/i><\/p>\n<p><i><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8220;taskBotId&#8221;: &#8220;&lt;App ID&gt;&#8221;<\/span><\/i><span style=\"font-weight: 400;\">,<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#8220;customData&#8221;:{&#8220;test&#8221;:&#8221;s&#8221;}<br \/>\n<\/span><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0};<\/span><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Commonly_Encountered_Errors\"><\/span><span style=\"font-weight: 400;\">Commonly Encountered Errors<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li style=\"font-weight: 400;\"><i><span style=\"font-weight: 400;\">A wrong URL<\/span><\/i><span style=\"font-weight: 400;\"> 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 SearchAssist\u2019s web SDK.<\/span><\/li>\n<li style=\"font-weight: 400;\"><i><span style=\"font-weight: 400;\">Not found: <\/span><\/i><span style=\"font-weight: 400;\">User sees this error when either wrong clientID or no clientID is given. Check the correct ClientID from Business Portal -&gt; Manage -&gt; Web\/Mobile Client Channel page on the Channels menu<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">botOptions.clientId = \u201c{clientID}\u201d; provide secure client-id<\/span><\/li>\n<\/ul>\n<p><i><span style=\"font-weight: 400;\">error verifying the jwt: the <\/span><\/i><span style=\"font-weight: 400;\">Wrong clientSecret is given in index.html: Check the correct clientSecret you get from Business Portal -&gt; Manage -&gt; Web\/Mobile Client Channel page on the Channels menu<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">\u201cclientSecret\u201d: &#8220;{clientSecret}\u201d; provide clientSecret here<\/span><\/p>\n<p>&nbsp;<\/p>\n<\/div><\/div><\/div><\/div><\/div><\/div><\/section><section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row via_grid cols_1 laptops-cols_inherit tablets-cols_inherit mobiles-cols_1 valign_top type_default stacking_default\"><div class=\"wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"w-post-elm post_navigation layout_sided inv_false\"><a class=\"post_navigation-item order_first to_prev\" href=\"https:\/\/multisite.korebots.com\/SearchAssist\/developers-guide\/developers-corner\/\" title=\"Developer&#8217;s Corner\"><div class=\"post_navigation-item-img\"><img loading=\"lazy\" decoding=\"async\" class=\"g-placeholder\" src=\"https:\/\/multisite.korebots.com\/SearchAssist\/wp-content\/plugins\/us-core\/assets\/images\/placeholder.svg\" width=\"150\" height=\"150\" alt><\/div><div class=\"post_navigation-item-arrow\"><\/div><div class=\"post_navigation-item-title\"><span>Developer&#8217;s Corner<\/span><\/div><\/a><a class=\"post_navigation-item order_second to_next\" href=\"https:\/\/multisite.korebots.com\/SearchAssist\/concepts\/content-sources\/linking-virtual-assistant\/invoke-bot-actions\/\" title=\"Linking your Virtual Assistant\"><div class=\"post_navigation-item-img\"><img loading=\"lazy\" decoding=\"async\" class=\"g-placeholder\" src=\"https:\/\/multisite.korebots.com\/SearchAssist\/wp-content\/plugins\/us-core\/assets\/images\/placeholder.svg\" width=\"150\" height=\"150\" alt><\/div><div class=\"post_navigation-item-arrow\"><\/div><div class=\"post_navigation-item-title\"><span>Linking your Virtual Assistant<\/span><\/div><\/a><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"SearchAssist grants access to the folder required for the Web SDK and a test application to run the Search Assistant on your machine as a local host server for testing purposes. Once the end user experience offered by the Search Assistant meets your expectations you can launch it in your desired channel.\u00a0 To get the...","protected":false},"author":18,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[90],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/multisite.korebots.com\/SearchAssist\/wp-json\/wp\/v2\/posts\/1877"}],"collection":[{"href":"https:\/\/multisite.korebots.com\/SearchAssist\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multisite.korebots.com\/SearchAssist\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multisite.korebots.com\/SearchAssist\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/multisite.korebots.com\/SearchAssist\/wp-json\/wp\/v2\/comments?post=1877"}],"version-history":[{"count":14,"href":"https:\/\/multisite.korebots.com\/SearchAssist\/wp-json\/wp\/v2\/posts\/1877\/revisions"}],"predecessor-version":[{"id":3564,"href":"https:\/\/multisite.korebots.com\/SearchAssist\/wp-json\/wp\/v2\/posts\/1877\/revisions\/3564"}],"wp:attachment":[{"href":"https:\/\/multisite.korebots.com\/SearchAssist\/wp-json\/wp\/v2\/media?parent=1877"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multisite.korebots.com\/SearchAssist\/wp-json\/wp\/v2\/categories?post=1877"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multisite.korebots.com\/SearchAssist\/wp-json\/wp\/v2\/tags?post=1877"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}