threads-webhooks
БесплатноЗапускает вложенные скриптыНе проверенReceive and verify Threads (Meta) webhooks. Use when setting up Threads webhook handlers, completing the GET hub.challenge handshake, debugging…
от hookdeck★ 104 звезды на GitHubОб этом скилле
Threads Webhooks
Threads webhooks use the Meta webhook mechanism: a one-time GET handshake when you
save the Callback URL, then POST deliveries signed with X-Hub-Signature-256. They do
not follow the Standard Webhooks spec. The shared Meta pattern is documented in
facebook-webhooks
and whatsapp-webhooks.
When to Use This Skill
- How do I receive Threads webhooks?
- How do I verify Threads webhook signatures with X-Hub-Signature-256?
- How do I complete the Threads hub.challenge verification handshake?
- Why is my Threads webhook signature verification failing?
- How do I handle Threads
replies,mentions,publish, ordeletenotifications?
Two Requests, Two Jobs
GET: handshake. Meta sendshub.mode=subscribe,hub.verify_tokenandhub.challenge. If the token matches the one you set in the App Dashboard, reply200with the rawhub.challengeas plain text.POST: event delivery. A JSON body signed withX-Hub-Signature-256.
Verification (core)
Meta sends X-Hub-Signature-256: sha256=<hex>, the HMAC-SHA256 hex digest of the raw
request body keyed with your Threads App Secret. Require and strip the sha256= prefix, check
the digest is exactly 64 hex characters (Buffer.from(x, 'hex') silently truncates invalid
hex), and compare in constant time.
Which secret? Threads apps have two. Meta's getting-started guide only says "App Secret", but a live Threads notification (tested 2026-11-18) is signed with the Threads App Secret (Use cases > Customize > Settings in the Threads API use case), not the Meta App Secret under App settings > Basic.
Node:
const crypto = require('crypto');
function verify(rawBody, signatureHeader, appSecret) {
const match = /^sha256=([0-9a-f]{64})$/i.exec(signatureHeader || '');
if (!match || !appSecret) return false;
const expected = crypto.createHmac('sha256', appSecret).update(rawBody).digest('hex');
return crypto.timingSafeEqual(Buffer.from(match[1].toLowerCase()), Buffer.from(expected));
}
Python:
import hmac, hashlib, re
def verify(raw_body: bytes, signature_header: str, app_secret: str) -> bool:
match = re.fullmatch(r"sha256=([0-9a-fA-F]{64})", signature_header or "")
if not match or not app_secret:
return False
expected = hmac.new(app_secret.encode(), raw_body, hashlib.sha256).hexdigest()
# bytes on both sides: a non-ASCII header gives 401, not a TypeError/500
return hmac.compare_digest(match.group(1).lower().encode(), expected.encode())
In Express, read the body with express.raw({ type: '*/*' }) so every content type reaches
the verifier as unparsed bytes.
For complete handlers with the GET handshake, event dispatch, and tests, see:
Common Event Types
Threads notifications are a flat object. values holds the change: Meta's docs show one
{ field, value } object, but a live publish notification (tested 2026-11-18) sent an array of them, so
handle both.
The event is each change's field; topic groups fields into moderate or interaction.
Field (values[].field) |
Topic | Triggered When |
|---|---|---|
replies |
moderate |
A reply is posted on a Threads post owned by the installing user |
delete |
moderate |
The authenticated user deletes a post |
mentions |
interaction |
A public post mentions the installing user |
publish |
interaction |
The authenticated user publishes a post (including replies) |
{
"app_id": "123456",
"topic": "moderate",
"target_id": "78901",
"time": 1723226877,
"subscription_id": "234567",
"has_uid_field": false,
"values": [
{
"field": "replies",
"value": { "id": "8901234", "username": "test_username", "text": "Reply", "replied_to": { "id": "567890" } }
}
]
}
Important Headers
| Header | Description |
|---|---|
X-Hub-Signature-256 |
sha256=<hex> HMAC-SHA256 of the raw body keyed with the Threads App Secret |
X-Hub-Signature |
Legacy sha1=<hex> HMAC-SHA1 with the same key; verify the SHA-256 header instead |
Environment Variables
THREADS_APP_SECRET=your_threads_app_secret # Threads App Secret, not the Meta App Secret
THREADS_VERIFY_TOKEN=your_verify_token # For a direct callback, use the token entered in Meta
Setup
- In the App Dashboard add the Threads API use case, then under Use Cases > Customize > Settings add the Get real-time notifications with Threads Webhooks sub-use case.
- Select a topic, click **Subscribe to this object
Установить threads-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл threads-webhooks?
Receive and verify Threads (Meta) webhooks. Use when setting up Threads webhook handlers, completing the GET hub.challenge handshake, debugging X-Hub-Signature-256 signature verification, or handling replies, mentions, publish, and delete notifications.
Как установить скилл threads-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл threads-webhooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic