Skip to content

Instantly share code, notes, and snippets.

@flatfisher
Created May 13, 2018 06:01
Show Gist options
  • Save flatfisher/ec696e9f8c821a00574bc5ed6dfb11ad to your computer and use it in GitHub Desktop.
Save flatfisher/ec696e9f8c821a00574bc5ed6dfb11ad to your computer and use it in GitHub Desktop.
Google Sign-In for the Assistantを試してみた #io18jp ref: https://qiita.com/flatfisher/items/4278bab47eaa7e8d5971
$ firebase init
? What language would you like to use to write Cloud Functions? JavaScript
? Do you want to use ESLint to catch probable bugs and enforce style? No
✔ Wrote functions/package.json
✔ Wrote functions/index.js
? Do you want to install dependencies with npm now? Yes
$ firebase deploy
Function URL: https://us-central1-flatfishtest.cloudfunctions.net/xxx
const payload = conv.user.profile.payload;
const name = payload.name;
const email = payload.email;
const picture = payload.picture;
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"serve": "firebase serve --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"dependencies": {
"actions-on-google": "^2.1.1",
"firebase-admin": "~5.12.0",
"firebase-functions": "^1.0.1"
},
"private": true
}
{
"aud": "",
"sub": "",
"email": "hogehoge@gmail.com",
"email_verified": true,
"exp": ,
"iss": "https://accounts.google.com",
"jti": "",
"iat": ,
"nbf": ,
"name": "name family name",
"picture": "https: //lh6.googleusercontent.com/hogehoge.jpg",
"given_name": "name",
"family_name": "family name"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment