invisible-grecaptcha
Invisible reCAPTCHA integration
Table of Contents
Install
This project uses node and npm. Go check them out if you don't have them locally installed.
$ npm install --save invisible-grecaptcha
The UMD build is also available on jsdelivr:
You can find the library on window.invisibleGrecaptcha
.
Usage
const token = await
API
Table of Contents
execute
Creates an invisible reCAPTCHA instance, dynamically loading Google's library if necessary, and then returns a user response token. This is a client-side step, and the token must be sent to the server side for verification as a separate step. Tokens are single use and can be verified only once.
Parameters
sitekey
string Your recaptcha sitekey. You can get one here: https://www.google.com/recaptcha/admin.options
Object? The options to create an invisible reCAPTCHA. (optional, default{}
)options.locale
string Language of the captcha. See available language codes https://developers.google.com/recaptcha/docs/language. Auto-detects the user's language if unspecified. (optional, defaulten
)options.position
string Position the reCAPTCHA badge. Values: bottomright, bottomleft and inline. (optional, defaultbottomright
)options.baseUrl
(optional, default'https://www.google.com'
)
Returns string
destroy
Destroy the instance of an invisible grecaptcha.
Contributing
See the contributing file.