Cloud Functions for Firebase - write to database when a new user created
问题 I am pretty new Cloud Functions for Firebase and the javascript language. I am trying to add a function every time a user created to write into the database. This is my code: const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeApp(functions.config().firebase); exports.addAccount = functions.auth.user().onCreate(event => { const user = event.data; // The firebase user const id = user.uid; const displayName = user.displayName; const photoURL