This document shows you how to prepare your environment to set up reCAPTCHA.
Before you begin
To get started with reCAPTCHA, do the following:
Sign up to create a Google Account in the Google Cloud console.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Enable the reCAPTCHA Enterprise API
Console
In the Google Cloud console, go to the reCAPTCHA Enterprise API page.
Verify that the name of your project appears in the project selector at the top of the page.
If you don't see the name of your project, click the project selector, and then select your project.
- Click Enable.
gcloud
-
In the Google Cloud console, activate Cloud Shell.
At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.
- To set your Google Cloud project in the gcloud session, run the
gcloud config set project
command. Replace PROJECT_ID with your Google Cloud project ID.gcloud config set project PROJECT_ID
- To enable the reCAPTCHA Enterprise API, run the
gcloud services enable
command:gcloud services enable recaptchaenterprise.googleapis.com
- To verify that the reCAPTCHA Enterprise API is enabled, run the
gcloud services list
command:gcloud services list --enabled
Verify that the reCAPTCHA Enterprise API is listed in the list of enabled APIs.
Configure roles and permissions
To get the permissions that you need to set up reCAPTCHA, ask your administrator to grant you the following IAM roles on the project:
-
reCAPTCHA Enterprise Admin (
roles/recaptchaenterprise.admin
) -
reCAPTCHA Enterprise Agent (
roles/recaptchaenterprise.agent
)
For more information about granting roles, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
For more information about the access control for reCAPTCHA, see Access control with IAM.