Command Palette

Search for a command to run...

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

recurly-webhooks

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

Receive and verify Recurly webhooks. Use when setting up Recurly webhook handlers, verifying the recurly-signature header (HMAC-SHA256), securing the endpoint…

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

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

Recurly Webhooks

When to Use This Skill

  • How do I receive Recurly webhooks?
  • How do I verify the Recurly recurly-signature header?
  • How do I secure a Recurly webhook endpoint with HTTP Basic Auth?
  • How do I handle subscription.created or payment.succeeded notifications?
  • Why is my Recurly webhook signature verification failing?

How Recurly Secures Webhooks

Recurly webhooks are secured with up to three layers. Use all that apply:

  1. Signature (JSON payloads only). Recurly signs JSON notifications and sends the signature in a recurly-signature header. This is the primary integrity check — always verify it. (Legacy XML payloads are not signed.)
  2. HTTP Basic Auth. Configure a username/password on the endpoint in Recurly; Recurly sends them in the Authorization header on every request.
  3. IP allowlist. Accept requests only from Recurly's published IP ranges.

Prefer the JSON payload format so you get signature verification. Recurly's Ruby (Recurly::Webhooks.verify_signature) and Go (recurly.VerifyWebhookSignature) clients verify the header for you. For Node.js and Python, verify it manually with HMAC-SHA256 as shown below.

Verification (core)

The recurly-signature header is a Unix timestamp (Recurly's docs say milliseconds) followed by one or more hex HMAC-SHA256 signatures, comma-separated. Recurly's documented example:

recurly-signature: 1659641851,a8c8524a0cdd99e36b55d9fdf6c8aed2c2315dfa1a36c4961f65986ee6cf6ae9,cafe677a2e6fa177d1a73cd9a18e47533de4b8923bbe17e2e1be290717ca29c1

Signed message is `${timestamp}.${rawBody}` (the raw, unparsed body). Multiple signatures appear during a 24h key rotation; the notification is valid if any one matches. Use a constant-time compare.

const crypto = require('crypto');

function verifyRecurlySignature(rawBody, header, secret) {
  if (!header || !secret) return false;
  const [timestamp, ...signatures] = header.split(',');
  if (!timestamp || signatures.length === 0) return false;

  const expected = crypto
    .createHmac('sha256', secret)
    .update(`${timestamp}.`)
    .update(rawBody)                 // Buffer/string of the raw request body
    .digest('hex');

  const expBuf = Buffer.from(expected);
  return signatures.some((sig) => {
    const sigBuf = Buffer.from(sig.trim());
    return sigBuf.length === expBuf.length && crypto.timingSafeEqual(sigBuf, expBuf);
  });
}

For complete handlers with Basic Auth, event dispatch, and tests, see:

Parsing the Notification

A JSON notification is a small object. object_type and event_type together name the event, and the rest identifies the object (uuid, account_code, invoice_number, ...). Recurly's documented "New subscription" example:

{
  "id": "ra8foq26o2dt",
  "object_type": "subscription",
  "site_id": "qc326l1hl8k9",
  "event_type": "created",
  "event_time": "2022-07-26T22:01:56Z",
  "uuid": "63ab531e1d5b1d47eaf1ef44eeb853c3"
}

event_type alone is ambiguous (created exists for accounts, subscriptions, invoices, items and more), so dispatch on the pair:

const notification = JSON.parse(rawBody);
const eventKey = `${notification.object_type}.${notification.event_type}`; // "subscription.created"

Deduplicate on the recurly-notification-id request header, which stays the same across retries. Don't use the body's id: Recurly's examples print the same id on different events for one subscription.

Confirm state via the API before acting. Payloads are thin and webhooks can arrive out of order. Fetch the referenced object with the recurly client to read its current state (e.g. client.getSubscription('uuid-' + notification.uuid)).

XML endpoints send a different, unsigned format named by its root element (<new_subscription_notification>). This skill covers JSON only.

Common Notifications

object_type.event_type Triggered When
subscription.created A subscription is created
subscription.updated A plan, quantity or renewal date change takes effect
subscription.canceled A subscription is set not to renew
subscription.expired A subscription ends
subscription.renewed A subscription enters a new term
payment.succeeded A payment succeeds
payment.failed A payment is declined
charge_invoice.paid A charge invoice is paid (sites with Credit Invoices)
account.created An account is opened

For the full list, see references/overview.md and Recurly's Notifications reference.

Environment Variables

RECURLY_WEBHOOK_SECRET=xxxxx        # Endpoint secret key (Webhook Endpoints page
Полный SKILL.md на GitHub

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

FAQ

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

Receive and verify Recurly webhooks. Use when setting up Recurly webhook handlers, verifying the recurly-signature header (HMAC-SHA256), securing the endpoint with HTTP Basic Auth, or handling subscription and billing events like subscription.created, subscription.canceled, payment.succeeded and payment.failed (object_type + event_type in the JSON body).

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

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

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

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

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

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