I'm calling Firebase from Google Apps Script.
I am able to connect to Firebase and read/write data using the Firebase Google Apps Script library here https://sites.google.com/site/scriptsexamples/new-connectors-to-google-services/firebase
However this library doesn't seem to have support for the createUser functions. How should I create a new user in Firebase using Apps Script with the function createUserWithEmailAndPassword(email, password)?
Here is what I'm trying to do in Google Apps Script -
function create_user(email, password) {
var firebaseUrl = "https://myfb.firebaseio.com/";
var secret = "mysecret";
var base = FirebaseApp.getDatabaseByUrl(firebaseUrl, secret);
base.auth().createUserWithEmailAndPassword(email, password)
.catch(function(error) {
var errorCode = error.code;
var errorMessage = error.message;
Logger.log(errorMessage);
});
}
Any advice appreciated.
Regards Rahul