Answers for "create user uid in firestore"

0

create user uid in firestore

const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);

const db = admin.firestore();

exports.createUser = functions.auth.user().onCreate((user) => {
    const { uid } = user;

    const userCollection = db.collection('users');

    userCollection.doc(uid).set({
        someData: "123"
    });
});
Posted by: Guest on August-11-2021

Code answers related to "create user uid in firestore"

Browse Popular Code Answers by Language