Official NodeJS client for BotMetrics - Bot & Conversation Analytics
Switch branches/tags
Nothing to show
Clone or download
Latest commit 3f788ff Jul 27, 2016
Type Name Latest commit message Commit time
Failed to load latest commit information.
test Major changes to support new api Jul 27, 2016
.gitignore Add track function and tests Jun 7, 2016 Major changes to support new api Jul 27, 2016
index.js Major changes to support new api Jul 27, 2016
package.json Bump version Jul 27, 2016


Official NodeJS client for BotMetrics, bot & conversation analytics.


npm install node-botmetrics --save

Facebook Messenger SDK

var botmetrics = require('node-botmetrics')('API_TOKEN').facebook;

Incoming'/webhook', function (req, res) {
    // Handle incoming message...


// Example POST to Facebook

var fbData = {
    recipient: { id: fbUserId },
    message: {
        text: 'Hi there!'

var options = {
    url: '',
    qs: { access_token: FB_PAGE_TOKEN },
    method: 'POST',
    json: fbData

request(options, function(err, res, body) {
    if (err) return console.log(err);
    // After FB post is successful, send req data to BotMetrics

Other Messaging Platforms

var botmetrics = require('node-botmetrics')('API_TOKEN');

    text: 'Hi there!',
    message_type: 'outgoing',
    user_id: '54367392345234',
    platform: 'kik'

Debug Mode

// Turn on debug mode to print BotMetrics API messages
var botmetrics = require('node-botmetrics')('API_TOKEN', true);


View complete documentation here: