Firebase cloud functions
firebase.app().functions().httpsCallable('inviteUser')
.inviteUser(
{ email: email, fullname: 'John Doe', userId: generateUUID() }
);exports.inviteUser = functions
.https.onCall(async (data, context) => {
let company = await getCompanyNameFromUserId( context.auth.uid )
const { fullname, email, userId } = data;
// do the wiring with the vars extracted from data
// create user account, add user to company, send verification email
...
return ...
);
});Last updated