0

I have created new app on firebase and enabled Email/Password provider.

    var firebase = require("firebase");
    var config = {
    apiKey: "===========",
    authDomain: "========.firebaseapp.com",
    databaseURL: "https://------.firebaseio.com",
    storageBucket: "-------.appspot.com",
  }; 
firebase.initializeApp(config);   

firebase.auth().createUserWithEmailAndPassword("email","password").catch(function(error) {
          // Handle Errors here.
          var errorCode = error.code;
          var errorMessage = error.message;
          // ...
        });

but I am getting firebase.auth().createUserWithEmailAndPassword() is not a function. using in nodejs and firebasae 3 please tell me what I am doing wrong

pRaNaY
  • 24,642
  • 24
  • 96
  • 146
mtahir08
  • 87
  • 7

1 Answers1

0

Currently Firebase node.js api does not allow you to create users.

If you get a little deeper into the firebase.auth() object you will find that this was design pretty much for authentication purposes rather then managing users. When talking about managing users, Firebase was built to be called in the application side.

firebase.auth(): 
 {createCustomToken: [Function],
  verifyIdToken: [Function],
  INTERNAL: 
   { delete: [Function],
     getToken: [Function],
     addAuthTokenListener: [Function],
     removeAuthTokenListener: [Function] } }
adolfosrs
  • 9,286
  • 5
  • 39
  • 67