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 > EmailAuthProvider > credential

EmailAuthProvider.credential() method

Initialize an AuthCredential using an email and password.

Signature:

static credential(email: string, password: string): EmailAuthCredential;

Parameters

Parameter Type Description
email string Email address.
password string User account password.

Returns:

EmailAuthCredential

The auth provider credential.

Example 1

const authCredential = EmailAuthProvider.credential(email, password);
const userCredential = await signInWithCredential(auth, authCredential);

Example 2

const userCredential = await signInWithEmailAndPassword(auth, email, password);