Google Chat

PocketPaw integrates with Google Chat via the Chat API v1, supporting both webhook and Pub/Sub modes.

Setup

Create a Google Cloud project

  1. Go to console.cloud.google.com
  2. Create a new project or select an existing one
  3. Enable the Google Chat API

Create a service account

  1. Go to IAM & Admin → Service Accounts
  2. Create a new service account
  3. Download the JSON key file

Configure the Chat app

  1. Go to the Google Chat API configuration
  2. Configure the app with either webhook or Pub/Sub connection

Configure PocketPaw

Terminal window
export POCKETCLAW_GCHAT_PROJECT_ID="your-project-id"
export POCKETCLAW_GCHAT_SERVICE_ACCOUNT_KEY="/path/to/service-account-key.json"

Start

Terminal window
pocketpaw --gchat

Configuration

SettingEnv VariableDescription
Project IDPOCKETCLAW_GCHAT_PROJECT_IDGoogle Cloud project ID
Service account keyPOCKETCLAW_GCHAT_SERVICE_ACCOUNT_KEYPath to JSON key file
ModePOCKETCLAW_GCHAT_MODEwebhook or pubsub
SubscriptionPOCKETCLAW_GCHAT_SUBSCRIPTIONPub/Sub subscription name
Allowed spacesPOCKETCLAW_GCHAT_ALLOWED_SPACE_IDSComma-separated space IDs

Connection Modes

Webhook Mode

In webhook mode, Google Chat sends HTTP requests to your server. The dashboard exposes a webhook endpoint that handles these requests.

Pub/Sub Mode

In Pub/Sub mode, PocketPaw subscribes to a Google Cloud Pub/Sub topic. This doesn’t require a public URL — the connection is outbound.

Features

No Streaming

Google Chat messages are accumulated and sent as a complete response.

Session Keys

Each space gets a unique session: gchat:{space_name}

Installation

Terminal window
curl -fsSL https://pocketpaw.xyz/install.sh | sh
# Or add the Google Chat extra manually
pip install pocketpaw[gchat]

This installs google-api-python-client as an optional dependency.