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 > ConfirmationResult > confirm

ConfirmationResult.confirm() method

Finishes a phone number sign-in, link, or reauthentication.

Signature:

confirm(verificationCode: string): Promise<UserCredential>;

Parameters

Parameter Type Description
verificationCode string The code that was sent to the user's mobile device.

Returns:

Promise<UserCredential>

Example

const confirmationResult = await signInWithPhoneNumber(auth, phoneNumber, applicationVerifier);
// Obtain verificationCode from the user.
const userCredential = await confirmationResult.confirm(verificationCode);