0.0.1 • Published 7 years ago
recaptchavalidator v0.0.1
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