Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Sets up, repairs, or migrates Cloudflare Turnstile bot verification in existing frontends and backends, including server-side Siteverify.
48% 100%+52 ptsof test cases passed
Passed 23 of 23 test cases with the skill, and 11 of 23 without it.
This test ran on v2. v3 is the current version and hasn’t been tested on gemini-3.6-flash yet.
3 of 3 safety checks passed
Not used yet
For older Next.js projects using pages/ rather than app/. The widget renders client-side; siteverify lives in the API route.
import Script from "next/script";
export default function SignupPage() {
return (
<>
<Script src="https://challenges.cloudflare.com/turnstile/v0/api.js" />
<form action="/api/signup" method="POST">
<input name="email" type="email" required />
<div
className="cf-turnstile"
data-sitekey="YOUR_SITEKEY"
data-action="signup"
/>
<button type="submit">Sign up</button>
</form>
</>
);
}
This native form navigates to the API response, so it does not need client-side reset code.
API route (canonical siteverify):
import type { NextApiRequest, NextApiResponse } from "next";
const expectedHostnames = new Set(
(process.env.TURNSTILE_HOSTNAMES ?? "")
.split(",")
.map((h) => h.trim())
.filter(Boolean),
);
export default async function handler(
Next to this one in the catalogue, plus more from the same author.