Command Palette

Search for a command to run...

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

violet-webhooks

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

Receive and verify Violet webhooks. Use when setting up Violet (violet.io) webhook handlers, debugging X-Violet-Hmac signature verification, or handling…

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

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

Violet Webhooks

When to Use This Skill

  • How do I receive Violet webhooks?
  • How do I verify the X-Violet-Hmac signature on a Violet webhook?
  • Why is my Violet webhook signature verification failing?
  • How do I handle ORDER_COMPLETED, ORDER_SHIPPED, MERCHANT_CONNECTED or TRANSFER_SENT events?
  • Why did Violet pause or disable my webhook?

Verification (core)

Violet sends X-Violet-Hmac: <base64>: the standard, padded base64 of the HMAC-SHA256 of the raw request body bytes, keyed with your app secret (the same secret you use for API calls) used as UTF-8 — not hex- or base64-decoded. Nothing else is signed (no timestamp or id), and the value has no prefix. Check the header's format, then compare the whole value in constant time.

Node:

const crypto = require('crypto');

function verifyVioletSignature(rawBody, header, secret) {
  // 44 chars of padded base64: validate before comparing (never Buffer.from(header, 'base64'))
  if (typeof header !== 'string' || !/^[A-Za-z0-9+/]{43}=$/.test(header)) return false;
  const expected = Buffer.from(crypto.createHmac('sha256', secret).update(rawBody).digest('base64'));
  const received = Buffer.from(header);
  return received.length === expected.length && crypto.timingSafeEqual(received, expected);
}

Python:

import base64, hashlib, hmac, re

def verify_violet_signature(raw_body: bytes, header: str | None, secret: str) -> bool:
    if not header or not re.fullmatch(r"[A-Za-z0-9+/]{43}=", header, re.ASCII):
        return False
    digest = hmac.new(secret.encode("utf-8"), raw_body, hashlib.sha256).digest()
    return hmac.compare_digest(header.encode("ascii"), base64.b64encode(digest))

Respond 401 when the header is missing, malformed, or doesn't match. Compare the base64 string exactly: a value whose last character carries stray low bits decodes to the same bytes but is not what Violet sends.

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

Dispatch on X-Violet-Topic

The body is usually the entity itself (a full Order, an Offer, a PayoutAccount, a transfer...) with no event field, and all ORDER_* events send an Order. Recovery case bodies are the exception and carry event and event_key. Route on the X-Violet-Topic header, which every delivery carries; most requests can't be classified without it.

Violet's docs spell the cancellation topic two ways: ORDER_CANCELLED on the events pages and ORDER_CANCELED in the API's event enum and the Orders page's ORDER_UPDATED text. Accept both. Parse the body only after verification, and treat every field as untrusted (check types before reading into it).

Common Event Types (Topics)

Topic Description
ORDER_ACCEPTED Order accepted
ORDER_UPDATED Order changed
ORDER_COMPLETED Order completed
ORDER_SHIPPED Order shipped
ORDER_DELIVERED Order delivered
ORDER_REFUNDED Order refunded
ORDER_CANCELLED / ORDER_CANCELED Order cancelled (the docs use both spellings)
ORDER_FAILED Order failed
MERCHANT_CONNECTED Merchant connected to your app
MERCHANT_DISCONNECTED Merchant disconnected
MERCHANT_ENABLED / MERCHANT_DISABLED Merchant enabled or disabled
MERCHANT_NEEDS_ATTENTION Merchant health check needs attention
OFFER_ADDED / OFFER_UPDATED / OFFER_REMOVED / OFFER_DELETED Offer availability and changes
PRODUCT_SYNC_COMPLETED / PRODUCT_SYNC_FAILED Catalog sync results
TRANSFER_SENT / TRANSFER_FAILED / TRANSFER_REVERSED Payouts to merchants
PAYMENT_TRANSACTION_DISPUTE_OPENED / ORDER_DISPUTED Chargebacks

For the full list of 56 events, see references/overview.md and the Violet webhook events docs.

Delivery and Retries

  • Respond 2XX within 10 seconds; queue the work and process it afterwards
  • A failed event is retried 10 times with back-off over 24 hours, then marked FAILED
  • More than 50 failures in 30 minutes pauses the webhook for 1 hour, then 3 hours, then up to 24 hours; if it still fails after three pauses the webhook is DISABLED until you re-activate it
  • Violet's docs name X-Violet-Event-Id for idempotency. A resend carries the original ID in X-Violet-Event-Id-Source, so dedupe on that when present
  • Recovery case events can be redelivered under a different X-Violet-Event-Id: dedupe them on X-Violet-Recovery-Event-Key (the body's event_key)
  • For recovery case events, Violet treats a 4xx response as final and doesn't retry it. Return a 5xx when you want a retry

Environment Va

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

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

FAQ

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

Receive and verify Violet webhooks. Use when setting up Violet (violet.io) webhook handlers, debugging X-Violet-Hmac signature verification, or handling events like ORDER_COMPLETED, ORDER_SHIPPED, MERCHANT_CONNECTED, or TRANSFER_SENT.

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

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

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

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

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

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