Cloudflare Turnstile with pass/block/interactive test keys, server-verified
A privacy-first CAPTCHA alternative that encapsulates its entire UI inside a cross-origin iframe, verified server-side via siteverify
Turnstile renders a self-contained widget. When it succeeds it hands your callback a token, which we POST to /api/captcha/vendor. Our server calls Cloudflare's siteverify endpoint and returns the verdict.
Three published TEST sitekeys let you drive each branch deterministically:
pass β always issues a passing token β humanblock β the widget never yields a valid token β bot (the negative branch)interactive β forces a visible challenge before it will issue a tokenPairs with the Shadow DOM lesson: Turnstile wraps its controls in its own iframe (and shadow tree), so you cannot reach inside from the top frame β assert on the token and on #captcha-result instead.
Mode: practice β the test keys are deterministic; great for wiring up your automation end to end.
Switching re-renders the widget so you can drive the pass / block / interactive branches
Active key: 0x4AAAAAADp4E7yXAQRmVpJ8
The widget loads asynchronously β wait for it to render before interacting
Waiting for the widget to issue a tokenβ¦
Automation hints
frameLocator, Cypress iframe plugin) rather than querying the top frame, just like the Shadow DOM lessonpass key, wait for the hidden <input name="cf-turnstile-response"> to become non-empty β that value IS the token passed to your callback#captcha-result[data-verdict="human"] after the auto-POST to /api/captcha/vendorresolves β don't just check that any result appearedblock key (#turnstile-key-block) to drive the negative branch and assert #captcha-result[data-verdict="bot"]#turnstile-active-key[data-key-type] tells your test which branch is armed; the interactivekey forces a click, and a real prod sitekey (env) has no deterministic bypass β you'd need a solver service