
Security News
Frontier AI Is Now Critical Infrastructure
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.
@captigo/hcaptcha
Advanced tools
hCaptcha adapter for Captigo — client widget and server-side verification
hCaptcha adapter for Captigo — client widget lifecycle and server-side token verification.
Provides a browser-side widget lifecycle and a server-side token verification
helper behind the same CaptchaAdapter interface as the rest of the captigo
ecosystem.
npm install @captigo/hcaptcha
@captigo/core is installed automatically as a transitive dependency.
import { hcaptcha } from "@captigo/hcaptcha";
const adapter = hcaptcha({ siteKey: "your-site-key" });
const widget = adapter.render(container, {
callbacks: {
onSuccess: (token) => setHiddenField(token.value),
onExpire: () => clearField(),
onError: (err) => console.error(err.message),
},
});
// Cleanup on unmount:
widget.destroy();
const result = await adapter.verify(token, process.env.HCAPTCHA_SECRET!);
if (!result.success) {
return Response.json({ error: "CAPTCHA failed" }, { status: 400 });
}
Set size: "invisible" to render a hidden widget that fires when you call
widget.execute():
const adapter = hcaptcha({ siteKey: "...", size: "invisible" });
// adapter.meta.mode === "interactive"
const widget = adapter.render(container, { callbacks: { onSuccess: setToken } });
// On form submit:
const token = await widget.execute();
await submitForm(token.value);
The execute() call resolves when the user completes the (possibly invisible)
challenge, or rejects if the challenge expires or errors.
| Option | Type | Default | Description |
|---|---|---|---|
siteKey | string | — | Required. Your hCaptcha site key. |
size | "normal" | "compact" | "invisible" | "normal" | Widget variant. "invisible" requires widget.execute(). |
theme | "light" | "dark" | "light" | Widget color scheme. |
language | string | browser default | Language override (e.g. "en", "fr"). |
endpoint | string | "https://hcaptcha.com" | Custom endpoint for enterprise customers. |
tabindex | number | — | Tab index for the widget iframe. |
widget.execute() runs the challenge; the token
is delivered to onSuccess, and the promise returned by execute() resolves
once that happens.execute() promise is rejected.execute(action?): An optional action string may be passed for API
compatibility with captigo’s widget shape; hCaptcha does not use it, so it is
ignored.https://api.hcaptcha.com/siteverify (see adapter.verify).FAQs
hCaptcha adapter for Captigo — client widget and server-side verification
We found that @captigo/hcaptcha demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
The Fable shutdown shows how quickly model access can become a business continuity risk for AI-dependent engineering teams.

Security News
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.