Integrates with Meta WhatsApp Business Cloud API to send text/template/interactive messages, validate webhooks via HMAC-SHA256, and manage 24-hour session windows. Provides runnable Node.js and Python code.
Ships in 10-platform. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
https://graph.facebook.com/v21.0/{phone-number-id}/messages;认证:Bearer Token(生产用永久 System User Token)。不该用:
环境变量:
WHATSAPP_TOKEN=访问令牌
PHONE_NUMBER_ID=电话号码ID
WABA_ID=WhatsApp商业账号ID
APP_SECRET=应用密钥
VERIFY_TOKEN=自定义webhook校验令牌
决策路径:需要从零搭建则先看 setup-guide;否则按「语言(Node/Python)→ 目标(发消息 / 收消息 / 自动化 / Flows·Commerce / 模板管理 / 合规)」分流。
发送文本(Node.js/TS):
import axios from 'axios';
const GRAPH_API = 'https://graph.facebook.com/v21.0';
async function sendText(to: string, message: string) {
const r = await axios.post(
`${GRAPH_API}/${process.env.PHONE_NUMBER_ID}/messages`,
{ messaging_product: 'whatsapp', to, type: 'text', text: { body: message } },
{ headers: { Authorization: `Bearer ${process.env.WHATSAPP_TOKEN}` } }
);
return r.data; // { messaging_product, contacts, messages: [{ id }] }
}
发送文本(Python,httpx):
import httpx, os
GRAPH_API = "https://graph.facebook.com/v21.0"
async def send_text(to: str, message: str) -> dict:
async with httpx.AsyncClient() as client:
r = await client.post(
f"{GRAPH_API}/{os.environ['PHONE_NUMBER_ID']}/messages",
json={"messaging_product": "whatsapp", "to": to,
"type": "text", "text": {"body": message}},
headers={"Authorization": f"Bearer {os.environ['WHATSAPP_TOKEN']}"})
return r.json()
模板消息(窗口外唯一可主动发起的形式,须先审批):
{
"messaging_product": "whatsapp",
"to": "5511999999999",
"type": "template",
"template": {
"name": "hello_world",
"language": { "code": "pt_BR" },
"components": [
{ "type": "body", "parameters": [ { "type": "text", "text": "João" } ] }
]
}
}
Webhook GET 验证(Express):
app.get('/webhook', (req, res) => {
const mode = req.query['hub.mode'];
const token = req.query['hub.verify_token'];
const challenge = req.query['hub.challenge'];
if (mode === 'subscribe' && token === process.env.VERIFY_TOKEN) res.status(200).send(challenge);
else res.sendStatus(403);
});
Webhook POST 签名校验(HMAC-SHA256,恒定时间比较):
import crypto from 'crypto';
function validateSignature(rawBody: Buffer, signature: string): boolean {
const expected = crypto.createHmac('sha256', process.env.APP_SECRET!)
.update(rawBody).digest('hex');
return crypto.timingSafeEqual(
Buffer.from(`sha256=${expected}`), Buffer.from(signature));
}
交互按钮(Node.js,最多 3 个按钮):
interactive: { type: 'button', body: { text: body },
action: { buttons: buttons.map(b => ({ type: 'reply', reply: { id: b.id, title: b.title } })) } }
crypto.timingSafeEqual(Node)或 hmac.compare_digest(Python)防时序攻击,绝不用普通字符串相等比较。每条 webhook 都带 X-Hub-Signature-256 头,处理前先校验。本条采编自 sickn33/antigravity-awesome-skills(MIT)。
What SKILL.md sets; muted values are Claude Code's defaults
/10-platform:whatsapp-cloud-apifrom 10-platform
npx claudepluginhub findscripter/everything-skills --plugin 10-platform66 skills in this plugin
/agentmail-email-infra当 AI 智能体需要真实邮箱完成注册/验证码/事务通信时使用;通过 AgentMail REST API 开通账号、收发邮件、注册 Webhook、查询 karma 余额并产出可执行调用;不适用于自建/企业 SMTP/IMAP 或个人邮箱代收。触发词:AgentMail、智能体邮箱、theagentmail.net/agentphone-voice-sms-agents当需要给 AI 代理配备电话号码、发起/接听语音通话、收发短信、查看通话转写或配置 Webhook 时使用;调用 AgentPhone REST API(base=https://api.agentphone.to/v1)完成代理/号码/通话/短信/Webhook/用量的全生命周期管理,产出可直接执行的 curl 与 Webhook 处理代码;不适用于自建 Twilio/SIP/STUN 等底层电信栈或非 AgentPhone 平台。触发词:电话代理、语音通话、短信、号码、Webhook、转写。/ai-native-cli-design当设计/改造供 AI 智能体调用的命令行工具时使用;按 core/recommended/ecosystem 三层产出 JSON 优先、可校验的 CLI 契约(默认 JSON、结构化错误、退出码、护栏、agent/ 目录与自描述);不适用于纯人类交互 CLI、GUI 或库 API 设计;触发词:agent CLI、AI 友好命令行、CLI JSON 输出、退出码规范、agent/ 目录Other plugins' skills for the same job