Test reCAPTCHA in a demo website
This document shows you how to deploy a demo website on Google Cloud, which is a sample website integrated with reCAPTCHA, to understand how reCAPTCHA works.
A demo website helps you do the following:
- Understand your users' experience with reCAPTCHA.
- Use as a reference to integrate reCAPTCHA in your own application.
- Experiment with different frontend and backend approaches by editing the sample application source code.
You can deploy a demo website in one of the following languages: Java, Node.js, or Python.
For a Google Cloud project, you can deploy only one demo website at a time.
Before you begin
- In the Google Cloud console, on the project selector page, select or create a Google Cloud project. - Roles required to select or create a project - Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
- 
      Create a project: To create a project, you need the Project Creator
      (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
 
- Enable the reCAPTCHA Enterprise API. - Roles required to enable APIs - To enable APIs, you need the Service Usage Admin IAM role ( - roles/serviceusage.serviceUsageAdmin), which contains the- serviceusage.services.enablepermission. Learn how to grant roles.
- Make sure that you have the following role or roles on the project: reCAPTCHA Enterprise Admin, reCAPTCHA Enterprise Agent - Check for the roles- 
              In the Google Cloud console, go to the IAM page. Go to IAM
- Select the project.
- 
              In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator. 
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
 - Grant the roles- 
              In the Google Cloud console, go to the IAM page. Go to IAM
- Select the project.
- Click Grant access.
- 
              In the New principals field, enter your user identifier. This is typically the email address for a Google Account. 
- In the Select a role list, select a role.
- To grant additional roles, click Add another role and add each additional role.
- Click Save.
 
- 
              
- If you have previously deployed a demo website, delete the relevant demo key. 
Deploy a demo website
- In the Google Cloud console, go to the demo website page. 
- In the Language list, select a language. - The entire deployment process might take about 1 minute. 
- If prompted, authorize Cloud Shell to make calls using your credentials. 
- To navigate to your new demo Key details page, click View site. 
- To view the demo website, in the Frontend card, click View sample web page. - The demo website opens in a separate tab. 
- To learn the patterns for integrating reCAPTCHA with your website, click through the examples. 
- If you want to make changes to the demo website, do the following: - In the Key details page, click Edit source.
- In the Cloud Shell Editor, find the required files in the Explorer and edit them as required. - The saved changes to the source code get reloaded into the demo website. 
 - Don't close the Cloud Shell Editor because it closes Cloud Shell and stops the demo website.