LogoLaunchSaaS

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

ProviderNEXT_PUBLIC_CAPTCHA_PROVIDER value
Cloudflare Turnstilecloudflare-turnstile (default)
Google reCAPTCHA v2 Checkboxgoogle-recaptcha-v2-checkbox
Google reCAPTCHA v2 Invisiblegoogle-recaptcha-v2-invisible
Google reCAPTCHA v3google-recaptcha-v3
hCaptchahcaptcha
CaptchaFoxcaptchafox

Setup

  1. Go to Cloudflare Dashboard → Turnstile
  2. Add a site
  3. Copy the Site Key and Secret Key
  4. 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

  1. Go to Google reCAPTCHA Console
  2. Register a new site and choose your reCAPTCHA type (v2 or v3)
  3. Copy the Site Key and Secret Key
  4. 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

  1. Sign up at hcaptcha.com
  2. Add a site
  3. Copy the Site Key and Secret Key
  4. Add to your .env:
NEXT_PUBLIC_CAPTCHA_PROVIDER=hcaptcha
NEXT_PUBLIC_CAPTCHA_PUBLIC_KEY="your-site-key"
CAPTCHA_SECRET_KEY="your-secret-key"

CaptchaFox

  1. Sign up at captchafox.com
  2. Create a project
  3. Copy the Site Key and Secret Key
  4. 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 disable

NEXT_PUBLIC_CAPTCHA_PROVIDER controls the provider type but does not enable captcha on its own.

References

Next Steps