google-chat-api
Build Google Chat bots, webhooks, and interactive forms with Cards v2, Spaces/Members/Reactions APIs, and bearer token verification.
Works with
2
total installs
2
this week
695
GitHub stars
0
upvotes
Install Skill
Run in your terminal
2
installs
2
this week
695
stars
What it does
Supports two integration modes: incoming webhooks for one-way notifications and HTTP endpoints for interactive bots with button clicks and form submissions
Cards v2 with Markdown and HTML formatting, 15+ widget types (text, buttons, inputs, date pickers), and 100-widget-per-card limit
Spaces API for creating/listing/searching spaces, Members API for man
Installation Guide
How to use google-chat-api on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your machine
- ›Node.js 16+ with npm — verify with
node --version - ›Active project directory where you want to add
google-chat-api
Run the install command
Execute the skills CLI command in your project's root directory to begin installation:
Fetches google-chat-api from jezweb/claude-skills and configures it for Cursor.
Select Cursor when prompted
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate google-chat-api. Access via /google-chat-api in your agent's command palette.
Security Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Documentation
Google Chat API
Status: Production Ready Last Updated: 2026-01-09 (Added: Spaces API, Members API, Reactions API, Rate Limits) Dependencies: Cloudflare Workers (recommended), Web Crypto API for token verification Latest Versions: Google Chat API v1 (stable), Cards v2 (Cards v1 deprecated), [email protected]
Quick Start (5 Minutes)
1. Create Webhook (Simplest Approach)
# No code needed - just configure in Google Chat
# 1. Go to Google Cloud Console
# 2. Create new project or select existing
# 3. Enable Google Chat API
# 4. Configure Chat app with webhook URL
Webhook URL: https://your-worker.workers.dev/webhook
Why this matters:
- Simplest way to send messages to Chat
- No authentication required for incoming webhooks
- Perfect for notifications from external systems
- Limited to sending messages (no interactive responses)
2. Create Interactive Bot (Cloudflare Worker)
export default {
async fetch(request: Request, env: Env): Promise<Response> {
const event = await request.json()
// Respond with a card
return Response.json({
text: "Hello from bot!",
cardsV2: [{
cardId: "unique-card-1",
card: {
header: { title: "Welcome" },
sections: [{
widgets: [{
textParagraph: { text: "Click the button below" }
}, {
buttonList: {
buttons: [{
text: "Click me",
onClick: {
action: {
function: "handleClick",
parameters: [{ key: "data", value: "test" }]
}
}
}]
}
}]
}]
}
}]
})
}
}
CRITICAL:
- Must respond within timeout (typically 30 seconds)
- Always return valid JSON with
cardsV2array - Card schema must be exact - one wrong field breaks the whole card
3. Verify Bearer Tokens (Production Security)
async function verifyToken(token: string): Promise<boolean> {
// Verify token is signed by [email protected]
// See templates/bearer-token-verify.ts for full implementation
return true
}
Why this matters:
- Prevents unauthorized access to your bot
- Required for HTTP endpoints (not webhooks)
- Uses Web Crypto API (Cloudflare Workers compatible)
The 3-Step Setup Process
Step 1: Choose Integration Type
Option A: Incoming Webhook (Notifications Only)
Best for:
- CI/CD notifications
- Alert systems
- One-way communication
- External service → Chat
Setup:
- Create Chat space
- Configure incoming webhook in Space settings
- POST JSON to webhook URL
No code required - just HTTP POST:
curl -X POST 'https://chat.googleapis.com/v1/spaces/.../messages?key=...' \
-H 'Content-Type: application/json' \
-d '{"text": "Hello from webhook!"}'
Option B: HTTP Endpoint Bot (Interactive)
Best for:
- Interactive forms
- Button-based workflows
- User input collection
- Chat → Your service → Chat
Setup:
- Create Google Cloud project
- Enable Chat API
- Configure Chat app with HTTP endpoint
- Deploy Cloudflare Worker
- Handle events and respond with cards
Requires code - see templates/interactive-bot.ts
Step 2: Design Cards (If Using Interactive Bot)
IMPORTANT: Use Cards v2 only. Cards v1 was deprecated in 2025. Cards v2 matches Material Design on web (faster rendering, better aesthetics).
Cards v2 structure:
{
"cardsV2": [{
"cardId": "unique-id",
"card": {
"header": {
"title": "Card Title",
"subtitle": "Optional subtitle",
"imageUrl": "https://..."
},
"sections": [{
"header": "Section 1",
"widgets": [
{ "textParagraph": { "text": "Some text" } },
{ "buttonList": { "buttons": [...] } }
]
}]
}
}]
}
Widget Types:
textParagraph- Text contentbuttonList- Buttons (text or icon)textInput- Text input fieldselectionInput- Dropdowns, checkboxes, switchesdateTimePicker- Date/time selectiondivider- Horizontal lineimage- ImagesdecoratedText- Text with icon/button
Text Formatting (NEW: Sept 2025 - GA):
Cards v2 supports both HTML and Markdown formatting:
// HTML formatting (traditional)
{
textParagraph: {
text: "This is <b>bold</b> and <i>italic</i> text with <font color='#ea9999'>color</font>"
}
}
// Markdown formatting (NEW - better for AI agents)
{
textParagraph: {
text: "This is **bold** and *italic* text\n\n- Bullet list\n- Second item\n\n```\ncode block\n```"
}
}
Supported Markdown (text messages and cards):
**bold**or*italic*`code`for inline code- list itemor1. orderedfor lists```code block```for multi-line code~strikethrough~
Supported HTML (cards only):
<b>bold</b>,<i>italic</i>,<u>underline</u><font color="#FF0000">colored</font><a href="url">link</a>
Why Markdown matters: LLMs naturally output Markdown. Before Sept 2025, you had to convert Markdown→HTML. Now you can pass Markdown directly to Chat.
CRITICAL:
- Max 100 widgets per card - silently truncated if exceeded
- Widget order matters - displayed top to bottom
- cardId must be unique - use timestamp or UUID
Step 3: Handle User Interactions
When user clicks button or submits form:
export default {
async fetch(request: Request): Promise<Response> {
const event = await request.json()
// Check event type
if (event.type === 'MESSAGE') {
// User sent message
return handleMessage(event)
}
if (event.type === 'CARD_CLICKED') {
// User clicked button
const action = event.action.actionMethodName
const params = event.action.parameters
if (action === 'submitForm') {
return handleFormSubmission(event)
}
}
return Response.json({ text: "Unknown event" })
}
}
Event Types:
ADDED_TO_SPACE- Bot added to spaceREMOVED_FROM_SPACE- Bot removedMESSAGE- User sent messageCARD_CLICKED- User clicked button/submitted form
Critical Rules
Always Do
✅ Return valid JSON with cardsV2 array structure
✅ Set unique cardId for each card
✅ Verify bearer tokens for HTTP endpoints (production)
✅ Handle all event types (MESSAGE, CARD_CLICKED, etc.)
✅ Keep widget count under 100 per card
✅ Validate form inputs server-side
Never Do
❌ Store secrets in code (use Cloudflare Workers secrets) ❌ Exceed 100 widgets per card (silently fails) ❌ Return malformed JSON (breaks entire message) ❌ Skip bearer token verification (security risk) ❌ Trust client-side validation only (validate server-side) ❌ Use synchronous blocking operations (timeout risk)
Known Issues Prevention
This skill prevents 6 documented issues:
Issue #1: Bearer Token Verification Fails (401)
Error: "Unauthorized" or "Invalid credentials" Source: Google Chat API Documentation Why It Happens: Token not verified or wrong verification method Prevention: Template includes Web Crypto API verification (Cloudflare Workers compatible)
Issue #2: Invalid Card JSON Schema (400)
Error: "Invalid JSON payload" or "Unknown field"
Source: Cards v2 API Reference
Why It Happens: Typo in field name, wrong nesting, or extra fields
Prevention: Use google-chat-cards library or templates with exact schema
Issue #3: Widget Limit Exceeded (Silent Failure)
Error: No error - widgets beyond 100 simply don't render Source: Google Chat API Limits Why It Happens: Adding too many widgets to single card Prevention: Skill documents 100 widget limit + pagination patterns
Issue #4:
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases
Task Automation & Efficiency
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Knowledge Enhancement
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Quality Improvement
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
Implementation Guide
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Steps
- 1Install skill using provided installation command
- 2Test with simple use case relevant to your work
- 3Evaluate output quality and relevance
- 4Iterate on prompts to improve results
- 5Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Related Skills
wordpress-elementor
84jezweb/claude-skills
react-native
20jezweb/claude-skills
zustand-state-management
7jezweb/claude-skills
google-search-console
41kostja94/marketing-skills
rest-api-design
7aj-geddes/useful-ai-prompts
typescript-best-practices
96jwynia/agent-skills
Reviews
- PPratham Ware★★★★★Dec 28, 2024
google-chat-api is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- JJin White★★★★★Dec 24, 2024
Keeps context tight: google-chat-api is the kind of skill you can hand to a new teammate without a long onboarding doc.
- JJin Johnson★★★★★Dec 24, 2024
google-chat-api fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- JJin Brown★★★★★Dec 20, 2024
Useful defaults in google-chat-api — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- NNoor Okafor★★★★★Dec 16, 2024
google-chat-api reduced setup friction for our internal harness; good balance of opinion and flexibility.
- HHassan Torres★★★★★Dec 12, 2024
google-chat-api has been reliable in day-to-day use. Documentation quality is above average for community skills.
- AArjun Rahman★★★★★Dec 8, 2024
google-chat-api has been reliable in day-to-day use. Documentation quality is above average for community skills.
- JJin Anderson★★★★★Nov 27, 2024
google-chat-api reduced setup friction for our internal harness; good balance of opinion and flexibility.
- SSakshi Patil★★★★★Nov 19, 2024
Keeps context tight: google-chat-api is the kind of skill you can hand to a new teammate without a long onboarding doc.
- JJin Agarwal★★★★★Nov 19, 2024
We added google-chat-api from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
showing 1-10 of 71
Discussion
Comments — not star reviews- No comments yet — start the thread.