A drop-in AI-proof CAPTCHA widget for React. Works like reCAPTCHA v2 — no signup, no API key, no backend required. Serves faces hidden in AI-generated images.
Click the widget below to try it — this is the real thing, pulling live challenges from our database.
1. Install
npm install @latcha/react
# or
pnpm add @latcha/react2. Add to your form
import { LatchaWidget } from "@latcha/react";
function ContactForm() {
const [verified, setVerified] = useState(false);
return (
<form>
<input name="email" type="email" placeholder="Email" />
<textarea name="message" placeholder="Message" />
{/* CAPTCHA — works exactly like reCAPTCHA v2 */}
<LatchaWidget
onVerify={(token) => {
setVerified(true);
// Optionally pass token to your backend for server-side re-verification
}}
onError={(err) => console.error("CAPTCHA error", err)}
/>
<button type="submit" disabled={!verified}>
Send
</button>
</form>
);
}| Prop | Type | Default | Description |
|---|---|---|---|
| onVerify | (token: string) => void | — | Called on success. token is a short-lived challenge ID. |
| onError | (err: Error) => void | — | Called if the network request or API fails. |
| apiBase | string | "https://latcha.dev/api/latcha" | Override to self-host the API. |
| theme | "light" | "dark" | "light" | Widget color scheme. |