/invisible-grecaptcha

Invisible reCAPTCHA integration

Primary LanguageJavaScriptMIT LicenseMIT

invisible-grecaptcha

npm (scoped) Travis XO code style

Invisible reCAPTCHA integration

Checkout the demo.

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:

<script src="https://cdn.jsdelivr.net/npm/invisible-grecaptcha/dist/index.min.js"></script>

You can find the library on window.invisibleGrecaptcha.

Usage

import { 
  execute, 
  destroy, 
} from 'invisible-grecaptcha'


const token = await execute('RECAPTCHA_SITE_KEY')

destroy()

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

Returns string

destroy

Destroy the instance of an invisible grecaptcha.

Contributing

See the contributing file.

License

MIT License © Thiago Santos