Integrate with Dashbot using a Node integration
Create an API key
Here is a quick video guide on how to generate you Dashbot API keys.
Install Dashbot via NPM
npm install --save dashbot
Include Dashbot
Use the API key created above.
const dashbot = require('dashbot')(process.env.DASHBOT_API_KEY).universal;
Notice above, we assume you have set an environment variable DASHBOT_API_KEY
with your api key.
Whenever your bot sends, or receives data, log to Dashbot
See below for an example:
Log whenever your webhook is called
const messageForDashbot = {
"text": "Hi, bot",
"userId": "USERIDHERE123123",
"platformJson": {
"whateverJson": "any JSON specific to your platform can be stored here"
}
};
dashbot.logIncoming(messageForDashbot);
Whenever you send a message, log the response
const messageForDashbot = {
"text": "Hello, my human pet",
"userId": "USERIDHERE123123",
"platformJson": {
"whateverJson": "any JSON specific to your platform can be stored here"
}
};
dashbot.logOutgoing(messageForDashbot);
Example
View sample code.