Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

isnap-webhooks

БесплатноЗапускает вложенные скриптыНе проверен

Receive and verify iSnap webhooks, which follow the Standard Webhooks specification. Use when setting up an iSnap webhook endpoint, getting the whsec_ signing…

hookdeckот hookdeck★ 104 звезды на GitHub

Об этом скилле

iSnap Webhooks

iSnap is an iMessage and SMS line API: messages, reactions, typing indicators, lines (BYOD, rented and shared), trials, pre-orders and hosted macOS sessions. You create a subscription with POST /v1/webhooks (a url, an events filter and optional line_ids), and iSnap POSTs one signed JSON event per request to that URL. Signatures follow Standard Webhooks, so each delivery carries webhook-id, webhook-timestamp and webhook-signature headers.

When to Use This Skill

  • How do I receive iSnap webhooks?
  • How do I verify an iSnap webhook signature (webhook-signature)?
  • Where do I get my iSnap webhook secret (whsec_...)?
  • How do I handle message.received, message.delivered, message.failed or line.offline events?
  • Why is my iSnap webhook verification failing, or failing only on retries and replays?
  • Why was my iSnap subscription turned off or suspended?

Verification (core)

Header Value
webhook-id The event's event_id (evt_...), the same on every attempt and replay. Your idempotency key
webhook-timestamp Unix seconds when this attempt was sent; changes on every attempt
webhook-signature v1,<base64>. iSnap sends one signature per header; the examples still accept any space-separated v1, entry, as the spec allows

Signed content is {webhook-id}.{webhook-timestamp}.{raw body}, HMAC-SHA256, base64 output. The key is the base64-decoded part of the whsec_... secret after the prefix (48 bytes; not hex-decoded, not the string itself). Compare against every v1, entry and ignore other versions. If webhook-id is absent, read svix-id, svix-timestamp and svix-signature instead. The examples use the standardwebhooks library (npm and PyPI):

const { Webhook } = require('standardwebhooks');

// rawBody: exact request body (Buffer or string), NOT re-serialised JSON
function verifyIsnap(rawBody, headers, secret = process.env.ISNAP_WEBHOOK_SECRET) {
  const p = headers['webhook-id'] ? 'webhook' : 'svix'; // fall back to the svix-* names
  new Webhook(secret).verify(rawBody, {
    'webhook-id': headers[`${p}-id`],
    'webhook-timestamp': headers[`${p}-timestamp`],
    'webhook-signature': headers[`${p}-signature`],
  }, { jsonParse: false }); // throws on a bad signature or stale timestamp → respond 401
}

The library always enforces a fixed 5-minute timestamp window. iSnap stamps every attempt with a fresh webhook-timestamp, so direct deliveries always pass. Hookdeck retries and replays, however, resend the original webhook-timestamp, so the library rejects them once they are more than 5 minutes old. If you receive through Hookdeck and need late retries to pass, use the manual verifier in references/verification.md, which can drop or widen the window. In Express, read the body with express.raw({ type: '*/*' }) so any content type verifies, and parse JSON only after the check.

For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.

Never answer 410 to a failed verification: iSnap treats a 410 as "gone" and turns the subscription off immediately. Use 400 for missing headers and 401 for a bad signature.

Event Type and Payload

Every body is the same envelope, and the event name is the top-level event_type (there is no type or id field):

{
  "api_version": "v1",
  "event_id": "evt_Fh50GcqYY37ay4VjUxQ2rR6jN",
  "event_type": "message.received",
  "created_at": "2026-10-08T14:22:57.143Z",
  "trace_id": "174b4a27e4e4938fa67ea87b23a18579",
  "data": { "message": { "id": "msg_...", "body": "..." }, "metadata": null, "line_metadata": null }
}

event_id equals the webhook-id header and is the dedupe key. data always holds metadata and line_metadata (the metadata you attached to the resource and to the line). The unsigned X-iSnap-Event header repeats the type, but read the type from the verified body.

Common Event Types

Event Fired when
message.received An inbound message is stored
message.queued / message.scheduled A message is accepted for sending, or accepted and held
message.sent The line's device confirms it sent a message
message.delivered / message.read A message is delivered, or read by the recipient
message.failed A send fails
message.cancelled You cancel a queued or held message
message.fallback_triggered A message went out over SMS or RCS instead of iMessage
reaction.added / reaction.received / reaction.removed A reaction you added is confirmed, a contact reacts, or a reaction is removed
typing_indicator.started / typing_indicator.stopped A contact starts or stops typing (never on
Полный SKILL.md на GitHub

Установить isnap-webhooks в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/express/.env.exampleexamples/express/README.mdexamples/express/package.jsonexamples/express/src/index.jsexamples/fastapi/.env.exampleexamples/fastapi/README.mdexamples/fastapi/main.pyexamples/fastapi/requirements.txtexamples/fastapi/test_webhook.pyexamples/nextjs/.env.exampleexamples/nextjs/README.mdexamples/nextjs/app/webhooks/isnap/route.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

Что делает скилл isnap-webhooks?

Receive and verify iSnap webhooks, which follow the Standard Webhooks specification. Use when setting up an iSnap webhook endpoint, getting the whsec_ signing secret from POST /v1/webhooks, debugging webhook-id / webhook-timestamp / webhook-signature verification, or handling iMessage and SMS line events like message.received, message.delivered, message.failed, reaction.received and line.offline.

Как установить скилл isnap-webhooks?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл isnap-webhooks запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить isnap-webhooks с