# Google reCAPTCHA

> Use Google’s bot checks to help your site spot suspicious activity on forms such as signup or password reset.

Web page: https://buildladder.com/tools/recaptcha

A sudden flood of signup requests might come from an automated program. reCAPTCHA looks for signs of automation. Depending on the setup, it can show a challenge or give your site a score for the request.

Choose one form and decide what should happen when a request looks suspicious. Try the form as an ordinary visitor, then use the integration’s testing options to check the other outcome. Make sure a real person can understand how to try again.

- Made by: Google
- Official site: https://cloud.google.com/security/products/recaptcha
- Cost: Free for 10,000 checks a month, as of November 2026. Then $8 a month up to 100,000 checks, and $1 per 1,000 after that.
- What you need first: A Google account. Google makes a Google Cloud project for you when you create your first key.
- Who it helps: If you already use Google Cloud or Firebase, or you want a score for every visit instead of a plain yes or no.
- When to skip it: If you don’t want visitors to see picture puzzles. Its checkbox can show them.
- Updated: 2026-11-10

## Stop bots with Google reCAPTCHA

Add a reCAPTCHA check to a sign-up, sign-in or contact form. Each time someone sends the form, reCAPTCHA gives it a one-time code, called a pass. Your server asks Google about each pass before it accepts the form.

What you’ll end up with: Your form runs a reCAPTCHA check, and your server refuses any submission Google doesn’t confirm.

### You’ll need

