Command Palette

Search for a command to run...

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

charitystack-webhooks

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

Receive and verify CharityStack webhooks. Use when setting up CharityStack webhook handlers, debugging X-Webhook-Signature verification (HMAC-SHA256 hex over…

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

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

CharityStack Webhooks

When to Use This Skill

  • How do I receive CharityStack webhooks?
  • How do I verify the X-Webhook-Signature header on a CharityStack webhook?
  • Why does my CharityStack webhook signature verification fail?
  • How do I handle donation.created or subscription.cancelled events?
  • Where do I find the CharityStack webhook secret?

Setup note

CharityStack shows the webhook secret only once, when you create the webhook. Paste it here.

The secret is the secret field of the POST /v1/webhooks response. If you lose it, delete the webhook and create a new one. See references/setup.md.

Verification (core)

Every delivery carries three headers:

X-Webhook-Signature: sha256=<hex digest>
X-Webhook-Timestamp: <unix seconds>
X-Webhook-ID: <delivery identifier>

The signature is the lowercase hex HMAC-SHA256 of <X-Webhook-Timestamp>.<raw body>, keyed with the webhook secret's UTF-8 bytes (not hex- or base64-decoded). Build the message as bytes, never decode and re-encode the body, and don't parse the JSON before verifying. Accept the digest with or without the sha256= prefix, check it is exactly 64 hex characters, compare in constant time, and respond 401 on any failure.

const signed = Buffer.concat([Buffer.from(timestamp, 'latin1'), Buffer.from('.'), rawBody]);
const expected = crypto.createHmac('sha256', Buffer.from(secret, 'utf8')).update(signed).digest();

const digest = signature.startsWith('sha256=') ? signature.slice(7) : signature;
if (!/^[0-9a-fA-F]{64}$/.test(digest)) return false;            // validate before decoding
return crypto.timingSafeEqual(expected, Buffer.from(digest.toLowerCase(), 'hex'));
signed = b"".join([timestamp.encode("latin-1"), b".", raw_body])
expected = hmac.new(secret.encode("utf-8"), signed, hashlib.sha256).digest()

digest = signature.removeprefix("sha256=")
if not re.fullmatch(r"[0-9a-fA-F]{64}", digest):                # validate before decoding
    return False
return hmac.compare_digest(expected, bytes.fromhex(digest))

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

CharityStack has no official webhook SDK, so verification is manual in every framework.

Timestamp tolerance is opt-in

CharityStack's guide suggests rejecting timestamps more than 5 minutes old. The examples do not do this by default: Hookdeck retries and replays resend the original headers and timestamp, so a fixed window would reject legitimate retries. Set CHARITYSTACK_WEBHOOK_TOLERANCE_SECONDS (for example 300) to turn it on; unset or 0 means off. X-Webhook-Timestamp is Unix seconds.

Read the raw body

Express: express.raw({ type: '*/*' }). Next.js: await request.arrayBuffer(). FastAPI: await request.body(). Parse the JSON only after the signature check.

Common Event Types

Dispatch on the body's type field.

Event Triggered when
donation.created A new donation is received
donation.updated A donation's status changes
subscription.created A new recurring subscription is started
subscription.updated A subscription is modified (e.g. amount changed)
subscription.cancelled A subscription is cancelled
subscription.payment_method_updated A payment method is updated through a hosted update link (subscription.updated is also emitted)
contact.created / contact.updated A contact is added or updated
form.created / form.updated A form is created or its configuration changes

For payload notes and delivery details, see references/overview.md and the CharityStack webhooks docs.

Delivery Notes

  • Method: POST with a JSON body.
  • Any non-2xx response counts as a failed delivery. No retry or timeout policy is documented, so return a 2xx quickly and process asynchronously. Return 2xx for event types you don't handle.
  • The body is an envelope of id, type, created (Unix seconds) and data (the stored record).
  • X-Webhook-ID identifies a delivery attempt, so don't rely on it alone to deduplicate retries; deduplicate on the envelope's id together with type, and keep handlers idempotent.

Environment Variables

CHARITYSTACK_WEBHOOK_SECRET=your_charitystack_webhook_secret
# Optional: reject timestamps older than this many seconds (unset or 0 = off)
CHARITYSTACK_WEBHOOK_TOLERANCE_SECONDS=300

Local Development

# Start tunnel (no account needed)
npx hookdeck-cli listen 3000 charitystack --path /webhooks/charitystack

Register the printed URL as the webhook url when you call POST /v1/webhooks.

Reference Materials

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

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

FAQ

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

Receive and verify CharityStack webhooks. Use when setting up CharityStack webhook handlers, debugging X-Webhook-Signature verification (HMAC-SHA256 hex over "<X-Webhook-Timestamp>.<raw body>"), or handling events like donation.created, subscription.cancelled, contact.created and form.updated.

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

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

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

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

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

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