Captcha
Protect your LaunchSaaS forms from bots with Cloudflare Turnstile, Google reCAPTCHA, hCaptcha, or CaptchaFox. Easy integration for auth pages.
LaunchSaaS supports multiple captcha providers for bot protection on forms and authentication pages.
Supported Providers
| Provider | NEXT_PUBLIC_CAPTCHA_PROVIDER value |
|---|---|
| Cloudflare Turnstile | cloudflare-turnstile (default) |
| Google reCAPTCHA v2 Checkbox | google-recaptcha-v2-checkbox |
| Google reCAPTCHA v2 Invisible | google-recaptcha-v2-invisible |
| Google reCAPTCHA v3 | google-recaptcha-v3 |
| hCaptcha | hcaptcha |
| CaptchaFox | captchafox |
Setup
Cloudflare Turnstile (Recommended)
- Go to Cloudflare Dashboard → Turnstile
- Add a site
- Copy the Site Key and Secret Key
- Add to your
.env:
NEXT_PUBLIC_CAPTCHA_PROVIDER=cloudflare-turnstile
NEXT_PUBLIC_CAPTCHA_PUBLIC_KEY="your-site-key"
CAPTCHA_SECRET_KEY="your-secret-key"Google reCAPTCHA
- Go to Google reCAPTCHA Console
- Register a new site and choose your reCAPTCHA type (v2 or v3)
- Copy the Site Key and Secret Key
- Add to your
.env:
# Use the matching NEXT_PUBLIC_CAPTCHA_PROVIDER value for your reCAPTCHA type:
# google-recaptcha-v2-checkbox, google-recaptcha-v2-invisible, or google-recaptcha-v3
NEXT_PUBLIC_CAPTCHA_PROVIDER=google-recaptcha-v3
NEXT_PUBLIC_CAPTCHA_PUBLIC_KEY="your-site-key"
CAPTCHA_SECRET_KEY="your-secret-key"hCaptcha
- Sign up at hcaptcha.com
- Add a site
- Copy the Site Key and Secret Key
- Add to your
.env:
NEXT_PUBLIC_CAPTCHA_PROVIDER=hcaptcha
NEXT_PUBLIC_CAPTCHA_PUBLIC_KEY="your-site-key"
CAPTCHA_SECRET_KEY="your-secret-key"CaptchaFox
- Sign up at captchafox.com
- Create a project
- Copy the Site Key and Secret Key
- Add to your
.env:
NEXT_PUBLIC_CAPTCHA_PROVIDER=captchafox
NEXT_PUBLIC_CAPTCHA_PUBLIC_KEY="your-site-key"
CAPTCHA_SECRET_KEY="your-secret-key"Disable Captcha
Captcha is disabled when CAPTCHA_SECRET_KEY is not set. To disable it, remove or leave empty CAPTCHA_SECRET_KEY (and optionally NEXT_PUBLIC_CAPTCHA_PUBLIC_KEY) from your .env:
# CAPTCHA_SECRET_KEY= # comment out or remove to disableNEXT_PUBLIC_CAPTCHA_PROVIDER controls the provider type but does not enable captcha on its own.
References
- Cloudflare Turnstile Documentation
- Google reCAPTCHA Documentation
- hCaptcha Documentation
- CaptchaFox Documentation