Chatbot Smart Widget BFF (Node)
This is a Node.js backend service library to create a BFF service for the Chatbot Smart Widget. The widget provides a chat interface.
There is a demo service, see below for instructions on running it.
How to use
Copy the .npmrc file from this repo to your application's folder.
Then install (you will need to be on the digipolis network):
> npm install --save @acpaas-ui-widgets/nodejs-chatbot
const express = ;const chatbotService = ;const app = ;const controller = chatbotServicechatbot;app;app;
;;const app = ;const controller = chatbotService;app;app;
Run the demo app
Create a .env file containing:
Obtain the APIKEY by taking out a contract on the
chatbot-api service on api-store.antwerpen.be. The ACCESS_TOKEN value can be obtained at the bottom of the settings screen ("API token") on chatbots.antwerpen.be.
-a extensions where needed to the host names to access the development or acceptance environments.)
Run the service:
> npm install> npm start
- message: Your message to the bot,
- session_id: The chatsession
- type: message
- send: true
- metadata:: Metadata to be passed along, this has to be an object.
If the responseHandler is set to false the package will not send the http response. Instead it will call the next function and put the response on
This feature can be used if you would like to modify / filter the message before it's sent to the client.
An example swagger description is included.
We welcome your bug reports and pull requests.
Please see our contribution guide.
This project is published under the MIT license.