Setting up of Centralized websdk : Creation of a centralized SDK file for integration purposes

Creating a centralized SDK file for integration purposes involves consolidating the necessary SDK files and configurations into a single file that can be easily referenced and reused across different projects. Here’s a step-by-step guide to creating such a centralized SDK file for integrating the Kore.ai Web SDK:

  1. Download Kore.ai Web SDK:
  • Visit the Kore.ai Developer Portal and download the Web SDK files for the desired version.
  1. Create Centralized SDK Directory:
  • Within your project structure, create a new directory specifically for the centralized SDK files. You can name it something like sdk or kore-sdk.
  1. Copy SDK Files:
  • Copy all the necessary SDK files (e.g., kore-bot-sdk.js, kore-web-sdk.js , etc.) into this centralized SDK directory.
  1. Create Configuration File:
  • In the centralized SDK directory, create a new JavaScript file (e.g.,kore-config.js).
  1. Define SDK Initialization Settings:
  • In kore-config.js, define the Kore.ai Web SDK initialization settings such as API keys, bot IDs, and any other configurations required for your bots. Export these configuration settings using ES6 module syntax. For example:
export const koreConfig = {
    botName: 'YourBotName',
    apiKey: 'YourAPIKey',
    // Other configurations
};
  1. Export Configuration Settings:
  • Within kore-config.js, export the configuration settings using ES6 module syntax as shown above.
  1. Reference Centralized SDK in Other Projects:
  • In your other eServices projects where you want to integrate the Kore.ai Web SDK, import the kore-config.js file from the centralized SDK directory.
import { koreConfig } from './path/to/centralized/sdk/kore-config.js';
  1. Initialize SDK with Centralized Config:
  • Use the imported koreConfig object to initialize the Kore.ai Web SDK in your project’s JavaScript files.
var KoreSDK = new KoreWebSDK();
KoreSDK.init(koreConfig);
  1. Test Integration:
  • Start your eServices projects and test the bot integration to ensure that the centralized SDK configuration is applied correctly.

By following these steps, you’ll have a centralized SDK file (kore-config.js) that contains all the necessary configurations for integrating the Kore.ai Web SDK, making it easier to maintain and reuse across multiple projects.

1 Like

Thank you @santhoshvishal.veera for sharing this with the community.

1 Like