Google Dialogflow v1 with Firebase

DialogFlow has been updated to V2
DialogFlow V2 is now the default API. Google recommends migrating from V1.
Google requires a paid Firebase plan
Google currently requires a paid Firebase plan in order to access an external API.
We are working on a solution for this. In the meantime, try selecting a “Pay as you go” plan for testing.

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 DialogflowApp = require('actions-on-google').DialogflowApp;

<strong>const dashbot = require('dashbot')(</strong>process.env.DASHBOT_API_KEY<strong>).google;</strong>

After creating a DialogflowApp object, pass it to Dashbot

exports.dialogflowFirebaseFulfillment = functions.https.onRequest((request, response) => {
  const app = new DialogflowApp({request: request, response: response});
  <strong>dashbot.configHandler(app);</strong>
  ...
}