cloudflare-turnstile

Integrate Cloudflare Turnstile bot protection with server-side siteverify validation.

52|6|Updated Nov 24, 2025
One-click install
npx skills add https://github.com/ovachiever/droid-tings --skill cloudflare-turnstile-ovachiever
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-turnstile
Source: https://github.com/ovachiever/droid-tings/tree/main/skills/cloudflare-turnstile
Command: npx skills add https://github.com/ovachiever/droid-tings --skill cloudflare-turnstile-ovachiever

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

Provides patterns for integrating Cloudflare Turnstile for bot protection, including client-side widget rendering, server-side validation, E2E testing, and CSP guidance.

Core Features & Use Cases

  • Client/Server Security: widget integration with mandatory server-side siteverify validation
  • Framework Integration: React, Next.js, Hono examples and patterns
  • Testing & Debugging: E2E tests, dummy keys, Playwright/Cypress templates
  • Error Handling: comprehensive Turnstile error code references
  • CSP Guidance: CSP snippets and scripts for compatibility

Quick Start

Use a demo sitekey in development, render the widget on the frontend, and validate the token on the server using the Turnstile secret.

Frequently Asked Questions about cloudflare-turnstile

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

FAQPage Schema
How do I protect forms from bot traffic using Cloudflare Turnstile?

Cloudflare Turnstile protects forms and login flows by embedding a client-side widget and validating tokens server-side. Render the widget on your frontend, collect the token, and verify it on your server using the Siteverify API with your secret key to confirm the request is legitimate.

Can I use Turnstile with React, Next.js, or Hono applications?

Yes, Turnstile integrates with React, Next.js, and Hono. The Skill covers widget embedding patterns for each framework, including implicit and explicit rendering modes, plus server-side validation examples for all three platforms.

What are the differences between implicit, explicit, and React widget modes for Turnstile?

Implicit mode auto-renders the widget when the script loads; explicit mode gives you control over render timing via JavaScript; React mode uses framework-specific components. Each mode suits different application architectures and rendering strategies.

How do I handle Turnstile errors and token lifecycle management?

Turnstile error handling involves catching framework-specific callbacks and referencing Turnstile error codes. Token lifecycle management includes validating tokens server-side before expiration and implementing retry logic for failed validations or network issues.

Does Turnstile work with Content Security Policy (CSP) constraints?

Turnstile requires specific CSP directives to function. The Skill provides CSP snippets and guidance for script sources, frame sources, and style sources needed to run Turnstile without relaxing security posture.

Can I migrate from reCAPTCHA to Turnstile?

Yes, migration from reCAPTCHA to Turnstile is covered in the Skill. The process involves replacing widget script references, updating sitekey and secret values, and adapting server-side validation logic to use Turnstile's Siteverify endpoint.