turnstile-spin

Set up Cloudflare Turnstile end-to-end with widget creation, siteverify wiring, and validation.

Updated Oct 15, 2019
One-click install
npx skills add https://github.com/kkkaoru/dotfiles --skill turnstile-spin-kkkaoru
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: turnstile-spin
Source: https://github.com/kkkaoru/dotfiles/tree/main/.agents/skills-stroage/turnstile-spin
Command: npx skills add https://github.com/kkkaoru/dotfiles --skill turnstile-spin-kkkaoru

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Adding bot protection to forms and endpoints requires coordinating Cloudflare API credentials, widget creation, frontend embeds, and server-side siteverify validation, which is error-prone when done manually. ## Core Features & Use Cases - Guided setup wizard: Probes API token scope, creates the Turnstile widget via the Cloudflare API or Wrangler, and registers approved domains. - Framework-specific integration: Embeds the widget and wires canonical server-side siteverify into existing handlers for Next.js, Astro, SvelteKit, Hugo, and vanilla HTML projects. - Secret-safe validation: Validates the widget secret via dummy siteverify and a real token round-trip without printing secrets to chat, logs, or disk. - Use Case: Ask the agent to protect a signup form from bots; it scans the codebase, creates the widget, gates the existing handler on siteverify success, and confirms replayed tokens are rejected. ## Quick Start Ask the agent to add Cloudflare Turnstile bot protection to your signup form and follow the guided setup wizard.

Frequently Asked Questions about turnstile-spin

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add Cloudflare Turnstile to a form?

Run the guided wizard: it probes your Cloudflare API token, creates a widget with your approved domains, embeds the cf-turnstile div in your form, and adds a siteverify check inside your existing backend handler. The handler logic stays unchanged, only gated on success.

How do I migrate from reCAPTCHA or hCaptcha to Turnstile?

The codebase scan detects reCAPTCHA or hCaptcha and switches to a migration plan: swap the script tag and widget class, rename the token field to cf-turnstile-response, and point the backend at the Turnstile siteverify URL. reCAPTCHA Enterprise is not auto-migrated.

Does Turnstile work with Next.js, Astro, or SvelteKit?

Yes. Framework references cover Next.js App Router and Pages Router, Astro pages and Actions, SvelteKit form actions and endpoints, Hugo partials, and vanilla HTML. Each shows the widget embed plus the matching server-side siteverify snippet.

Can I use Turnstile on a static site with no backend?

No. Siteverify is server-side by design, so the skill exits if no backend handler exists. Options include adding a Cloudflare Pages Function, a small Worker, or a form host with a server-side webhook.

Why does siteverify return invalid-input-secret?

The secret did not reach your backend. Check that TURNSTILE_SECRET is set in your environment or secret manager, and for Workers run wrangler secret list to confirm the binding targets the correct script.

How is the Turnstile secret handled during setup?

The secret is never printed to chat, written to logs, or placed in command arguments. It moves through standard-input pipes into your own env file or secret manager, and is validated with a dummy siteverify call before storage.