- A website or app with a form you want to protect, like sign-up or contact.
- Your AI tool, set up and working in your product’s folder.
- Server code that handles the form.
- Google Cloud account (https://console.cloud.google.com): It holds your reCAPTCHA keys and your free monthly checks

### Your part

- Create the reCAPTCHA keys and the server API key in Google Cloud.
- Paste the keys into .env and your host’s settings.
- Test the form on your live site, and check that a made-up pass is refused.

### Step 1 of 4: Create a reCAPTCHA key

This step is mine to do. Walk me through it, one action at a time:
- Go to google.com/recaptcha/admin/create and sign in with your Google account. This opens the reCAPTCHA page in Google Cloud, which Google now labels Fraud Defense.
- In Label, type what it protects, like “My site sign-up”.
- Pick a key type. Challenge (v2) shows the familiar “I’m not a robot” checkbox. Score based (v3) shows nothing and gives each visit a score.
- Add your site’s domain, like mysite.com. Its subdomains are covered too. Leave localhost off this key.
- Keep the key limited to your domains, so other sites can’t use it.
- If you’re new to Google Cloud, read the terms and tick the checkbox. Then click Submit.
- On the reCAPTCHA page in Google Cloud, select the Keys tab. Copy your new key, a long string of letters and numbers, into your notes. This is your site key, and it’s safe to share.
- Create a second key the same way for testing on your computer, with only localhost as its domain.

It worked when: You have two reCAPTCHA site keys, one for your live domain and one for localhost.

Before we move on, check with me:
- Can you tell which key is for your live site?

Keep for later: You need the localhost key in your .env file, and the live key in “Add the keys to your host and test”.

If something goes wrong:
- You don’t know which key type to pick. Pick Challenge (v2) if you want people to see a checkbox. Pick Score based (v3) if you want nothing on screen and are happy to choose a score to accept.
- It asks you to pick or create a Google Cloud project. Create one named after your site. Your keys and the free monthly checks belong to it.

### Step 2 of 4: Make a secret API key for your server

This step is mine to do. Walk me through it, one action at a time:
- Go to console.cloud.google.com. Check that your new project’s name shows in the project picker at the top of the page.
- Open the Credentials page for this Cloud project. Use the console search if you can’t find it in the menu.
- Start creating an API key for your server.
- In the key’s API restrictions, allow only the reCAPTCHA Enterprise API. Don’t leave it usable with every API.
- Finish creating the key and copy it somewhere private, like a note only you can see.
- Open the Cloud project’s overview and note its project ID. It may differ from the name you gave it.

It worked when: You have a restricted API key saved somewhere private, and your project ID written down.

Before we move on, check with me:
- Does the Credentials page show a restriction on your new API key?

Keep for later: You need the API key and project ID again in “Add the keys to your host and test”.

If something goes wrong:
- You can’t find the reCAPTCHA Enterprise API in the list. Type reCAPTCHA in the list’s search box. If it still isn’t there, ask your AI tool to check Google’s current docs for the API’s name.
- You made the key without a restriction. Click the key’s name on the Credentials page. Under API restrictions, click Restrict key, select the reCAPTCHA Enterprise API, and click Save.

### Step 3 of 4: Add reCAPTCHA and check it on the server

I want to protect a form in this product with Google reCAPTCHA, which now runs on Google Cloud. Read PLAN.md if there is one. Check Google’s current reCAPTCHA docs on Google Cloud first. Don’t rely on memory, because the setup changed.

Ask me which form to protect, like sign-up, sign-in or contact, and whether my key is Challenge (v2) or Score based (v3). Then:
1. If my sign-in uses Clerk, stop and tell me how to check Clerk’s own bot protection is turned on instead.
2. If I want to protect Firebase itself, like Firestore, explain Firebase App Check with reCAPTCHA and ask me before you set it up.
3. Otherwise, add reCAPTCHA to that form, using the site key, and send its pass to my server with the form.
4. On the server, create an assessment with the reCAPTCHA Enterprise API before doing anything else. Use my project ID and my API key. Refuse the form unless the pass is valid and its action matches.
5. If my key is score based, explain the score from 0.0 to 1.0 in plain words, and ask me what score to accept.
6. Get a fresh pass for each send, because each one can be checked only once.
7. Read the site key, project ID and API key from environment variables. Put the names in .env with empty values and make sure Git ignores .env. Then tell me which names are public and which are secret, and wait while I paste my localhost values into .env myself.

Never put the API key in code that runs in a browser or on a phone. If my product has no server code, stop and explain my options before you change anything. Keep everything that already works.

It worked when: reCAPTCHA runs on your form on your computer, and the form still sends when the check passes.

Before we move on, check with me:
- Did your AI tool show you the server code that asks Google to check each pass?

If something goes wrong:
- It says localhost is not in the list of supported domains. Use the key you made for localhost on your computer. Keep your live key for your live domain.
- Your AI tool only added the checkbox, with no server check. Say: “Check each pass with Google Cloud on the server, and refuse the form when it isn’t valid.” Without it, a bot can skip the checkbox.
- Your AI tool asks for a reCAPTCHA secret key. Keys made in Google Cloud check passes with an API key and your project ID. Ask it to follow Google’s current docs on checking passes on your server.

### Step 4 of 4: Add the keys to your host and test

This step is mine to do. Walk me through it, one action at a time:
- Open your host’s environment variable settings. “Where do my API keys go?” in Answers names the page for Vercel, Netlify and Cloudflare.
- Add the live site key, the project ID and the API key, using the names your AI tool gave you. Mark the API key as secret if your host offers that.
- Put your site online again from your host, so it uses the new keys.
- Open your live site in a private browser window and send the form. It should go through.
- Ask your AI tool: “Send one request to my live form with a made-up reCAPTCHA pass, and show me the reply.” It should be refused.

It worked when: The form on your live site goes through for a real visitor, and a made-up pass is refused.

If something goes wrong:
- The widget says “Invalid site key”. The key isn’t valid for this site. Check you used the live key, not the localhost one, or create a new key.
- The server check fails with a permission or API key error. Check that the API key’s restriction includes the reCAPTCHA Enterprise API, and that the project ID matches the project that holds your site key.
- You’re getting close to 10,000 checks a month. After the free 10,000, Google Cloud needs a billing account. Add one in the Google Cloud console before you run out.

Compare Google reCAPTCHA with the other options: https://buildladder.com/concepts/security.md
