turnstile-spin
Set up, repair, or migrate to Cloudflare Turnstile bot verification in an existing frontend and backend, including server-side Siteverify.
Install
npx skills add https://github.com/cloudflare/skills --skill turnstile-spinSvelteKit
For SvelteKit projects. The widget renders in the page; siteverify is called from a SvelteKit form action (or a +server.ts endpoint) server-side.
Form action (canonical siteverify):
signup is the stable action for this surface. Preserve an existing custom migration action and compare the returned action to the same value. Siteverify is mandatory for every widget mode, including pre-clearance. Set TURNSTILE_HOSTNAMES to the deployment-specific frontend hostnames; a production value must not include localhost or 127.0.0.1.
In .env:
The $env/static/private import enforces that the secret never reaches the client bundle.
Variant: client-side fetch to an endpoint
If you need a JSON API rather than progressive-enhancement form post, use +server.ts:
The explicit renderer above retains signupWidgetId. Reset it in finally when calling this endpoint so every completion path gets a fresh token: