Skip to content

Instantly share code, notes, and snippets.

@deltaepsilon
Created March 25, 2017 23:00
Show Gist options
  • Save deltaepsilon/83448581c9f1a6b952743612cb1faaec to your computer and use it in GitHub Desktop.
Save deltaepsilon/83448581c9f1a6b952743612cb1faaec to your computer and use it in GitHub Desktop.
functions.auth.user().onCreate(event => {
const functions = require('firebase-functions');
const admin = require('firebase-admin');
const config = functions.config();
admin.initializeApp(config.firebase);
const user = event.data;
const userRef = admin.database().ref('/users').child(user.uid);
return userRef.update(user);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment