Captcha Plugin
Bot protection with Cloudflare Turnstile
The captcha plugin adds bot protection to authentication flows using Cloudflare Turnstile.
Configuration
The plugin is automatically enabled when TURNSTILE_SECRET_KEY is set:
TURNSTILE_SECRET_KEY=your_secret_keyNEXT_PUBLIC_CAPTCHA_SITE_KEY=your_site_keySetup
- Create a Turnstile widget at Cloudflare Dashboard
- Add environment variables:
TURNSTILE_SECRET_KEY- Server-side secret keyNEXT_PUBLIC_CAPTCHA_SITE_KEY- Client-side site key
- The plugin automatically protects auth endpoints when configured
Conditional Enablement
The plugin gracefully disables itself when no secret key is configured, allowing development without captcha while enabling it in production.
Next: OTP Plugin