0.1.1 • Published 2 years ago

hcaptcha v0.1.1

Weekly downloads
1,428
License
MIT
Repository
github
Last release
2 years ago

hcaptcha

Verify hCaptcha token validity; simply w/ no dependencies.

Install

npm install --save hcaptcha

Usage

const {verify} = require('hcaptcha');

const secret = 'my hcaptcha secret from hcaptcha.com';
const token = 'token from widget';

verify(secret, token)
  .then((data) => {
    if (data.success === true) {
      console.log('success!', data);
    } else {
      console.log('verification failed');
    }
  })
  .catch(console.error);