Skip to content
Discussion options

You must be logged in to vote

You can use Firebase Authentication by importing getAuth and createUserWithEmailAndPassword like this:

import { getAuth, createUserWithEmailAndPassword } from "firebase/auth";

const auth = getAuth();
createUserWithEmailAndPassword(auth, email, password)
  .then((userCredential) => {
    console.log(userCredential.user);
  })
  .catch((error) => {
    console.error(error.message);
  });

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@lizansarkar
Comment options

Answer selected by lizansarkar
Comment options

You must be logged in to vote
1 reply
@lizansarkar
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Ask and answer questions about GitHub features and usage Programming Help Discussions around programming languages, open source and software development
2 participants