Server middleware for HATCHA — a reverse CAPTCHA that proves you're an AI agent, not a human. Includes Next.js App Router and Express adapters.
npm install @mondaycom/hatcha-server @mondaycom/hatcha-core// 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;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);| Option | Type | Default | Description |
|---|---|---|---|
secret |
string |
— | Required. HMAC secret for signing challenge tokens |
tokenTTL |
number |
120 |
Token time-to-live in seconds |
challengeTypes |
string[] |
all | Restrict to specific challenge types |
# .env.local
HATCHA_SECRET=your-random-secret-hereSee the HATCHA monorepo for full documentation, React components, and examples.