Package Exports
- recaptcha_v2
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (recaptcha_v2) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Node-Recaptcha
Node modules support Google ReCAPTCHA
How to use
On browser :
<script src='https://www.google.com/recaptcha/api.js'></script>
<div class="g-recaptcha" data-sitekey="6Ld7yBMTAAAAAPfy0UHf5bN_YA4PbNGFCH06Yg0z"></div>
Server logic with express
var recaptcha = require("recaptcha_v2");
app.use("/test",function(req,res){
var captcha = new recaptcha({
secret : <your key>
response : req.body['g-recaptcha-response']
remoteip : <remote ip> //optional
});
captcha.verify(function(err,done){
if(err) {
return res.send(err)
}
if(done) {
// recaptcha verified
}
});
})