Follow these steps to configure Cloudflare Turnstile for RemitX.
- Go to https://dash.cloudflare.com/sign-up
- Enter your email address and create a password
- Click Sign Up
- Verify your email address (check your inbox and click the confirmation link)
- Log in to https://dash.cloudflare.com
- In the left sidebar, click Turnstile
- If you don't see it in the sidebar, go directly to: https://dash.cloudflare.com/?to=/:account/turnstile
- Click the blue Add Site button
- Fill in the form:
| Field | What to enter |
|---|---|
| Site name | RemitX (or anything you like) |
| Domain | For local development, enter: localhost |
| Widget type | Select Managed (recommended) |
| Appearance | Select Light or Auto (your choice) |
- Check the box to agree to the Terms of Service
- Click Create
After creating the site, you'll see two keys on the screen:
- Labeled Site Key
- Format looks like:
0x4AAAAAAABC12345abcdef - This is PUBLIC - safe to ship to the browser
- Copy this value
- Labeled Secret Key
- Format looks like:
0x1AAAAAAABC12345abcdef - This is PRIVATE - must never be shared
- Copy this value (you may need to click "Copy" - it's only shown once)
Open your .env file and fill in these two lines:
NEXT_PUBLIC_TURNSTILE_SITE_KEY=0x4AAAAAAABC12345abcdef
TURNSTILE_SECRET_KEY=0x1AAAAAAABC12345abcdefReplace the placeholder values with your actual keys from Step 4.
- Stop your running dev server (Ctrl+C in the terminal)
- Start it again:
npm run dev- Go to http://localhost:3000/login
- The Turnstile widget will now appear on the login/register form
Your Cloudflare Turnstile is now configured. The widget will:
- Verify humans on login and register
- Block bots automatically
- Work on both desktop and mobile
When you deploy to production:
- Add your production domain (e.g.
remitx.app) to the Turnstile domain list - Go to Turnstile → your site → Settings → Add your domain
- Set the same
NEXT_PUBLIC_TURNSTILE_SITE_KEYandTURNSTILE_SECRET_KEYin:- Vercel → Project Settings → Environment Variables
- Redeploy
| Problem | Solution |
|---|---|
| Widget doesn't appear | Make sure both keys are set and restart the dev server |
| "Invalid domain" error | Make sure localhost is listed as a domain for the Turnstile site |
| Secret key lost | Delete and recreate the Turnstile site, or go to Settings to regenerate |
| Works locally but not in production | Add your production domain to the Turnstile site settings |