Google Dialogflow with Firebase

Create a bot API key

Each bot needs its own API key for tracking.

Create a bot to get an API key.

Include the Dashbot NPM module in package.json

In the Dialogflow Inline Editor, include the npm module in package.json:

"dependencies": {
 <strong>"dashbot": "^11.1.0"</strong>

Include Dashbot

Use the API key created above.

'use strict';
const functions = require('firebase-functions');
const {dialogflow, BasicCard, SimpleResponse} = require('actions-on-google')
<strong>const dashbot = require('dashbot')(</strong>process.env.DASHBOT_API_KEY<strong>).google;</strong>

After creating a Dialogflow object, pass it to Dashbot

const app = dialogflow();
//business logic
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app);