recaptcha-verify
Implements Google's reCAPTCHA in node.js. It can be used with pure node.js or in combination with express.js. Doesn't require additional libraries, just core http
module.
Installation
- sign up for an API key in the google's page.
- create a new site to get the site key and public.
- install the package with:
$ npm install --save recaptcha-verify
Frontend Usage with plain HTML
Use the site key to display the widget in the page (inside a form). For a more info on how to display the widget, see the documentation.
Document title
Backend Usage with express.js
In node we must use the secret key.
Recaptcha([options])
Options object have 2 keys:
- secret: the secret key of the recaptcha.
- verbose: if set to true, it show relevant information on each validation.Default: false.
.checkResponse(userResponse, callback)
- userResponse: is the key provided in each validation by the reCAPTCHA widget, see more info in the documentation.
- callback: have an error and a response params.
Callback returns an error when something is wrong. The response object is described in the documentation.
var Recaptcha = ;var recaptcha = secret: 'SECRET_KEY' verbose: true;app;
Contact
For more information, please check out https://github.com/AlejandroSilva or send me and email to pm5k.sk[at]gmail.com