Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/add-adapter-disconnect-hook.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fix-finish-step-event-name.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fix-telegram-markdown-parse-mode.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fix-thread-channel-types.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/telegram-entity-markdown.md

This file was deleted.

2 changes: 1 addition & 1 deletion apps/docs/content/docs/contributing/building.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Chat SDK ships with Vercel-maintained adapters for Slack, Teams, Google Chat, Di

#### Qualifications for vendor official tier

- Committment for continued maintenance of the adapter.
- Commitment for continued maintenance of the adapter.
- GitHub hosting in official vendor-owned org.
- Documentation of the adapter in primary vendor docs.
- Announcement of the adapter in blog post or changelog and social media.
Expand Down
14 changes: 14 additions & 0 deletions packages/adapter-discord/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @chat-adapter/discord

## 4.21.0

### Minor Changes

- d778f72: Switch adapters from optional dep to full dep on chat

### Patch Changes

- Updated dependencies [e45a67f]
- Updated dependencies [13ba1c7]
- Updated dependencies [95fd8ce]
- chat@4.21.0
- @chat-adapter/shared@4.21.0

## 4.20.2

### Patch Changes
Expand Down
6 changes: 2 additions & 4 deletions packages/adapter-discord/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@chat-adapter/discord",
"version": "4.20.2",
"version": "4.21.0",
"description": "Discord adapter for chat",
"type": "module",
"main": "./dist/index.js",
Expand All @@ -25,13 +25,11 @@
},
"dependencies": {
"@chat-adapter/shared": "workspace:*",
"chat": "workspace:*",
"discord-api-types": "^0.37.119",
"discord-interactions": "^4.4.0",
"discord.js": "^14.25.1"
},
"peerDependencies": {
"chat": "workspace:*"
},
"devDependencies": {
"@types/node": "^25.3.2",
"tsup": "^8.3.5",
Expand Down
15 changes: 15 additions & 0 deletions packages/adapter-gchat/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# @chat-adapter/gchat

## 4.21.0

### Minor Changes

- d778f72: Switch adapters from optional dep to full dep on chat

### Patch Changes

- 000792b: Introduce optional gchat signature verification
- Updated dependencies [e45a67f]
- Updated dependencies [13ba1c7]
- Updated dependencies [95fd8ce]
- chat@4.21.0
- @chat-adapter/shared@4.21.0

## 4.20.2

### Patch Changes
Expand Down
50 changes: 50 additions & 0 deletions packages/adapter-gchat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ All options are auto-detected from environment variables when not provided.
| `credentials` | No* | Service account credentials JSON. Auto-detected from `GOOGLE_CHAT_CREDENTIALS` |
| `useApplicationDefaultCredentials` | No | Use Application Default Credentials. Auto-detected from `GOOGLE_CHAT_USE_ADC` |
| `pubsubTopic` | No | Pub/Sub topic for Workspace Events. Auto-detected from `GOOGLE_CHAT_PUBSUB_TOPIC` |
| `pubsubAudience` | No | Expected JWT audience for Pub/Sub webhook verification. Auto-detected from `GOOGLE_CHAT_PUBSUB_AUDIENCE` |
| `googleChatProjectNumber` | No | GCP project number for direct webhook JWT verification. Auto-detected from `GOOGLE_CHAT_PROJECT_NUMBER` |
| `impersonateUser` | No | User email for domain-wide delegation. Auto-detected from `GOOGLE_CHAT_IMPERSONATE_USER` |
| `auth` | No | Custom auth object (advanced) |
| `logger` | No | Logger instance (defaults to `ConsoleLogger("info")`) |
Expand All @@ -175,8 +177,49 @@ GOOGLE_CHAT_CREDENTIALS={"type":"service_account",...}
# Optional: for receiving all messages
GOOGLE_CHAT_PUBSUB_TOPIC=projects/your-project/topics/chat-events
GOOGLE_CHAT_IMPERSONATE_USER=admin@yourdomain.com

# Optional: webhook verification (recommended for production)
GOOGLE_CHAT_PROJECT_NUMBER=123456789 # For direct webhook JWT verification
GOOGLE_CHAT_PUBSUB_AUDIENCE=https://your-domain.com/api/webhooks/gchat # For Pub/Sub JWT verification
```

## Webhook verification

The adapter supports JWT verification for both webhook types. When configured, the adapter validates the `Authorization: Bearer <JWT>` header on incoming requests using Google's public keys. Requests with missing or invalid tokens are rejected with HTTP 401.

Verification is opt-in — when the config options are not set, webhooks are accepted without signature checks (for backward compatibility and development).

### Direct webhooks (Google Chat API)

Google Chat sends a signed JWT with every webhook request. The JWT audience (`aud` claim) is your GCP project number.

```typescript
createGoogleChatAdapter({
googleChatProjectNumber: "123456789",
});
```

Find your project number in the [GCP Console dashboard](https://console.cloud.google.com/home/dashboard) (it's different from the project ID).

### Pub/Sub push messages

Google Cloud Pub/Sub sends a signed OIDC JWT with push deliveries. The JWT audience is whatever you configured on the push subscription.

```typescript
createGoogleChatAdapter({
pubsubAudience: "https://your-domain.com/api/webhooks/gchat",
});
```

To enable authenticated push on your Pub/Sub subscription:

1. Go to **Pub/Sub** then **Subscriptions**
2. Edit your push subscription
3. Enable **Authentication**
4. Select a service account with the **Service Account Token Creator** role
5. Set the **Audience** to your webhook URL
6. Use the same URL as `GOOGLE_CHAT_PUBSUB_AUDIENCE`

## Features

### Messaging
Expand Down Expand Up @@ -237,6 +280,13 @@ Fetching message history requires domain-wide delegation with the `impersonateUs

## Troubleshooting

### 401 Unauthorized on webhooks

- For direct webhooks: verify `GOOGLE_CHAT_PROJECT_NUMBER` matches your GCP project number (not project ID)
- For Pub/Sub: verify `GOOGLE_CHAT_PUBSUB_AUDIENCE` matches the audience configured on your push subscription
- Check that authentication is enabled on your Pub/Sub push subscription
- Ensure the service account used for push authentication has the **Service Account Token Creator** role

### No webhook received

- Verify the App URL is correct in Google Chat configuration
Expand Down
6 changes: 2 additions & 4 deletions packages/adapter-gchat/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@chat-adapter/gchat",
"version": "4.20.2",
"version": "4.21.0",
"description": "Google Chat adapter for chat",
"type": "module",
"main": "./dist/index.js",
Expand All @@ -26,9 +26,7 @@
"dependencies": {
"@chat-adapter/shared": "workspace:*",
"@googleapis/chat": "^44.6.0",
"@googleapis/workspaceevents": "^9.1.0"
},
"peerDependencies": {
"@googleapis/workspaceevents": "^9.1.0",
"chat": "workspace:*"
},
"devDependencies": {
Expand Down
Loading
Loading