I\'m new to Firebase and am using the email/password sign-in method. I have the method working fine however on my signup form I have additional fields I want to enter in the
For updating your database with additional parameters use the below given code and make changes accordingly.
function writeUserData(userId, name, email, imageUrl) {
firebase.database().ref('users/' + userId).set({
username: name,
email: email,
profile_picture : imageUrl
});
}
Initialization of firebase object was done for the old version, see this https://firebase.google.com/docs/web/setup , it uses firebase.initializeApp(config)
instead of new firebase()
to update your database with user's additional fields use this code
firebase.database().ref('users/' + user.uid).set({
firstName: firstName,
lastName: lastName
})