Constructor

RecaptchaVerifier

new RecaptchaVerifier(container, parameters, app)

An reCAPTCHA-based application verifier.

Parameter

container

(non-null Element or string)

The reCAPTCHA container parameter. This has different meaning depending on whether the reCAPTCHA is hidden or visible. For a visible reCAPTCHA the container must be empty. If a string is used, it has to correspond to an element ID. The corresponding element must also must be in the DOM at the time of initialization.

parameters

Optional

Object

The optional reCAPTCHA parameters. Check the reCAPTCHA docs for a comprehensive list. All parameters are accepted except for the sitekey. Firebase Auth backend provisions a reCAPTCHA for each project and will configure this upon rendering. For an invisible reCAPTCHA, a size key must have the value 'invisible'.

Value may be null.

app

Optional

firebase.app.App

The corresponding Firebase app. If none is provided, the default Firebase App instance is used. A Firebase App instance must be initialized with an API key, otherwise an error will be thrown.

Value may be null.

Implements
firebase.auth.ApplicationVerifier

Property

type

string

The application verifier type. For a reCAPTCHA verifier, this is 'recaptcha'.

Implements
firebase.auth.ApplicationVerifier#type

Methods

clear

clear()

Clears the reCAPTCHA widget from the page and destroys the current instance.

render

render() returns firebase.Promise containing number

Renders the reCAPTCHA widget on the page.

Returns

non-null firebase.Promise containing number A Promise that resolves with the reCAPTCHA widget ID.

verify

verify() returns firebase.Promise containing string

Waits for the user to solve the reCAPTCHA and resolves with the reCAPTCHA token.

Implements
firebase.auth.ApplicationVerifier#verify
Returns

non-null firebase.Promise containing string A Promise for the reCAPTCHA token.