Before you begin
- Create a Google Cloud project. Learn how to create a Google Cloud project.
Make sure that billing is enabled for your Cloud project. Learn how to confirm that billing is enabled for your project.
Enabling the API
- Enable the reCAPTCHA Enterprise API.
- Set up authentication:
In the Cloud Console, go to the Create service account key page.Go to the Create Service Account Key page
- From the Service account list, select New service account.
- In the Service account name field, enter a name.
From the Role list, select reCAPTCHA Enterprise > reCAPTCHA Enterprise Agent.Note: The Role field authorizes your service account to access resources. You can view and change this field later by using the Cloud Console. The suggested role, reCAPTCHA Enterprise Agent, will allow the service account to create and edit assessments.
Learn more about Access Control with reCAPTCHA Enterprise
- Click Create. A JSON file that contains your key downloads to your computer.
- Modify IAM permissions for anyone on your team who will need access to reCAPTCHA Enterprise. Team members viewing keys need to have reCAPTCHA Enterprise Viewer. Team members creating keys need to have reCAPTCHA Enterprise Admin.
Provide authentication credentials to your application code by setting the environment variable
GOOGLE_APPLICATION_CREDENTIALS. Replace [PATH] with the file path of the JSON file that contains your service account key. This variable only applies to your current shell session, so if you open a new session, set the variable again.
Linux or macOS
With command prompt:
- Install and initialize the Cloud SDK.