recaptchavalidator
v0.0.1
Published
A simple validator for Google's reCaptcha
Downloads
4
Maintainers
Readme
reCaptchaValidator
A very simple syncronous function for testing a reCaptcha response.
Installation
npm i --save recaptchavalidator
Usage
const reCaptchaValidator = require("recaptchavalidator"),
secret = "your google reCaptcha secret";
if (reCaptchaValidator(req.body['g-recaptcha-response'], secret)) {
// success
}
else {
// fail
}
Documentation
reCaptchaValidate(captchaResponse, secret)
Validate Google reCaptcha
Parameters
| Name | Type | Description | | --- | --- | --- | | captchaResponse | string | 'g-captcha-response' | | secret | string | your Google reCaptcha secret string |
Returns
boolean