actions-builder-canvas-nodejs
actions-builder-canvas-nodejs copied to clipboard
Interactive Canvas sample (using Actions Builder) in Node.js
Actions on Google: Interactive Canvas Sample
:warning: Warning: Conversational Actions will be deprecated on June 13, 2023. For more information, see Conversational Actions Sunset.
This sample demonstrates Interactive Canvas for Google Assistant Actions.
Prerequisites
- Node.js and NPM
- We recommend installing using nvm for Linux/Mac and nvm-windows for Windows
- Install the Firebase CLI
- We recommend using MAJOR version
8
,npm install -g firebase-tools@^8.0.0
- Run
firebase login
with your Google account
- We recommend using MAJOR version
Setup
Actions Console
- From the Actions on Google Console, New project > Create project > under What kind of Action do you want to build? > Game > Blank project for smart display
Firebase Hosting Deployment
- Run
firebase deploy --project {PROJECT_ID} --only hosting
to deploy the web app to Firebase Hosting- To find your Project ID: In the Actions Console console for your project, navigate to ⋮ > Project settings > Project ID.
Fulfillment setup
- Navigate to
sdk/webhooks/ActionsOnGoogleFulfillment/index.js
, and replace the place holder stringhttps://PROJECT_ID.web.app
of theCANVAS_URL
variable with the URL to your own web app.
Actions CLI
- Install the Actions CLI
- Navigate to
sdk/settings/settings.yaml
, and replace<PROJECT_ID>
with your project ID - Navigate to the
sdk/
directory by runningcd sdk
from the root directory of this project. - Run
gactions login
to login to your account. - Run
gactions push
to push your project. - Run
gactions deploy preview
to deploy your project.
Running this Sample
- You can test your Action on any Google Assistant-enabled device on which the Assistant is signed into the same account used to create this project. Just say or type, “OK Google, talk to my test app”.
- You can also use the Actions on Google Console simulator to test most features and preview on-device behavior.
References & Issues
- Questions? Go to StackOverflow or the Assistant Developer Community on Reddit.
- For bugs, please report an issue on Github.
- Actions on Google Documentation
- Actions on Google Codelabs
Contributing
Please read and follow the steps in the CONTRIBUTING.md.
License
See LICENSE.