The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/auth > createUserWithEmailAndPassword

createUserWithEmailAndPassword() function

Creates a new user account associated with the specified email address and password.

Signature:

export declare function createUserWithEmailAndPassword(auth: Auth, email: string, password: string): Promise<UserCredential>;

Parameters

Parameter Type Description
auth Auth The Auth instance.
email string The user's email address.
password string The user's chosen password.

Returns:

Promise<UserCredential>

Description

On successful creation of the user account, this user will also be signed in to your application.

User account creation can fail if the account already exists or the password is invalid.

Note: The email address acts as a unique identifier for the user and enables an email-based password reset. This function will create a new user account and set the initial user password.