1.0.37 • Published 4 years ago
chatbot-api-service v1.0.37
Chatbot Service
Chatbot Service is a service which help you to interact with Amazon Lex Bot via Amazon Apigateway.
Installation
npm i chatbot-api-service
Usage
import { ChatbotService } from "chatbot-api-service";
const chatservice = new ChatbotService();
const apikey = 'xxxxxxx';
const apikeyLiveAgent = 'xxxxx';
const apiURL = 'xxxxxxxx';
const apiUrlLiveAgent = 'xxxxxxxxxxx'
const chatbotId = 'xxxxxxxx';
const sessionId = 'xxxxxxxx';
chatservice.setAttribute(apiURL, apikey, chatbotId, sessionId);
chatservice.sendMessageToBot(
"Test Message", typeof sessionDetails === 'object' && Object.keys(sessionDetails).length > 0 ? sessionDetails : '', typeof seesionAtribb === 'object' && Object.keys(seesionAtribb).length > 0 ? seesionAtribb : '', typeof userInfo === 'object' && Object.keys(userInfo).length > 0 ? userInfo : ''
).then((data) => {
console.log(data); // data from bot
}).catch((err) => {
console.log(error); // error from bot
});
Props
Prop name | Description | Type | Default value |
---|---|---|---|
setChatbotAttributes | To set chat bot attributes (apiURL: string, chatbotId: string, sessionId: string, apikey?: string) | function | none |
setLiveAgentAttributes | To set live agent attributes (apiUrlLiveAgent: string, apikeyliveAgent?: string) | function | none |
sendMessageToBot | To send message to bot (message: string, sessionDetails: any = null, sessionAttributes: any = null, userInfo: any = null) | function | none |
liveAgentMessage | To fetch live agent messages (sfKeys: any, recievedFirstCard: boolean) | function | none |
1.0.37
4 years ago
1.0.36
4 years ago
1.0.35
4 years ago
1.0.34
4 years ago
1.0.33
4 years ago
1.0.22
4 years ago
1.0.21
4 years ago
1.0.26
4 years ago
1.0.25
4 years ago
1.0.24
4 years ago
1.0.23
4 years ago
1.0.29
4 years ago
1.0.28
4 years ago
1.0.27
4 years ago
1.0.32
4 years ago
1.0.31
4 years ago
1.0.30
4 years ago
1.0.20
4 years ago
1.0.16
4 years ago
1.0.15
4 years ago
1.0.14
4 years ago
1.0.13
4 years ago
1.0.12
4 years ago
1.0.11
4 years ago
1.0.10
4 years ago
1.0.9
4 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago