1.0.37 • Published 5 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-serviceUsage
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
5 years ago
1.0.36
5 years ago
1.0.35
5 years ago
1.0.34
5 years ago
1.0.33
5 years ago
1.0.22
5 years ago
1.0.21
5 years ago
1.0.26
5 years ago
1.0.25
5 years ago
1.0.24
5 years ago
1.0.23
5 years ago
1.0.29
5 years ago
1.0.28
5 years ago
1.0.27
5 years ago
1.0.32
5 years ago
1.0.31
5 years ago
1.0.30
5 years ago
1.0.20
5 years ago
1.0.16
5 years ago
1.0.15
5 years ago
1.0.14
5 years ago
1.0.13
5 years ago
1.0.12
5 years ago
1.0.11
5 years ago
1.0.10
5 years ago
1.0.9
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago