New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

verify-hcaptcha

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

verify-hcaptcha

A no dependencies, fully typed library to verify hCaptcha tokens submitted by users

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
190
increased by167.61%
Maintainers
1
Weekly downloads
 
Created
Source

verify-hcaptcha

Build status Coverage jsDocs.io Language Dependencies npm bundle size npm License

A no dependencies, fully typed library to verify hCaptcha tokens submitted by users through CAPTCHA challenges.

Note: this is an unofficial library; we are not affiliated with hCaptcha.com

Features

  • No dependencies
  • Fully typed API and response data
  • Well documented and tested

API & Package Info

Install

Using npm:

npm i verify-hcaptcha

Using yarn:

yarn add verify-hcaptcha

Usage Examples

Verify a token submitted by a user:

import { verifyHcaptchaToken } from 'verify-hcaptcha';

(async () => {
    const result = await verifyHcaptchaToken({
      token: "USER-SUBMITTED-RESPONSE-TOKEN",
      secretKey: "YOUR-SECRET-KEY",
      siteKey: "YOUR-SITE-KEY",
    });

    if (result.success) {
      console.log("User is human");
    } else {
      console.log("User is robot");
    }
})();

Verify a token submitted by a user and get the raw response from hCaptcha:

import { rawVerifyHcaptchaToken } from 'verify-hcaptcha';

(async () => {
    const result = await rawVerifyHcaptchaToken({
      token: "USER-SUBMITTED-RESPONSE-TOKEN",
      secretKey: "YOUR-SECRET-KEY",
      siteKey: "YOUR-SITE-KEY",
    });

    if (result.success) {
      console.log("User is human");
    } else {
      console.log("User is robot");
    }
})();

License

MIT License

Copyright (c) 2021 Edoardo Scibona

See LICENSE file.

Keywords

FAQs

Package last updated on 02 Oct 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc