Dashbot

Microsoft Bot Framework

Microsoft Bot Framework

Bot Framework v4

Create a bot API key

Each bot needs its own API key for tracking.

Create a bot to get an API key. Make sure to choose Microsoft as the platform.

NOTE: This integration only works with bot framework v4 If you are using a previous version of Microsoft Bot Framework, please see our deprecated integration here.

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).microsoft;

Use Dashbot Middleware for MS Bot Framework

const adapter = new BotFrameworkAdapter({
appId: process.env.MicrosoftAppId,
appPassword: process.env.MicrosoftAppPassword
});
adapter.use(dashbot.middleware());

Example

Once you install the Dashbot npm module, you can take a look at node_modules/dashbot/src/microsoft-botframework-example.js for a working example.

Integrate Dashbot with Luis to capture intents

const adapter = new BotFrameworkAdapter({
appId: process.env.MicrosoftAppId,
appPassword: process.env.MicrosoftAppPassword
});
const model = new LuisRecognizer({
appId: process.env.LuisAppId,
subscriptionKey: process.env.LuisSubscriptionKey,
serviceEndpoint: 'https://westus.api.cognitive.microsoft.com'
});
adapter.use(model);
adapter.use(dashbot.middleware(model));

Bot Framework v3 [Deprecated]

This is the documentation for Microsoft Bot Framework v3. We recommend you use v4 if possible.

Install Dashbot via NPM

npm install --save dashbot

Include Dashbot

Since MS Bot Framework allows you to deploy the same bot to multiple platforms, you should configure it using all of the API Keys that you created above.

If you are using this integration, do NOT choose “microsoft” for your platform when you create your bot on Dashbot.

For Facebook bots, we need your Facebook Page Token to be set too.

const dashbotApiMap = {
universal: process.env.DASHBOT_API_KEY_UNIVERSAL,
facebook: process.env.DASHBOT_API_KEY_FACEBOOK,
slack: process.env.DASHBOT_API_KEY_SLACK,
kik: process.env.DASHBOT_API_KEY_KIK,
webchat: process.env.DASHBOT_API_KEY_UNIVERSAL,
skype: process.env.DASHBOT_API_KEY_UNIVERSAL
}
const dashbot = require('dashbot')(dashbotApiMap).microsoftDeprecated;

Include the following line only if supporting a Facebook bot

dashbot.setFacebookToken(process.env.FACEBOOK_PAGE_TOKEN)

Use Dashbot Middleware for MS Bot Framework

bot.use(dashbot);
Edit this page on GitHub