帮助开发者为 Zoom 事件流配置 WebSockets 低延迟持久连接方案。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "setup-zoom-websockets" 技能: 1. 下载 https://raw.githubusercontent.com/anthropics/knowledge-work-plugins/main/partner-built/zoom-plugin/skills/websockets/SKILL.md 2. 保存为 ~/.claude/skills/websockets/SKILL.md 3. 装好后重载技能,告诉我可以用了
请说明如何为 Zoom WebSockets 搭建实时事件连接方案,包括连接建立、认证方式、断线重连和事件处理的实现步骤。
一份分步骤的接入指南,说明如何建立并维护 Zoom WebSockets 实时连接。
请比较 Zoom WebSockets 和 Webhooks 的适用场景,重点说明在低延迟、持久连接和安全限制下为什么应优先选择 WebSockets。
一份场景对比与选型建议,帮助判断何时应使用 Zoom WebSockets。
请为 Zoom WebSockets 设计一套安全连接策略,涵盖认证、密钥管理、访问控制、异常监控和重试机制。
一份面向生产环境的安全与稳定性方案,适合实时事件系统实施。
Background reference for persistent Zoom event streams. Prefer workflow routing first, then use this file when WebSockets are plausibly better than webhooks.
| Aspect | WebSockets | Webhooks |
|---|---|---|
| Connection | Persistent, bidirectional | One-time HTTP POST |
| Latency | Lower (no HTTP overhead) | Higher (new connection per event) |
| Security | Direct connection, no exposed endpoint | Requires endpoint validation, IP whitelisting |
| Model | Pull (you connect to Zoom) | Push (Zoom connects to you) |
| State | Stateful (maintains connection) | Stateless (each event independent) |
| Setup | More complex (access token, connection) | Simpler (just endpoint URL) |
Choose WebSockets when:
Choose Webhooks when:
Need help with S2S OAuth? See the zoom-oauth skill for complete authentication flows.
Start troubleshooting fast: Use the 5-Minute Runbook before deep debugging.
meeting.created, meeting.started)const WebSocket = require('ws');
const axios = require('axios');
// Step 1: Get access token
async function getAccessToken() {
const credentials = Buffer.from(`${CLIENT_ID}:${CLIENT_SECRET}`).toString('base64');
const response = await axios.post(
'https://zoom.us/oauth/token',
new URLSearchParams({
grant_type: 'account_credentials',
account_id: ACCOUNT_ID
}),
{
headers: {
'Authorization': `Basic ${credentials}`,
'Content-Type': 'application/x-www-form-urlencoded'
}
}
);
return response.data.access_token;
}
// Step 2: Connect to WebSocket
async function connectWebSocket() {
const accessToken = await getAccessToken();
// WebSocket URL from your subscription settings
const wsUrl = `wss://ws.zoom.us/ws?subscriptionId=${SUBSCRIPTION_ID}&access_token=${accessToken}`;
const ws = new WebSocket(wsUrl);
ws.on('open', () => {
console.log('WebSocket connection established');
});
ws.on('message', (data) => {
const event = JSON.parse(data);
console.log('Event received:', event.event);
// Handle different event types
switch (event.event) {
case 'meeting.started':
console.log(`Meeting started: ${event.payload.object.topic}`);
break;
case 'meeting.ended':
console.log(`Meeting ended: ${event.payload.object.uuid}`);
break;
case 'meeting.participant_joined':
console.log(`Participant joined: ${event.payload.object.participant.user_name}`);
break;
}
});
ws.on('close', (code, reason) => {
console.log(`Connection closed: ${code} - ${reason}`);
// Implement reconnection logic
});
ws.on('error', (error) => {
console.error('WebSocket error:', error);
});
return ws;
}
connectWebSocket();
Events received via WebSocket have the same format as webhook events:
…
围绕客户问题进行多来源调研与溯源,快速整理背景并支持准确回复。
帮助开发者构建 Zoom Phone 集成与通话自动化流程。