verify-hcaptcha
v3.1.0
Published
A fully typed library to verify hCaptcha.com tokens submitted by users when solving captcha challenges
Maintainers
Readme
✅ verify-hcaptcha
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.
Useful resources
- 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
Install
[!NOTE] Make sure you have Zod v4 installed in your application to use this package.
Using npm:
npm add zod verify-hcaptchaUsing yarn:
yarn add zod verify-hcaptchaUsing pnpm:
pnpm add zod verify-hcaptchaUsing bun:
bun add zod verify-hcaptchaUsage Examples
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");
}License
MITCopyright (c) 2025 Edoardo Scibona
See LICENSE file.
