reCAPTCHA setup
Your project supports Google reCAPTCHA v3 (invisible) to protect authentication endpoints from bots. When enabled, it guards: sign up, sign in, password reset, email verification.
What happens without reCAPTCHA configured?
If RECAPTCHA_SECRET_KEY or RECAPTCHA_SITE_KEY are not set, reCAPTCHA is disabled — all auth forms work normally without bot verification. This is fine for development and internal tools.
Environment variables
Add these to packages/backend/.env:
RECAPTCHA_SITE_KEY=6Lxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
RECAPTCHA_SECRET_KEY=6Lxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx- Site key — public key used by the frontend to render reCAPTCHA.
- Secret key — server-side key used to verify tokens with Google.
Getting your keys
- Go to the Google reCAPTCHA admin console.
- Click Create (the
+button). - Choose reCAPTCHA v3 (score-based).
- Add your domains (e.g.,
localhost,yourdomain.com). - Submit and copy the site key and secret key.
Tip: For local development, add
localhostto the domain list. reCAPTCHA v3 works onlocalhostwithout any extra setup.
How it works
- The frontend loads the reCAPTCHA script using the site key (only when configured).
- On form submission, reCAPTCHA generates an invisible token in the background — no user interaction needed.
- The token is sent to the backend via the
x-captcha-responseheader. - The backend verifies the token with Google using the secret key.
- If verification fails, the request is rejected.