This page walks through setting up your webhook and hosting, creating your Actions console project, and modifying your Dialogflow agent to use the webhook.
With Firebase, you can host both your webhook function and web app with one tool: the Firebase CLI. This page walks through the process of installing and setting up Firebase for your development.
Install the Firebase CLI
Install Node.js using one of the following options. Installing Node.js automatically installs npm.
Install the Firebase CLI using npm by running:
npm install -g firebase-tools
This command installs the globally available
firebasecommand. To update to the latest version of the Firebase CLI, re-run the same
Sign into Firebase using your Google account by running:
This command connects your local machine to Firebase and grants you access to your Firebase projects.
To test that authentication worked (and to list all of your Firebase projects), run the following command:
The displayed list should be the same as the Firebase projects listed in the Firebase console.
Update to the latest CLI version
Make sure that you're using the most up-to-date Firebase CLI version by re-running the CLI installation command:
npm install -g firebase-tools
Select to set up
Select a Firebase project to connect to your local project directory.
The selected Firebase project is your "default" Firebase project for your local project directory.
Specify a directory to use as your public root directory.
This directory contains all your publicly served static files, including your
index.htmlfile and any other assets that you want to deploy to Firebase Hosting.
The default for the public root directory is called
You can specify your public root directory now or you can specify it later in your
If you select the default and don't already have a directory called
public, Firebase creates it for you.
If you don't already have a valid
404.htmlfile in your public root directory, Firebase creates them for you.
Choose a configuration for your site.
If you select to make a one-page app, then Firebase automatically adds rewrite configurations for you.
At the end of initialization, Firebase automatically creates and adds two files to the root of your local app directory:
firebase.jsonconfiguration file that lists your project configuration. Learn more about this file on the configure hosting behavior page.
.firebasercfile that stores your project aliases.
To initialize Cloud Functions for Firebase for your project:
firebase loginto log in via the browser and authenticate the firebase tool.
- Go to your Firebase project directory.
firebase init functions. The tool gives you an option to install dependencies with npm. It is safe to decline if you want to manage dependencies in another way.
Next, you create an Actions console project and modify Dialogflow's
Default Welcome Intent to use fulfillment.
Create a project
- Go to the Actions console.
- Click New project.
- Enter a name for your project and click Create project.
- Click the Games & fun card.
Click the Conversational card.
Click Deploy in the top menu. Then, click Directory information.
At the bottom of the page, check the option under Interactive Canvas.
Click Overview in the top menu.
Click Build your Action then Add Action(s).
Click Add your first action.
Under Built-in intents, select Play game and click Get started in Dialogflow.
Configure the Dialogflow Agent
On the agent creation page, confirm the default language, time zone, and name for the agent and click CREATE.
On the Intents page, click on Default Welcome Intent.
At the bottom of the page, click Fulfillment to expand the section.
Click Enable webhook call for this intent.