reCAPTCHA v3 / v2 client for Node
npm i grecaptcha
const Grecaptcha = require('grecaptcha')
const client = new Grecaptcha('secret')
if (await client.verify('token')) {
// reCAPTCHA response was accepted!
}
else {
// reCAPTCHA token denied.
}
const client = new Grecaptcha('secret')
client.verify('token').then((accepted) => {
if (accepted) {
// reCAPTCHA response was accepted!
}
else {
// reCAPTCHA token denied.
}
}).catch((err) => {
// Request failed.
})