Command Palette

Search for a command to run...

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

typefully-webhooks

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

Receive and verify Typefully webhooks. Use when setting up Typefully API v2 webhook handlers, debugging X-Typefully-Signature verification, or handling draft…

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

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

Typefully Webhooks

When to Use This Skill

  • How do I receive Typefully webhooks?
  • How do I verify the X-Typefully-Signature header (sha256=<hex>)?
  • How do I handle draft.published or draft.scheduled events?
  • Why is my Typefully webhook signature verification failing?
  • Which events does Typefully send, and how does it retry?

Essential Code (USE THIS)

Typefully (API v2) sends a JSON envelope { "event": "draft.created", "data": { ...draft } } and signs each delivery with three headers:

X-Typefully-Event: draft.published
X-Typefully-Timestamp: 1737381605            (Unix seconds)
X-Typefully-Signature: sha256=<64 hex chars>
  • Algorithm: HMAC-SHA256, lowercase hex, keyed with the webhook secret (from your Typefully API settings) used as-is, as UTF-8.
  • Signed message: the X-Typefully-Timestamp value, a literal ., then the raw request body bytes.
  • Typefully's docs only say to check that the timestamp is recent; they don't give a window. The examples leave it off by default (see below).

Verification (Node.js)

const crypto = require('crypto');

// rawBody: Buffer of the exact request bytes (express.raw({ type: '*/*' }), not express.json)
function verifyTypefully(rawBody, timestamp, signature, secret) {
  if (!secret || !timestamp || !signature) return false;
  const digest = signature.startsWith('sha256=') ? signature.slice(7) : signature;
  if (!/^[0-9a-fA-F]{64}$/.test(digest)) return false; // validate before decoding
  const expected = crypto.createHmac('sha256', secret)
    .update(Buffer.concat([Buffer.from(timestamp, 'latin1'), Buffer.from('.'), rawBody]))
    .digest();
  const received = Buffer.from(digest.toLowerCase(), 'hex');
  return received.length === expected.length && crypto.timingSafeEqual(received, expected);
}

Verification (Python)

import hashlib, hmac, re

def verify_typefully(raw_body: bytes, timestamp, signature, secret: str) -> bool:
    if not secret or not timestamp or not signature:
        return False
    digest = signature[len("sha256="):] if signature.startswith("sha256=") else signature
    if not re.fullmatch(r"[0-9a-fA-F]{64}", digest):
        return False
    message = b"".join([timestamp.encode("latin-1"), b".", raw_body])
    expected = hmac.new(secret.encode(), message, hashlib.sha256).digest()
    return hmac.compare_digest(bytes.fromhex(digest), expected)

Respond 401 when the signature or timestamp header is missing, malformed, or doesn't match. Respond with any 2xx once the event is accepted.

Replay window (opt-in): Typefully suggests checking that the timestamp is recent. The examples don't, by default: Hookdeck's retries and replays resend the original timestamp, and Typefully doesn't document whether its own retries do, so a fixed window could reject legitimate redeliveries. Set TYPEFULLY_WEBHOOK_TOLERANCE_SECONDS to a positive number of seconds (the timestamp is Unix seconds) to opt in; unset or 0 leaves it off. Payloads carry no event ID, and one draft can produce several deliveries of the same event (draft.tags_changed, draft.status_changed), so data.id plus the event isn't a safe dedupe key: make handlers idempotent instead (upsert the draft by data.id, and run one-off side effects once per state, such as once per data.id and data.published_at for draft.published).

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

Common Event Types

The type is in the body's event field (and the X-Typefully-Event header). The docs list seven:

Event Description
draft.created A new draft is created
draft.planned A draft is planned (dated but inert until confirmed)
draft.scheduled A draft is scheduled for publishing
draft.published A draft is successfully published
draft.status_changed Any status transition (includes planned, scheduled, published)
draft.tags_changed A draft's tags are modified
draft.deleted A draft is deleted

data holds the full draft (id, social_set_id, status, scheduled_date, tags, per-platform platforms, published URLs such as x_published_url). See references/overview.md.

For the full event reference, see Typefully's API docs.

Important Headers

Header Description
X-Typefully-Signature sha256=<hex> HMAC-SHA256 signature
X-Typefully-Timestamp Unix timestamp (seconds) when the event was generated
X-Typefully-Event The event type, for example draft.published

Environment Variables

TYPEFULLY_WEBHOOK_SECRET=your_typefully_webhook_secret   # from Typefully's API settings
TYPEFULLY_WEBHOOK_TOLERANCE_SECONDS=0   # optional; a positive value opts in to the replay window

Local Development

Полный SKILL.md на GitHub

Установить typefully-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/typefully/route.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

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

Receive and verify Typefully webhooks. Use when setting up Typefully API v2 webhook handlers, debugging X-Typefully-Signature verification, or handling draft events like draft.created, draft.scheduled, draft.published, draft.status_changed, and draft.deleted.

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

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

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

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

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

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