So, Firebase offers something called "functions", which is essentially a nodejs server that has preconfigured all the Firebase stuff and automatically handles all the scaling. I am wondering if there is a way to call a function inside the "functions" index.js file from an angular 2 application?
I need to use the npm firebase-admin module to check if a user’s email exists and then grab the uid for that user if this happens.
According to this link, I can customize the index.js file, for example:
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase);
exports.getUserByEmail = (email) => {
return admin.auth().getUserByEmail(email);
}
Is there a way I can call getUserByEmail()inside a component in my angular 2 application?
Thanks in advance!
source
share