All Projects → szchenghuang → react-google-invisible-recaptcha

szchenghuang / react-google-invisible-recaptcha

Licence: MIT License
A React component which is simply interested in Google invisible reCaptcha.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to react-google-invisible-recaptcha

Codeigniter-recaptcha
CodeIgniter library to use Google's reCAPTCHA V2
Stars: ✭ 25 (-56.9%)
Mutual labels:  recaptcha, recaptcha-widget
invisible-recaptcha
An invisible reCAPTCHA package for Laravel, Lumen, CI or native PHP.
Stars: ✭ 15 (-74.14%)
Mutual labels:  recaptcha, invisible-recaptcha
reCAPTCHA
‼️ Google reCAPTCHA (security) for Nette Framework \ Forms
Stars: ✭ 35 (-39.66%)
Mutual labels:  recaptcha
Contact-Form-PHP
Simple and secure contact form using Ajax, validations inputs, SMTP protocol and Google reCAPTCHA v3 in PHP.
Stars: ✭ 28 (-51.72%)
Mutual labels:  recaptcha
am-i-human
自分が人間か不安になったときに使うページ
Stars: ✭ 68 (+17.24%)
Mutual labels:  recaptcha
authentication-service
Authentication microservice. The integration only requires redirects and JWT tokens
Stars: ✭ 19 (-67.24%)
Mutual labels:  recaptcha
ContactEtc
Laraval package to instantly add a customisable contact form to your site.
Stars: ✭ 21 (-63.79%)
Mutual labels:  recaptcha
captcha-solver
Library and CLI for automating captcha verification across multiple providers.
Stars: ✭ 101 (+74.14%)
Mutual labels:  recaptcha
2captcha-python
Python 3 package for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, hcaptcha, funcaptcha, geetest and solve any other captchas.
Stars: ✭ 140 (+141.38%)
Mutual labels:  recaptcha
acf-recaptcha
Google reCAPTCHA plugin for Advanced Custom Fields on WordPress
Stars: ✭ 29 (-50%)
Mutual labels:  recaptcha
2captcha-go
Golang Module for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, hcaptcha, funcaptcha, geetest and solve any other captchas.
Stars: ✭ 31 (-46.55%)
Mutual labels:  recaptcha
recaptcha
Google reCAPTCHA v2 PHP class
Stars: ✭ 41 (-29.31%)
Mutual labels:  recaptcha
wagtail-django-recaptcha
A simple recaptcha field for Wagtail Form Pages
Stars: ✭ 47 (-18.97%)
Mutual labels:  recaptcha
instacop
InstaCop — Enhanced shopping experience for the adidas.com online store 🦓
Stars: ✭ 68 (+17.24%)
Mutual labels:  recaptcha
2captcha-php
PHP package for easy integration with the API of 2captcha captcha solving service to bypass recaptcha, hcaptcha, funcaptcha, geetest and solve any other captchas.
Stars: ✭ 25 (-56.9%)
Mutual labels:  recaptcha
AspNetCore-ReCAPTCHAv3
reCAPTCHA v3 Usage in Asp.Net Core MVC
Stars: ✭ 17 (-70.69%)
Mutual labels:  recaptcha
Captcha-Tools
All-in-one Python (And now Go!) module to help solve captchas with Capmonster, 2captcha and Anticaptcha API's!
Stars: ✭ 23 (-60.34%)
Mutual labels:  recaptcha
LSTM-CTC-recaptcha
recaptcha with lstm and mxnet
Stars: ✭ 28 (-51.72%)
Mutual labels:  recaptcha
recaptcha
An easy-to-use reCAPTCHA package
Stars: ✭ 55 (-5.17%)
Mutual labels:  recaptcha
vue-programmatic-invisible-google-recaptcha
🔒A simple invisible Google reCAPTCHA component focused solely on programmatic invocation.
Stars: ✭ 28 (-51.72%)
Mutual labels:  recaptcha

react-google-invisible-recaptcha

A React component which is interested in only Google invisible reCAPTCHA.

  • Support multiple reCAPTCHA widgets on one page.
  • Support React hooks.
  • Support Typescript.

Migration from 0.x to 1.0.0

// Version 0.x
<Recaptcha ref={ref => this.recaptcha = ref} ... />
// this.recaptcha.execute invokes the reCAPTCHA check.

// Version 1.0.0
const refCaptcha = React.useRef(null) // or React.createRef().
<Recaptcha ref={refRecaptcha} ... />
// refRecaptcha.current.callbacks.execute invokes the reCAPTCHA check.
//             ^^^^^^^^^^^^^^^^^^

Demo

Type something in an input box and click the button to submit data. The value is then checked to make up example client-side validation. Only valid input triggers reCAPTCHA. Since the reCAPTCHA is invisible, it proceeds most likely as if none is attached. You will only be present the figure of the reCAPTCHA when Google hesitates to tell your identity.

When reCAPTCHA is resolved, the demo page shows the result token for demo purpose. In a real application, it should be used with a HTTP request targeting at https://www.google.com/recaptcha/api/siteverify?secret=<secret>&response=<token> on the server to validate the reCAPTCHA result before any sensitive operation is performed. Checking input values derived from clients on the server imporves security as well.

Example

See the example/ folder for an example.

Install

// 1.0.0 prerelease.
npm install react-google-invisible-recaptcha@next --save
npm install react-google-invisible-recaptcha --save

Usage

import Recaptcha from 'react-google-invisible-recaptcha';

<Recaptcha
  onResolved={() => console.log('Human detected.')} />
  ref={refRecaptcha}
  sitekey={<sitekey>}

Configuration

Set required props to get going.

  • sitekey: sitekey for your recaptcha. Required.

A few optional props you can tweak.

  • badge: bottomright, bottomleft, or inline. Default: bottomright.
  • locale: in which language it speaks. Default: en.
  • nonce: nonce included in the reCAPTCHA script tag. Default: undefined.
  • onExpired: callback when the recaptcha response expires. Default: noop.
  • onError: callback when the recaptcha encounters an error. Default: noop.
  • onLoaded: callback when the recaptcha is loaded. Default: noop.
  • onResolved: callback when the recaptcha is resolved. Default: noop.
  • style: custom CSS applied to the root node. Default: undefined.
  • tabindex: tabindex of the challenge. Default: 0.

APIs

// Functional component with React hooks.
const refRecaptcha = React.useRef(null);
<Recaptcha ref={refRecaptcha} ... />

// Class component.
this.refRecaptcha = React.createRef();
<Recaptcha ref={refRecaptcha} ... />

// refRecaptcha.current.callbacks.execute function which invokes the reCAPTCHA check.
// refRecaptcha.current.callbacks.reset function which resets the reCAPTCHA widget.
// refRecaptcha.current.callbacks.getResponse function which returns the response token.

License

MIT. See LICENSE.md for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].