How to Connect Openclaw to Google Chat

Image
Table of contents: [Show]

Openclaw Google Chat Integration

Quick Start

Connect your Openclaw agent to Google Chat in minutes. This guide walks you through creating a service account, configuring the Chat API, and setting up your gateway to receive and respond to messages.

For more messaging integrations, check out our guide on Connect Slack Openclaw or learn about Discord Setup Openclaw for alternative platforms.

Step 1: Create a Service Account

Google Chat requires a service account for bot authentication. Here's how to set it up:

  1. Go to your Google Cloud Console and select your project
  2. Enable the Google Chat API from the API Library
  3. Navigate to IAM & Admin > Service Accounts
  4. Click Create Service Account and name it openclaw-chat
  5. Skip permissions and access grants, then click Done

Step 2: Generate JSON Key

Your service account needs a key file for authentication:

  1. Click on the newly created service account
  2. Go to the Keys tab
  3. Click Add Key > Create new key
  4. Select JSON format and click Create
  5. Download and save the JSON file securely

Move the key to your Openclaw gateway host:

mv ~/Downloads/project-*.json ~/.openclaw/googlechat-service-account.json

Step 3: Configure Openclaw

Edit your ~/.openclaw/openclaw.json file to add the Google Chat channel:

{ "channels": { "googlechat": { "enabled": true, "serviceAccountFile": "/home/user/.openclaw/googlechat-service-account.json", "audienceType": "app-url", "audience": "https://your-domain.com/googlechat", "webhookPath": "/googlechat", "dm": { "policy": "pairing", "allowFrom": ["users/1234567890"] }, "groupPolicy": "allowlist" } } }

Replace your-domain.com with your actual public domain and update the allowFrom list with authorized user IDs.

Step 4: Deploy and Test

Start your Openclaw gateway to apply the changes:

openclaw gateway start

Or restart if already running:

openclaw gateway restart

Test the integration by sending a direct message to your bot in Google Chat.

Example Configuration

Here's a minimal working example for a public-facing bot:

{ "channels": { "googlechat": { "enabled": true, "serviceAccountFile": "/home/azureuser/.openclaw/googlechat-service-account.json", "audienceType": "app-url", "audience": "https://bot.example.com/googlechat", "webhookPath": "/googlechat", "dm": { "policy": "open" }, "groupPolicy": "allowlist" } } }

Troubleshooting & Best Practices

  • Webhook not receiving messages? Ensure your domain is publicly accessible and the webhookPath matches your Google Chat bot configuration
  • Authentication errors? Verify the service account JSON file path is correct and the file has read permissions
  • Messages not responding? Check that the Google Chat API is enabled and the bot is added to the space/DM
  • Keep your service account key secure and never commit it to version control
  • Use "policy": "pairing" for private bots, "open" for public ones

Looking for more deployment options? See our Deploy GCP Openclaw guide for hosting your gateway on Google Cloud.