Create user with Phone number Firebase [duplicate]

Solution 1:

There are a lot of examples including the Firebase GitHub sample quick start apps: https://github.com/firebase/quickstart-js/blob/master/auth/phone-invisible.html

Also check the official docs on this: https://firebase.google.com/docs/auth/web/phone-auth

Here is a quick snippet on signing in a user with phone number:

firebase.auth().signInWithPhoneNumber("+xxxxxxxx", window.recaptchaVerifier)
  .then((confirmationResult) => {
    // At this point SMS is sent. Ask user for code.
    let code = window.prompt('Please enter the 6 digit code');
    return confirmationResult.confirm(code);
  })
  .then((result) {
    // User is now signed in and accessible via result.user.
  });
  .catch((error) => {
    // Error occurred.
  });