Skip to content

Instantly share code, notes, and snippets.

@DrDanL
Last active May 9, 2018 06:29
Show Gist options
  • Save DrDanL/f9a28ada85bd21588e70419c480c94a9 to your computer and use it in GitHub Desktop.
Save DrDanL/f9a28ada85bd21588e70419c480c94a9 to your computer and use it in GitHub Desktop.
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