Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

grecaptcha

1.0.3 • Public • Published

grecaptcha

reCAPTCHA v3 / v2 client for Node

GitHub | NPM

Install

npm i grecaptcha

Usage in async context

const Grecaptcha = require('grecaptcha')
 
const client = new Grecaptcha('secret')
 
if (await client.verify('token')) {
    // reCAPTCHA response was accepted!
}
else {
    // reCAPTCHA token denied.
}

Usage in non-async context

const client = new Grecaptcha('secret')
 
client.verify('token').then((accepted) => {
    if (accepted) {
        // reCAPTCHA response was accepted!
    }
    else {
        // reCAPTCHA token denied.
    }
}).catch((err) =>  {
    // Request failed.
})

install

npm i grecaptcha

Downloadsweekly downloads

122

version

1.0.3

license

SEE LICENSE IN LICENSE.md

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability