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": "^10.1.1" 
}

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();
dashbot.configHandler(app);
... 
//business logic
...
exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app);
Close Menu