
CAPTCHA साबित करता है कि आप इंसान हैं। HATCHA साबित करता है कि आप नहीं हैं।
CAPTCHA सिद्ध करता है कि आप मानव हैं। HATCHA सिद्ध करता है कि आप नहीं हैं।
HATCHA (Hyperfast Agent Test for Computational Heuristic Assessment) एक विपरीत CAPTCHA है जो AI एजेंटों के लिए तुच्छ लेकिन मनुष्यों के लिए कठिन चुनौतियों के पीछे पहुँच को अवरुद्ध करता है — बड़ी संख्याओं का गुणा, स्ट्रिंग उलटना, बाइनरी डिकोडिंग, और अधिक।
npm install @mondaycom/hatcha-react @mondaycom/hatcha-server
// app/api/hatcha/[...hatcha]/route.ts
import { createHatchaHandler } from "@mondaycom/hatcha-server/nextjs";
const handler = createHatchaHandler({
secret: process.env.HATCHA_SECRET!,
});
export const GET = handler;
export const POST = handler;
// app/layout.tsx
import { HatchaProvider } from "@mondaycom/hatcha-react";
import "@mondaycom/hatcha-react/styles.css";
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>
<HatchaProvider>{children}</HatchaProvider>
</body>
</html>
);
}
"use client";
import { useHatcha } from "@mondaycom/hatcha-react";
function AgentModeButton() {
const { requestVerification } = useHatcha();
return (
<button
onClick={() =>
requestVerification((token) => {
console.log("Agent verified!", token);
})
}
>
Enter Agent Mode
</button>
);
}
# .env.local
HATCHA_SECRET=your-random-secret-here
Client Server
│ │
│ GET /api/hatcha/challenge │
│────────────────────────────────►│
│ │ Generate challenge
│ │ Hash answer
│ │ HMAC-sign { hash, expiry }
│ { challenge (no answer), token }
│◄────────────────────────────────│
│ │
│ Agent solves the challenge │
│ │
│ POST /api/hatcha/verify │
│ { answer, token } │
│────────────────────────────────►│
│ │ Verify HMAC signature
│ │ Check expiry
│ │ Compare answer hash
│ { success, verificationToken } │
│◄────────────────────────────────│
उत्तर कभी क्लाइंट तक नहीं पहुंचता। हस्ताक्षरित टोकन अपारदर्शी है और इसमें केवल हैश किया गया उत्तर + समाप्ति समय होता है। सत्यापन स्टेटलेस है — कोई डेटाबेस आवश्यक नहीं।
import { registerChallenge } from "@mondaycom/hatcha-server";
registerChallenge({
type: "hex",
generate() {
const n = Math.floor(Math.random() * 0xffffff);
return {
display: {
type: "hex",
icon: "0x",
title: "Hex Decode",
description: "Convert this hex number to decimal.",
prompt: `0x${n.toString(16).toUpperCase()}`,
timeLimit: 30,
answer: String(n),
},
answer: String(n),
};
},
});
HATCHA --hatcha-* के अंतर्गत स्कोप किए गए CSS कस्टम प्रॉपर्टीज़ का उपयोग करता है। इन्हें किसी भी पैरेंट एलिमेंट पर ओवरराइड करें:
[data-hatcha-theme] {
--hatcha-accent: #3b82f6;
--hatcha-accent-light: #60a5fa;
--hatcha-bg: #060b18;
--hatcha-fg: #e4eaf6;
--hatcha-success: #22c55e;
--hatcha-danger: #ef4444;
}
<HatchaProvider> या <Hatcha> को theme="dark", theme="light", या theme="auto" पास करें।
import express from "express";
import { hatchaRouter } from "@mondaycom/hatcha-server/express";
const app = express();
app.use(express.json());
app.use("/api/hatcha", hatchaRouter({ secret: process.env.HATCHA_SECRET! }));
app.listen(3000);
| पैकेज | विवरण |
|---|---|
@mondaycom/hatcha-core |
git clone https://github.com/mondaycom/HATCHA.git
cd HATCHA
pnpm install
pnpm build
cd examples/nextjs-app
pnpm dev
योगदान का स्वागत है! सेटअप निर्देशों और दिशानिर्देशों के लिए CONTRIBUTING.md देखें।
| प्रकार | आइकन | यह क्या करता है | समय सीमा |
|---|
math | × | 5-अंक × 5-अंक गुणा | 30 s |
string | ↔ | 60-80 वर्णों के यादृच्छिक स्ट्रिंग को उलटें | 30 s |
count | # | ~250 वर्णों में एक विशिष्ट वर्ण गिनें | 30 s |
sort | ⇅ | 15 संख्याओं को छाँटें, k-वां सबसे छोटा लौटाएं | 30 s |
binary | 01 | बाइनरी ऑक्टेट्स को ASCII में डिकोड करें | 30 s |
| चुनौती निर्माण और क्रिप्टोग्राफिक सत्यापन |
@mondaycom/hatcha-react | React घटक, प्रदाता, और शैलियाँ |
@mondaycom/hatcha-server | Next.js और Express सर्वर हैंडलर |