Google Service Account

Set up a Google Cloud service account to give PageBridge access to your Search Console data.

1. Create a Google Cloud project

If you don't already have one, create a project in the Google Cloud Console. Navigate to IAM & Admin > Service Accounts.

2. Enable the Search Console API

In the Google Cloud Console, go to APIs & Services > Library and search for "Google Search Console API". Click Enable.

Also enable the Web Search Indexing API if you want to use the index status checking feature.

3. Create a service account

Go to IAM & Admin > Service Accounts and click Create Service Account:

  1. Give it a descriptive name like pagebridge-sync
  2. No additional roles are needed at the project level
  3. Click Done

4. Create a JSON key

Click on the newly created service account, then:

  1. Go to the Keys tab
  2. Click Add Key > Create new key
  3. Select JSON format
  4. Download the file

The JSON file contains the credentials. You'll set the entire JSON content as the GOOGLE_SERVICE_ACCOUNT environment variable.

5. Grant Search Console access

The service account needs access to your Search Console properties. In Google Search Console:

  1. Go to your property settings
  2. Click Users and permissions
  3. Click Add user
  4. Enter the service account email (e.g., pagebridge-sync@my-project.iam.gserviceaccount.com)
  5. Set permission to Full (required for URL Inspection API)

6. Set the environment variable

Stringify the JSON key file and set it as an environment variable:

# Inline the JSON (single line)
GOOGLE_SERVICE_ACCOUNT='{"type":"service_account","project_id":"my-project","private_key":"-----BEGIN PRIVATE KEY-----\n...","client_email":"pagebridge-sync@my-project.iam.gserviceaccount.com",...}'
bash

7. Verify access

Test that PageBridge can access your GSC properties:

pnpm pagebridge list-sites
bash

You should see your Search Console properties listed. If not, double-check that the service account email has been added to the property with Full permissions.

Troubleshooting

  • No sites listed — The service account email hasn't been added to any GSC property. Add it with Full permissions.
  • Authentication error — The GOOGLE_SERVICE_ACCOUNT JSON may be malformed. Ensure it's a valid JSON string with escaped newlines in the private key.
  • API not enabled — Ensure the Search Console API is enabled in your Google Cloud project.

Next steps