WebChat
This guide provides detailed instructions on implementing a chatbot using the Microsoft Bot Framework WebChat JavaScript library. The implementation involves obtaining a token from a backend service a
Implementation Steps
Step 1: Obtain the Bot User Token (TBD)
import axios from 'axios';
export enum BOT_CODE_ENUM {
ISIGN = 'ISIGN_WEBCHAT'
}
const getBotToken = async () => {
try {
const response = await axios.post('https://initForClient', {
botCode: 'YOUR_BOT_CODE' // Defined by Backend, eg: BOT_CODE_ENUM.ISIGN
});
return response.data.token;
} catch (error) {
console.error('Error fetching bot token:', error);
}Step 2: Initialize the Chatbot
Step 3: Integrate the Chatbot into Your Application
React Example
Angular Example
Customization
Example of Custom Style Options:
Additional Resources
Last updated