A fully typed library to verify hCaptcha.com tokens submitted by users when solving captcha challenges.
Warning
This is an unofficial library; we are not affiliated with hCaptcha.com.
- Explore the API on jsDocs.io
- View package contents on unpkg
- View repository on GitHub
- Read the changelog on GitHub
- Read the official documentation on hCaptcha
Using npm
:
npm add verify-hcaptcha
Using yarn
:
yarn add verify-hcaptcha
Using pnpm
:
pnpm add verify-hcaptcha
Using bun
:
bun add verify-hcaptcha
Verify a token submitted by a user:
import { verifyHcaptchaToken } from "verify-hcaptcha";
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");
}
MIT
Copyright (c) 2024 Edoardo Scibona
See LICENSE file.