https://github.com/dialogflow/fulfillment-firestore-nodejs
Integrating Firebase's Firestore database with Dialogflow
https://github.com/dialogflow/fulfillment-firestore-nodejs
actions-on-google add-to-dialogflow dialogflow-fulfillment-nodejs firestore-database
Last synced: 11 days ago
JSON representation
Integrating Firebase's Firestore database with Dialogflow
- Host: GitHub
- URL: https://github.com/dialogflow/fulfillment-firestore-nodejs
- Owner: dialogflow
- License: apache-2.0
- Created: 2018-07-24T15:59:40.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-12-18T16:58:27.000Z (7 months ago)
- Last Synced: 2025-05-25T23:03:23.655Z (about 2 months ago)
- Topics: actions-on-google, add-to-dialogflow, dialogflow-fulfillment-nodejs, firestore-database
- Language: JavaScript
- Homepage:
- Size: 444 KB
- Stars: 81
- Watchers: 8
- Forks: 39
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Dialogflow Firestore Sample
+ This sample demonstrates how to connect Dialogflow to the Firestore database.
+ Dialogflow parses users' requests and sends requests to Firebase function indicating whether it should add or retrieve an entry from the Firestore database. The Firebase function queries the database to add or retrieve the entry and then compiles the proper response to the user. You can speak to your Dialogflow agent and tell it to write something to the database or retrieve it.
+ The sample will save what you tell it to save into the database as well as retrieve the value you store previously.
+ When you speak to your Dialogflow agent a webhook call is sent to Firebase functions which talks to the Firestore database to retrieve or add a entry as see below:This sample is meant to be a starting point for anyone looking to connect a database to their Dialogflow agent and can be expanded to store users preferences, retrieve relevant data from your systems or enable your users to collaborate via chat/voice.
```
Dialogflow → Webhook Request → Firebase Function → Firestore Database
```## Setup
### Dialogflow and Fulfillment Setup
To create this agent from our template:### Firestore Setup
1. In Dialogflow's console, in the left menu > go to **Fulfillment** > **Enable Inline Editor** > **Deploy**.
2. At the bottom, go to **View execution logs in the Firebase console**.
3. In the Firebase console, go to **Database** > **Create database**.
4. Select **Start in locked mode** > **Enable**.## Running the sample
1. In [Dialogflow's console](https://console.dialogflow.com), in the Dialogflow simulator on the right, query your Dialogflow agent with `Write Buzz Aldrin to the database` and then query `What's in the database?` to get the response "Buzz Aldrin".## Related Samples
| Name | Language |
| ------------- |:-------------:|
| [Fulfillment & Regex Validation](https://github.com/dialogflow/fulfillment-regex-nodejs) | Node.js |
| [Weather: Fulfillment & WWO API](https://github.com/dialogflow/fulfillment-weather-nodejs) | Node.js |
| [Bike Shop: Fulfillment & Google Calendar API](https://github.com/dialogflow/fulfillment-bike-shop-nodejs)| Node.js |
| [Temperature Trivia: Fulfillment & Actions on Google](https://github.com/dialogflow/fulfillment-temperature-converter-nodejs) | Node.js |
| [Fulfillment & Actions on Google](https://github.com/dialogflow/fulfillment-actions-library-nodejs) | Node.js |
| [Fulfillment & Firestore Database](https://github.com/dialogflow/fulfillment-firestore-nodejs) | Node.js |
| [Multi-language/locale](https://github.com/dialogflow/fulfillment-multi-locale-nodejs) | Node.js |
| [Basic Slot Filling](https://github.com/dialogflow/fulfillment-slot-filling-nodejs) | Node.js |For Fulfillment Webhook [JSON Requests & Responses](https://github.com/dialogflow/fulfillment-webhook-json).
## References & Issues
+ Questions? Try [StackOverflow](https://stackoverflow.com/questions/tagged/dialogflow) or [Dialogflow Developer Community](https://plus.google.com/communities/103318168784860581977).
+ Find a bug? Report it on [GitHub](https://github.com/dialogflow/fulfillment-webhook-json/issues).
+ Dialogflow [Documentation](https://dialogflow.com/docs/getting-started/basics).
+ [Dialogflow's console](https://console.dialogflow.com).## How to make contributions?
Please read and follow the steps in the CONTRIBUTING.md.## License
See [LICENSE](LICENSE).## Terms
Your use of this sample is subject to, and by using or downloading the sample files you agree to comply with, the [Google APIs Terms of Service](https://developers.google.com/terms/).