Skip to main content

Google Chat gateway

Connect Carina to Google Chat spaces via a service account and HTTP webhook.

Prerequisites

  • Google Cloud project with Chat API enabled
  • Service account JSON with Chat bot scope
  • Public HTTPS URL for inbound webhooks (or Cloudflare tunnel)

Setup

  1. Create a Google Chat app in the Cloud console and note the project id.

  2. Add credentials to .env:

    GOOGLE_CHAT_SERVICE_ACCOUNT=/path/to/service-account.json
    GOOGLE_CHAT_WEBHOOK_PATH=/google-chat/webhook
  3. Register the webhook URL with Google Chat.

  4. Restart the gateway: carina gateway start.

Verify

Send a message in a space where the bot is added. Carina should reply in-thread.

Environment variables

VariableRequiredDescription
GOOGLE_CHAT_SERVICE_ACCOUNTYesPath to service account JSON
GOOGLE_CHAT_WEBHOOK_PATHNoWebhook mount path (default configured in gateway)

Troubleshooting

SymptomFix
401 from GoogleRotate service account key; check clock skew
Bot silentConfirm bot is added to the space and webhook URL is reachable
Duplicate repliesEnsure only one gateway instance handles the webhook

Security

  • Restrict service account to Chat API only
  • Terminate TLS at the edge; do not expose the gateway admin port publicly

See also: Gateway hardening.