{"id":61804,"date":"2024-05-31T13:39:32","date_gmt":"2024-05-31T12:39:32","guid":{"rendered":"https:\/\/developer.kore.ai\/v10-2\/?p=61804"},"modified":"2024-05-31T13:39:55","modified_gmt":"2024-05-31T12:39:55","slug":"botkit-sdk-deployment-guide","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v10-2\/docs\/bots\/sdks\/botkit-sdk-deployment-guide\/","title":{"rendered":"BotKit SDK Deployment Guide: Architecture, Hosting, and Best Practices"},"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\"><div class=\"ult-spacer spacer-6ae8af29a3beb\" data-id=\"6ae8af29a3beb\" data-height=\"6\" data-height-mobile=\"6\" data-height-tab=\"6\" data-height-tab-portrait=\"\" data-height-mobile-landscape=\"\" style=\"clear:both;display:block;\"><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p><span style=\"font-weight: 400;\">The Kore.ai BotKit SDK is a powerful tool for extending and customizing Kore.ai virtual assistants. It allows developers to intercept messages sent to the Kore.ai platform and add custom processing logic, enabling advanced bot behaviors and integrations. However, deploying the BotKit SDK in a production environment requires careful planning and consideration to ensure scalability, high availability, and optimal performance.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This guide provides a comprehensive overview of the architecture, hosting options, system requirements, performance optimization techniques, load testing strategies, high availability configurations, API gateway integration, and security best practices for deploying the Kore.ai BotKit SDK at scale. Whether you are a developer, DevOps engineer, or IT architect, this handbook will provide you with the knowledge and guidelines necessary to successfully deploy and operate BotKit-enabled virtual assistants in an enterprise environment.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">We will begin by discussing the overall architecture and integration patterns between the Kore.ai platform and the BotKit SDK. Then, we will explore various hosting options and the system requirements for running BotKit. Performance optimization and load testing will be covered in detail, including best practices for writing efficient BotKit code and simulating production loads. We will also delve into high availability considerations, API gateway configuration, authentication and authorization mechanisms, and rate-limiting strategies.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">By following the guidelines and best practices outlined in this guide, you can confidently deploy the Kore.ai BotKit SDK, knowing that your virtual assistant can handle high traffic loads, provide optimal response times, and maintain high availability and security. Let&#8217;s get started on the path to BotKit production readiness!<\/span><\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae8af29a3cfa\" data-id=\"6ae8af29a3cfa\" 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>\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=\"Architecture\">Architecture<\/span><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The BotKit SDK is a Node.js application that enables intercepting messages to the Kore.ai platform to add custom processing.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">It runs as a standalone service that receives events from the Kore.ai platform based on the dialog flow.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The SDK receives message events, feedback survey events, and webhook events from Kore.ai.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">It can send responses back to Kore.ai to control the conversation flow.<\/span><\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae8af29a3dee\" data-id=\"6ae8af29a3dee\" 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>\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=\"Hosting_Considerations\">Hosting Considerations<\/span><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">The BotKit SDK can be hosted on a dedicated VM or using serverless functions like AWS Lambda.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">A typical VM configuration starts with 2 vCPUs and 4GB memory. Adjust based on load and performance testing.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Follow the BotKit installation steps provided in the Kore.ai documentation.<\/span><\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae8af29a3eb8\" data-id=\"6ae8af29a3eb8\" 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>\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=\"System_Requirements\">System Requirements<\/span><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Node.js version 16 or higher<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Typical starting server spec: 2 vCPU, 4GB memory<\/span><\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae8af29a3f60\" data-id=\"6ae8af29a3f60\" 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>\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=\"Performance\">Performance<\/span><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Load test the BotKit API to ensure it provides the required throughput.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Use tools like Apache Bench or JMeter to simulate request load and benchmark the BotKit instance.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Ensure all code within BotKit handlers uses asynchronous processing to avoid blocking the event loop.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Any synchronous, long-running code will negatively impact the overall responsiveness and throughput.<\/span><\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae8af29a4036\" data-id=\"6ae8af29a4036\" 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>\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=\"High_Availability\">High Availability<\/span><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Deploy multiple BotKit instances behind a load balancer in an active-active, highly available configuration.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Ensure the BotKit process is monitored and automatically restarted on failure.<\/span><\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae8af29a40da\" data-id=\"6ae8af29a40da\" 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>\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=\"Asynchronous_API\">Asynchronous API<\/span><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Kore.ai sends events to the configured BotKit API endpoint.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">BotKit supports asynchronous communication &#8211; Kore.ai can call the API with a return URL.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">BotKit should respond with an ACK immediately, then call the return URL to submit the final response later.<\/span><\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae8af29a4191\" data-id=\"6ae8af29a4191\" 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>\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=\"API_Authorization\">API Authorization<\/span><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Whitelist the Kore.ai platform IP addresses so that only Kore.ai can call your BotKit API.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Require Kore.ai to authenticate requests using the Client ID and Secret generated when registering the BotKit app.<\/span><\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae8af29a4232\" data-id=\"6ae8af29a4232\" 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>\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=\"Rate_Limit\">Rate Limit<\/span><\/h2>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Implement a rate limit on the BotKit API to protect against excessive requests.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Enforce limits per API key to prevent individual clients from overloading the system.<\/span><\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"ult-spacer spacer-6ae8af29a42ce\" data-id=\"6ae8af29a42ce\" 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":"The Kore.ai BotKit SDK is a powerful tool for extending and customizing Kore.ai virtual assistants. It allows developers to intercept messages sent to the Kore.ai platform and add custom processing logic, enabling advanced bot behaviors and integrations. However, deploying the BotKit SDK in a production environment requires careful planning and consideration to ensure scalability, high...","protected":false},"author":26,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-61804","post","type-post","status-publish","format-standard","hentry","category-sdks"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/posts\/61804","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/users\/26"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/comments?post=61804"}],"version-history":[{"count":8,"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/posts\/61804\/revisions"}],"predecessor-version":[{"id":61812,"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/posts\/61804\/revisions\/61812"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/media?parent=61804"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/categories?post=61804"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v10-2\/wp-json\/wp\/v2\/tags?post=61804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}