Socket
Socket
Sign inDemoInstall

captcha-verifer

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    captcha-verifer

Verification your ReCaptcha or HCaptcha is easy


Version published
Weekly downloads
48
increased by20%
Maintainers
1
Install size
5.10 kB
Created
Weekly downloads
 

Readme

Source

captcha-verifer

Captcha Verifer

Verification your ReCaptcha or HCaptcha is easy

Advantages

  • Without any dependencies
  • Less than 5 kb
  • ES6
  • Verify two types of captcha (ReCaptcha and HCaptcha)
  • Ease to use

Installation

npm i captcha-verifer

Usage

const Captcha = require('captcha-verifer');
Captcha.verifer({
  type: 'recaptcha', // Required (recaptcha or hcaptcha)
  secretKey: 'superSecret', // Required
  token: 'TOKEN (Captcha response)', // Required
  ip: '47.16.0.0' // Optional
})
.then((captcha) => {
  if (!captcha.success) return; // Captcha not solved

  /* All good. There is your super code! */
})
.catch((e) => console.log(e));

Or

(async () => {
  try {
    const captcha = await Captcha.verifer({
      type: 'hcaptcha', // Required (recaptcha or hcaptcha)
      secretKey: 'superSecret', // Required
      token: 'TOKEN (Captcha response)', // Required
      ip: '47.16.0.0' // Optional
    });

    if (!captcha.success) return; // Captcha not solved

    /* Your perfect code here */
  } catch (e) {
    console.log(e);
  }
})();

You can also verify recaptcha 3

Captcha.verifer({
  type: 'recaptcha', // Required (recaptcha or hcaptcha)
  secretKey: 'superSecret', // Required
  token: 'TOKEN (Captcha response)', // Required
  ip: '47.16.0.0' //Optional
})
.then((captcha) => {
  if (!captcha.success || captcha.score <= 0.3) return; // Captcha not solved

  /* Pefect. Go ahead */
})
.catch((e) => console.log(e));

License

MIT

Keywords

FAQs

Last updated on 27 Nov 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc