1.0.0 • Published 7 years ago

async-recaptcha v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

async-recaptcha

Handles Google reCaptcha verification asynchronously.

Installation

npm i -S async-recaptcha

Usage

const asyncRecaptcha = require("async-recaptcha"),
      secret         = "your google reCaptcha secret key";

// this example uses express/body-parser to get the g-captcha-response string
asyncRecaptcha(req.body['g-recaptcha-response'], secret)
    .then(function() {
        // success
    })
    .catch(function(error) {
        // fail
        console.log(error);
    });

Documentation

asyncRecaptcha(captchaResponse, secret)

Validate Google reCaptcha

Parameters

NameTypeDescription
captchaResponsestring'g-captcha-response'
secretstringyour Google reCaptcha secret string

Returns

Promise