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 app/-directory Next.js projects. The widget needs to run on the client, so the page or component must be "use client". The siteverify call lives server-side, either in a Server Action or an API route.
"use client";
import Script from "next/script";
import { type FormEvent, useRef, useState } from "react";
type TurnstileWidgetId = string;
type TurnstileApi = {
render: (
container: HTMLElement,
options: {
sitekey: string;
action: string;
callback: (token: string) => void;
},
) => TurnstileWidgetId;
reset: (widgetId: TurnstileWidgetId) => void;
};
declare global {
interface Window {
turnstile: TurnstileApi;
}
}
export default function SignupPage() {
const turnstileContainer = useRef<HTMLDivElement>(null);
const signupWidgetId = useRef<TurnstileWidgetId | null>(null);
const [token, setToken] = useState("");
function renderTurnstile() {
if (!turnstileContainer.current || signupWidgetId.current !== null) return;
signupWidgetId.current = window.turnstile.render(turnstileContainer.current, {
sitekey: "YOUR_SITEKEY",
action: "signup",
callback: setToken,
});
Next to this one in the catalogue, plus more from the same author.