@zaneray/recaptcha-node
v1.0.1
Published
Wraps Recaptcha validation to a true/false
Downloads
5
Maintainers
Keywords
Readme
ZaneRay Recaptcha
- turns recaptcha api call into a boolean
Requirements
- understanding of Recaptcha https://www.google.com/recaptcha/about/
Usage
in your node project
npm install --save @zaneray/recaptcha-node
in your application code
const Recaptcha = require('@zaneray/recaptcha-node');
//score ranges from 0 - 1.0 - lower numbers are more prone to be bots
const recaptcha = new Recaptcha(process.env.RECAPTCHA_SECRET_KEY, process.env.RECAPTCHA_MINUMUM_SCORE);
if (recaptcha.verify(req.body['g-recaptcha-response'])) {
//likely not a bot, continue
} else {
//likely a bot, handle this case elegantly so real users are not angry
}