Stay organized with collections
Save and categorize content based on your preferences.
Constructors
constructor
- new RecaptchaVerifier
(
container
:
any
|
string
,
parameters
?
:
Object
|
null
,
app
?
:
App
|
null
)
:
RecaptchaVerifier
-
Parameters
-
container: any | string
-
Optional parameters: Object | null
-
Optional app: App | null
Methods
clear
- clear
(
)
:
void
-
Returns void
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-09-28 UTC.
[null,null,["Last updated 2023-09-28 UTC."],[],[],null,["# RecaptchaVerifier | JavaScript SDK\n\n- [firebase](/docs/reference/js/v8/firebase).\n- [auth](/docs/reference/js/v8/firebase.auth).\n- RecaptchaVerifier\n================================================================================================================\n\nAn [reCAPTCHA](https://www.google.com/recaptcha/)-based application\nverifier.\n\nThis class does not work in a Node.js environment.\n\nparam\n\n: The reCAPTCHA container parameter. This\n has different meaning depending on whether the reCAPTCHA is hidden or\n visible. For a visible reCAPTCHA the container must be empty. If a string\n is used, it has to correspond to an element ID. The corresponding element\n must also must be in the DOM at the time of initialization.\n\nparam\n\n: The optional reCAPTCHA parameters. Check the\n reCAPTCHA docs for a comprehensive list. All parameters are accepted\n except for the sitekey. Firebase Auth backend provisions a reCAPTCHA for\n each project and will configure this upon rendering. For an invisible\n reCAPTCHA, a size key must have the value 'invisible'.\n\nparam\n\n: The corresponding Firebase app. If none is\n provided, the default Firebase App instance is used. A Firebase App\n instance must be initialized with an API key, otherwise an error will be\n thrown.\n\n### Implements\n\n- [ApplicationVerifier](/docs/reference/js/v8/firebase.auth.ApplicationVerifier)\n\nIndex\n-----\n\n### Constructors\n\n- [constructor](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier#constructor)\n\n### Properties\n\n- [type](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier#type)\n\n### Methods\n\n- [clear](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier#clear)\n- [render](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier#render)\n- [verify](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier#verify)\n\nConstructors\n------------\n\n### constructor\n\n- new RecaptchaVerifier ( container : any \\| string , parameters ? : Object \\| null , app ? : [App](/docs/reference/js/v8/firebase.app.App) \\| null ) : [RecaptchaVerifier](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier)\n-\n | Inherited from [RecaptchaVerifier](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier).[constructor](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier#constructor)\n\n #### Parameters\n\n -\n\n ##### container: any \\| string\n\n -\n\n ##### Optional parameters: Object \\| null\n\n -\n\n ##### Optional app: [App](/docs/reference/js/v8/firebase.app.App) \\| null\n\n #### Returns [RecaptchaVerifier](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier)\n\nProperties\n----------\n\n### type\n\ntype: string\n| Implementation of [ApplicationVerifier](/docs/reference/js/v8/firebase.auth.ApplicationVerifier).[type](/docs/reference/js/v8/firebase.auth.ApplicationVerifier#type)\nInherited from [RecaptchaVerifier](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier).[type](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier#type) \nThe application verifier type. For a reCAPTCHA verifier, this is 'recaptcha'.\n\nMethods\n-------\n\n### clear\n\n- clear ( ) : void\n-\n Inherited from [RecaptchaVerifier](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier).[clear](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier#clear) \n Clears the reCAPTCHA widget from the page and destroys the current instance.\n\n #### Returns void\n\n### render\n\n- render ( ) : Promise \\\u003c number \\\u003e\n-\n Inherited from [RecaptchaVerifier](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier).[render](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier#render) \n Renders the reCAPTCHA widget on the page.\n\n #### Returns Promise\\\u003cnumber\\\u003e\n\n A Promise that resolves with the\n reCAPTCHA widget ID.\n\n### verify\n\n- verify ( ) : Promise \\\u003c string \\\u003e\n-\n | Implementation of [ApplicationVerifier](/docs/reference/js/v8/firebase.auth.ApplicationVerifier).[verify](/docs/reference/js/v8/firebase.auth.ApplicationVerifier#verify)\n Inherited from [RecaptchaVerifier](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier).[verify](/docs/reference/js/v8/firebase.auth.RecaptchaVerifier#verify) \n Waits for the user to solve the reCAPTCHA and resolves with the reCAPTCHA\n token.\n\n #### Returns Promise\\\u003cstring\\\u003e\n\nA Promise for the reCAPTCHA token."]]
An reCAPTCHA-based application verifier.
This class does not work in a Node.js environment.
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.
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'.
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.