All Projects → fereidani → recaptcha2

fereidani / recaptcha2

Licence: MIT license
Easy verifier for google reCAPTCHA version 2 for Node.js and Express.js

Programming Languages

coffeescript
4710 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to recaptcha2

Codeigniter-recaptcha
CodeIgniter library to use Google's reCAPTCHA V2
Stars: ✭ 25 (-47.92%)
Mutual labels:  recaptcha, google-recaptcha, recaptcha-api
Hooman
http interceptor to hoomanize cloudflare requests
Stars: ✭ 82 (+70.83%)
Mutual labels:  recaptcha, captcha
Beelabrecaptcha2bundle
💻 Symfony bundle for Google Recaptcha2
Stars: ✭ 47 (-2.08%)
Mutual labels:  recaptcha, captcha
dcat-auth-captcha
Sliding captcha for dcat-admin auth / dcat-admin登陆 滑动验证插件 多平台支持
Stars: ✭ 38 (-20.83%)
Mutual labels:  recaptcha, captcha
Angular Recaptcha
AngularJS directive to add a reCaptcha widget to your form
Stars: ✭ 502 (+945.83%)
Mutual labels:  recaptcha, captcha
Recaptcha
reCAPTCHA = REcognize CAPTCHA: A Burp Suite Extender that recognize CAPTCHA and use for intruder payload 自动识别图形验证码并用于burp intruder爆破模块的插件
Stars: ✭ 596 (+1141.67%)
Mutual labels:  recaptcha, captcha
Express Recaptcha
Implementation of google recaptcha v2 & V3 solutions for express.js
Stars: ✭ 104 (+116.67%)
Mutual labels:  recaptcha, captcha
AspNetCore-ReCAPTCHAv3
reCAPTCHA v3 Usage in Asp.Net Core MVC
Stars: ✭ 17 (-64.58%)
Mutual labels:  recaptcha, google-recaptcha
Python Anticaptcha
Client library for solve captchas with Anticaptcha.com support.
Stars: ✭ 137 (+185.42%)
Mutual labels:  recaptcha, captcha
Recaptcha Module
🤖 Simple and easy Google reCAPTCHA integration with Nuxt.js
Stars: ✭ 143 (+197.92%)
Mutual labels:  recaptcha, captcha
react-recaptcha-x
a React reCAPTCHA version 3 and version 2 (checkbox) component in one.
Stars: ✭ 21 (-56.25%)
Mutual labels:  recaptcha, google-recaptcha
Buster
Captcha solver extension for humans
Stars: ✭ 4,244 (+8741.67%)
Mutual labels:  recaptcha, captcha
Laravel Recaptcha
Google ReCaptcha package for Laravel
Stars: ✭ 273 (+468.75%)
Mutual labels:  recaptcha, form-validation
Rucaptcha
Captcha gem for Rails Application. No dependencies. No ImageMagick, No RMagick.
Stars: ✭ 607 (+1164.58%)
Mutual labels:  recaptcha, captcha
recaptcha-2-phpbbmod
reCAPTCHA v2 for phpBB Olympus 3.0
Stars: ✭ 14 (-70.83%)
Mutual labels:  recaptcha, captcha
Recaptcha Spring Boot Starter
Spring Boot starter for Google's reCAPTCHA
Stars: ✭ 103 (+114.58%)
Mutual labels:  recaptcha, captcha
Captcha solver
Universal python API to captcha solving services
Stars: ✭ 152 (+216.67%)
Mutual labels:  recaptcha, captcha
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 (-47.92%)
Mutual labels:  recaptcha, captcha
recaptcha
An easy-to-use reCAPTCHA package
Stars: ✭ 55 (+14.58%)
Mutual labels:  recaptcha, captcha
Ngx Captcha
ReCaptcha components for Angular. Live preview:
Stars: ✭ 115 (+139.58%)
Mutual labels:  recaptcha, captcha

reCAPTCHA2

Easy verifier for Google reCAPTCHA version 2 for Node.js

How to use

Step 1: Setup reCAPTCHA on your site

You need to receive your site key and secret key for your domain from https://www.google.com/recaptcha/intro/.

Follow the steps on this page to include the reCAPTCHA on your website.

Step 2: Initialize verifier

var reCAPTCHA = require('recaptcha2');

var recaptcha = new reCAPTCHA({
  siteKey: 'your-site-key', // retrieved during setup
  secretKey: 'your-secret-key', // retrieved during setup
  ssl: false // optional, defaults to true.
             // Disable if you don't want to access
             // the Google API via a secure connection
});

Step 3: Verifying the reCAPTCHA response

reCAPTCHA2 uses promises to validate the reCAPTCHA response, you can use one of the following methods:

  • please mention on catch, library passes error codes from google which you can translate with translateErrors method

Simple usage:

recaptcha.validate(key)
  .then(function(){
    // validated and secure
  })
  .catch(function(errorCodes){
    // invalid
    console.log(recaptcha.translateErrors(errorCodes)); // translate error codes to human readable text
  });

Optional: You can also pass the clients IP address to the validate method after the key. For more information on that, please see the reCAPTCHA documentation.

For use with Express (you need body-parser):

function submitForm(req, res) {
  recaptcha.validateRequest(req)
    .then(function(){
      // validated and secure
      res.json({formSubmit:true})
    })
    .catch(function(errorCodes){
      // invalid
      res.json({
        formSubmit: false,
        errors: recaptcha.translateErrors(errorCodes) // translate error codes to human readable text
      });
    });
}

Generating the reCAPTCHA widget

recaptcha.formElement() returns standard form element for reCAPTCHA which you should include at the end of your html form element.

You can also set CSS classes like this: recaptcha.formElement('custom-class-for-recaptcha'). The default class is g-recaptcha.

<div class="custom-class-for-recaptcha" data-sitekey="your-site-key"></div>

Changelog

Please see the CHANGELOG.md.

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].