Command Palette

Search for a command to run...

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

orb-webhooks

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

Receive and verify Orb webhooks. Use when setting up Orb webhook handlers, debugging Orb signature verification, or handling usage-based billing events like…

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

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

Orb Webhooks

When to Use This Skill

  • Setting up Orb webhook handlers
  • Debugging Orb signature verification failures
  • Understanding Orb event types and payloads
  • Handling usage-based billing, subscription, or invoice events

Verification (core)

Orb signs every webhook with HMAC-SHA256 over the literal string v1:{X-Orb-Timestamp}:{rawBody}. The hex digest is delivered in X-Orb-Signature prefixed with v1= (e.g. v1=abc123…). The ISO 8601 timestamp arrives separately in X-Orb-Timestamp. Use the raw request body — don't JSON.parse first. During a secret rotation X-Orb-Signature can carry several space-separated signatures, and the delivery is valid when any v1 value matches, so split the header on spaces.

The orb-billing SDK does expose webhook helpers — webhooks.verifySignature(), plus webhooks.unwrap() and webhooks.unwrapStandard() which verify and parse (verified against [email protected]). The manual HMAC above is the dependency-free path and is what the examples use; either is fine.

Payload shape (important)

Orb serializes the event's resource under a key matching the resource_name prefix of type — invoice.issued carries it under invoice, subscription.created under subscription. The resource ID lives there, not in properties, which holds only the extra fields specific to the event and is an empty object for many types.

Every payload also carries payload_style: "standard" or "expanded", configured per endpoint. Standard payloads summarize subscriptions and invoices (no line items, related objects as references); expanded payloads carry them in full. New endpoints default to standard, and retries of older events keep the style they were created with — so branch on payload_style rather than assuming one. See references/overview.md.

Node:

const crypto = require('crypto');

function verifyOrbSignature(rawBody, signatureHeader, timestamp, secret) {
  if (!signatureHeader || !timestamp) return false;
  const expected = Buffer.from(
    crypto.createHmac('sha256', secret).update(`v1:${timestamp}:${rawBody}`).digest('hex'),
    'hex'
  );
  // Several space-separated signatures can arrive during a secret rotation.
  return signatureHeader.split(' ').some((entry) => {
    const provided = entry.startsWith('v1=') ? entry.slice(3) : entry;
    try {
      return crypto.timingSafeEqual(Buffer.from(provided, 'hex'), expected);
    } catch {
      return false;
    }
  });
}

Python:

import hmac, hashlib

def verify_orb_signature(raw_body: bytes, signature_header: str, timestamp: str, secret: str) -> bool:
    if not signature_header or not timestamp:
        return False
    expected = hmac.new(
        secret.encode(), f"v1:{timestamp}:".encode() + raw_body, hashlib.sha256
    ).hexdigest()
    # Several space-separated signatures can arrive during a secret rotation.
    for entry in signature_header.split(" "):
        provided = entry[3:] if entry.startswith("v1=") else entry
        if hmac.compare_digest(provided, expected):
            return True
    return False

For complete handlers with route wiring, event dispatch, and tests, see:

Common Event Types

Event Description
customer.created New customer created
customer.credit_balance_dropped Prepaid credit balance fell below a threshold
subscription.created New subscription created
subscription.started Subscription began
subscription.ended Subscription ended
subscription.plan_changed Subscription moved to a different plan
subscription.usage_exceeded Usage crossed a configured threshold
invoice.issued Invoice finalized and issued to customer
invoice.payment_succeeded Invoice paid successfully
invoice.payment_failed Invoice payment attempt failed
data_exports.transfer_success Scheduled data export delivered

For full event reference, see Orb Webhook Documentation

Environment Variables

ORB_WEBHOOK_SECRET=your_webhook_signing_secret   # The endpoint's secret

Each webhook endpoint has its own secret — it is not your account API key. The Create webhook endpoint API returns it once, and no other endpoint returns it again. Orb's SDKs read ORB_WEBHOOK_SECRET by default.

Local Development

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

Reference Materials

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

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

FAQ

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

Receive and verify Orb webhooks. Use when setting up Orb webhook handlers, debugging Orb signature verification, or handling usage-based billing events like invoice.issued, subscription.created, or customer.credit_balance_dropped.

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

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

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

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

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

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