How to use dashbot - 8 common examples

To help you get started, we’ve selected a few dashbot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hoodsy / messenger-bot-boilerplate / src / config / index.js View on Github external
export const FB_VERIFY_TOKEN = process.env.FB_VERIFY_TOKEN
export const FB_PAGE_TOKEN = process.env.FB_PAGE_TOKEN
export const FB_APP_SECRET = process.env.FB_APP_SECRET
export const FB_PAGE_TEST_TOKEN = process.env.FB_PAGE_TEST_TOKEN
export const FB_APP_TEST_SECRET = process.env.FB_APP_TEST_SECRET
export const WIT_TOKEN = process.env.WIT_TOKEN
const DASHBOT_KEY = process.env.DASHBOT_KEY
export const NODE_ENV = process.env.NODE_ENV

//
// Analytics
// ---
// Facebook Messenger
//
export const dashbot = Dashbot(DASHBOT_KEY).facebook

export function choosePageToken() {
  return (NODE_ENV === 'production')
    ? FB_PAGE_TOKEN
    : FB_PAGE_TEST_TOKEN
}

export function chooseAppSecret() {
  return (NODE_ENV === 'production')
    ? FB_APP_SECRET
    : FB_APP_TEST_SECRET
}
github gratifyguy / botkit-mock / examples / botkit-starter-slack / components / plugin_dashbot.js View on Github external
module.exports = function (controller) {
	
	// Dashbot is a turnkey analytics platform for bots.
	// Sign up for a free key here: https://www.dashbot.io/ to see your bot analytics in real time.
	if (process.env.DASHBOT_API_KEY) {
		var dashbot = require('dashbot')(process.env.DASHBOT_API_KEY).slack;
		controller.middleware.receive.use(dashbot.receive);
		controller.middleware.send.use(dashbot.send);
		controller.log.info('Thanks for using Dashbot. Visit https://www.dashbot.io/ to see your bot analytics in real time.');
	} else {
		controller.log.info('No DASHBOT_API_KEY specified. For free turnkey analytics for your bot, go to https://www.dashbot.io/ to get your key.');
	}
	
};
github jovotech / jovo-framework / lib / integrations / analytics / dashbotAnalytics.js View on Github external
constructor(config) {
        try {
            this.dashbot = require('dashbot')(_.get(config, 'key')).alexa;
            this.platformType = BaseApp.PLATFORM_ENUM.ALEXA_SKILL;
        } catch (err) {
            console.log('\nPlease install dashbot: npm install dashbot\n');
        }
    }
github fosterlabs / botstackjs / src / webhook_post.js View on Github external
const fb = require('./fb');
const apiai = require('./api-ai.js');
const botmetrics = require('./bot-metrics.js');
const dashbot = require('dashbot')(process.env.DASHBOT_API_KEY).facebook;
const sessionStore = require('./session.js')();
const log = require('./log.js');

module.exports = (req, res, next) => {
  console.log(' ');
  console.log('===Received a message from FB');

  res.end();
  dashbot.logIncoming(req.body);

  console.log(`JSON:${JSON.stringify(req.body)}`);

  const entries = req.body.entry;
  entries.forEach((entry) => {
    const messages = entry.messaging;
    messages.forEach((message) => {
github jovotech / jovo-framework / lib / integrations / analytics / dashbotAnalytics.js View on Github external
constructor(config) {
        try {
            this.dashbot = require('dashbot')(_.get(config, 'key')).google;
            this.platformType = BaseApp.PLATFORM_ENUM.GOOGLE_ACTION;
        } catch (err) {
            console.log('\nPlease install dashbot: npm install dashbot\n');
        }
    }
github hubtype / botonic / packages / botonic-plugin-dashbot / src / index.js View on Github external
async post({ input, session, lastRoutePath, response }) {
    const messageInDashbot = {
      text: input.data,
      userId: session.user.id
    }
    await dashbot.logIncoming(messageInDashbot)

    const messageOutDashbot = {
      text: response,
      userId: session.user.id
    }
    await dashbot.logOutgoing(messageOutDashbot)
  }
}
github hubtype / botonic / packages / botonic-plugin-dashbot / src / index.js View on Github external
async post({ input, session, lastRoutePath, response }) {
    const messageInDashbot = {
      text: input.data,
      userId: session.user.id
    }
    await dashbot.logIncoming(messageInDashbot)

    const messageOutDashbot = {
      text: response,
      userId: session.user.id
    }
    await dashbot.logOutgoing(messageOutDashbot)
  }
}

dashbot

Analytics for your bot

SEE LICENSE IN LICENSE
Latest version published 3 years ago

Package Health Score

49 / 100
Full package analysis