Back to Eliza

Google Chat Plugin

packages/docs/plugin-registry/platform/googlechat.md

2.0.14.5 KB
Original Source
<Info> The registry ID for this plugin is `google-chat` (with a hyphen). Use `eliza plugins install google-chat` to install. </Info>

The Google Chat plugin connects Eliza agents to Google Chat via a Google Cloud service account, supporting spaces, DMs, and group conversations with webhook-based event delivery.

Package: @elizaos/plugin-google-chat

Installation

bash
eliza plugins install google-chat

Setup

1. Create a Google Cloud Project

  1. Go to the Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the Google Chat API

2. Create a Service Account

  1. Navigate to IAM & Admin → Service Accounts
  2. Create a new service account
  3. Grant the Chat Bot role
  4. Create a JSON key and download it

3. Configure the Chat App

  1. Go to the Google Chat API configuration
  2. Set the App URL to your webhook endpoint:
    https://your-eliza-host/google-chat
    
  3. Note the Project Number for audience configuration

4. Configure Eliza

json
{
  "connectors": {
    "googlechat": {
      "enabled": true,
      "serviceAccountFile": "./service-account.json",
      "audienceType": "project-number",
      "audience": "123456789",
      "webhookPath": "/google-chat"
    }
  }
}

Configuration

FieldRequiredDescription
serviceAccountFileYes*Path to service account JSON key file
serviceAccountJsonYes*Inline service account JSON (alternative to file)
audienceTypeYesapp-url or project-number
audienceYesApp URL or project number (matches audienceType)
webhookPathNoWebhook endpoint path (default: /google-chat)
webhookUrlNoFull webhook URL override
typingIndicatorNonone, message, or reaction (default: none)
dmPolicyNoDM handling policy

* Provide either serviceAccountFile or serviceAccountJson.

Features

  • Service account auth — Authenticate via JSON key file or inline JSON
  • Webhook delivery — Receive events via configurable webhook endpoint
  • Typing indicators — Configurable indicator modes (none, message, reaction)
  • Per-space configuration — Override mention requirements and tools per space
  • DM support — Private conversation handling with configurable policy
  • Group chats — Respond in spaces with optional mention requirements
  • Multi-account — Supports multiple accounts via accounts map

Environment Variables

VariableRequiredDescription
GOOGLE_CHAT_ENABLEDNoEnable or disable the connector
GOOGLE_CHAT_SPACESNoComma-separated Space IDs to join
GOOGLE_CHAT_AUDIENCENoApp URL or project number for JWT verification
GOOGLE_CHAT_BOT_USERNoBot user identifier
GOOGLE_CHAT_WEBHOOK_PATHNoWebhook endpoint path
GOOGLE_CHAT_AUDIENCE_TYPENoAudience type: app-url or project-number
GOOGLE_CHAT_REQUIRE_MENTIONNoOnly respond when @mentioned
GOOGLE_CHAT_SERVICE_ACCOUNTNoInline service account JSON
GOOGLE_APPLICATION_CREDENTIALSNoPath to Google application credentials JSON
GOOGLE_CHAT_SERVICE_ACCOUNT_FILENoPath to service account JSON key file

Auto-Enable

The plugin auto-enables when the connectors.googlechat block contains botToken, token, or apiKey. Note that serviceAccountFile alone does not trigger auto-enable. Include "apiKey": "placeholder" to trigger auto-enable when using service account auth, or add the plugin to plugins.allow explicitly:

json
{
  "connectors": {
    "googlechat": {
      "apiKey": "placeholder",
      "serviceAccountFile": "./service-account.json",
      "audienceType": "project-number",
      "audience": "123456789"
    }
  }
}

Troubleshooting

Webhook Not Receiving Events

Ensure the webhook URL is publicly accessible and matches the URL configured in the Google Chat API console.

Authentication Failed

Verify the service account JSON key is valid and the service account has the Chat Bot role assigned.