Skip to content

Instantly share code, notes, and snippets.

@shrutishrestha
Last active August 22, 2018 05:38
Show Gist options
  • Save shrutishrestha/c5b725236fee055e03f59944945c4859 to your computer and use it in GitHub Desktop.
Save shrutishrestha/c5b725236fee055e03f59944945c4859 to your computer and use it in GitHub Desktop.
do :
1. gcloud init
2. set project : export GOOGLE_CLOUD_PROJECT=your-project id
download google credential :
1. go to your project in datastore
i. in left menu click the api & services -> Credentials -> Create Credentials -> new service account -> download the json file
ii. keep the downloaded json in project directory(recommended)
2. set project credentials export GOOGLE_APPLICATION_CREDENTIAL = path to your downloaded google credentials downloaded above
Firebase CLI
1. Create Dialogflow Agent
2. clone project
3. cd to the functions directory
4. npm install
5. Install the Firebase CLI by running npm install -g firebase-tools
6. Login with your Google account, firebase login
7. Add your project to the sample with $ firebase use <project ID>
8. In Dialogflow console under Settings ⚙ > General tab > copy Project ID.
9. Run firebase deploy --only functions:dialogflowFirebaseFulfillment
10. When successfully deployed, visit the Project Console link > Functions > Dashboard
11. Copy the link under the events column. For example: https://us-central1-<PROJECTID>.cloudfunctions.net/<FUNCTIONNAME>
12. change the agent.json file webhook url to the above url from no. 11
13. Back in Dialogflow Console > Fulfullment > Enable Webhook.
14. Paste the URL from the Firebase Console’s events column into the URL field > Save.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment