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": {
"dashbot": "^11.1.0"

Include Dashbot

Use the API key created above.

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

After creating a Dialogflow object, pass it to Dashbot

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