Last active
May 9, 2018 06:29
-
-
Save DrDanL/f9a28ada85bd21588e70419c480c94a9 to your computer and use it in GitHub Desktop.
Firebase onCreate - see https://leightley.com/firebase-functions-oncreate-ondelete/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
admin.initializeApp(functions.config().firebase); | |
exports.createProfile = functions.auth.user().onCreate( event => { | |
return admin.database().ref(`/user/${event.data.uid}`).set({ | |
email: event.data.email, | |
emailUpdates: true | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment