Command Palette

Search for a command to run...

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

crossly-webhooks

БесплатноБез исполняемых скриптовНе проверен

Receive and verify Crossly webhooks correctly. Register an endpoint (POST /v1/webhooks), verify the Crossly-Signature header (t=unix-seconds,v1=hex…

crosslyот crossly72 установки в других каталогах

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

Verify Crossly webhooks

Every delivery is a POST with a JSON body and these headers:

Header Value
Crossly-Signature t=<unix seconds>,v1=<hex HMAC-SHA256(secret, "<t>.<rawBody>")>
Crossly-Event the event name, e.g. sale.detected
Crossly-Delivery-Id the delivery id: log it for debugging
User-Agent Crossly-Webhooks/1.0

Body: { "id": "<event id>", "type": "sale.detected", "created": "<ISO 8601>", "data": { … } }.

Setup

  1. Create a free Crossly account: https://crossly.net/register
  2. Create a personal access token at https://crossly.net/settings/api/tokens/new (guide: https://crossly.net/guides/personal-access-tokens). Use a crossly_pat_test_ token against the sandbox while building.
  3. Export it as CROSSLY_PAT and send it as Authorization: Bearer $CROSSLY_PAT to https://crossly.net/api/v1/*. Full docs: https://crossly.net/docs

The three mistakes that break verification silently

  1. Verifying a re-serialised body. JSON.stringify(JSON.parse(body)) does not round-trip byte for byte, so genuine deliveries fail. Verify the exact raw bytes, then parse.
  2. Comparing with == / ===. A normal string compare leaks timing. Use a constant-time compare (crypto.timingSafeEqual, hmac.compare_digest, hash_equals). The hex is lowercase; an uppercase v1 must not verify.
  3. Ignoring the timestamp. t is inside the signed message, so it can't be edited, but without a freshness check a captured request replays forever. Reject when |now − t| > 300 seconds.

Also: parse the header field by field (split on ,, then on the first =, trim whitespace) and ignore unknown fields such as a future v2=. Throw or reject on anything that doesn't verify instead of returning a boolean someone forgets to check.

Use the SDK verifier when you can

TypeScript (@crossly/sdk, Web Crypto: Node 18+, Workers, Deno, Bun):

import express from 'express';
import { verifyWebhook, WebhookVerificationError } from '@crossly/sdk';

const app = express();
app.post('/crossly/webhook', express.raw({ type: 'application/json' }), async (req, res) => {
  try {
    const event = await verifyWebhook(req.body, req.header('Crossly-Signature'), process.env.CROSSLY_WEBHOOK_SECRET!);
    // at-least-once delivery: skip if event.id was already processed
    res.sendStatus(200);
  } catch (err) {
    if (err instanceof WebhookVerificationError) return res.status(400).send(err.reason);
    throw err;
  }
});

err.reason is one of malformed_header, bad_signature, timestamp_out_of_tolerance, missing_secret, no_crypto. Options: { toleranceSeconds?: number, nowSeconds?: number } (default 300).

Next.js route handler (raw body = request.text()):

export async function POST(request: Request) {
  const event = await verifyWebhook(await request.text(), request.headers.get('Crossly-Signature'), process.env.CROSSLY_WEBHOOK_SECRET!);
  return new Response(null, { status: 200 });
}

Fastify: register the route with config: { rawBody: true } and pass request.rawBody.

Python (the crossly client from https://github.com/crossly-dev/crossly-python, installed with pip install "git+https://github.com/crossly-dev/crossly-python#subdirectory=seller" until it is on PyPI):

from crossly.webhooks import verify_webhook, WebhookVerificationError

try:
    event = verify_webhook(raw_body, request.headers["Crossly-Signature"], os.environ["CROSSLY_WEBHOOK_SECRET"])
except WebhookVerificationError:
    return Response(status=400)

In Flask the raw body is request.get_data(); in FastAPI await request.body(). Verifiers with the same reasons ship in the Go, Java, Kotlin, C#, Rust, PHP, Ruby, Swift, Dart and Elixir SDKs too.

Writing your own (any language)

import { createHmac, timingSafeEqual } from 'node:crypto';

export function verifyCrossly(rawBody: string, header: string | undefined, secret: string, nowSec = Math.floor(Date.now() / 1000)) {
  if (!secret) throw new Error('missing_secret');
  let t: number | null = null, v1: string | null = null;
  for (const part of (header ?? '').split(',')) {
    const i = part.indexOf('=');
    if (i === -1) continue;
    const k = part.slice(0, i).trim(), v = part.slice(i + 1).trim();
    if (k === 't' && Number.isFinite(Number(v)) && v !== '') t = Number(v);
    else if (k === 'v1') v1 = v;
  }
  if (t === null || !v1) throw new Error('malformed_header');
  const expected = createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
  const a = Buffer.from(expected, 'utf8'), b = Buffer.from(v1, 'utf8');
  if (a.length !== b.length || !timingSafeEqual(a, b)) throw new Error('bad_signature');
  if (Math.abs(nowSec - t) > 300) throw new Error('timestamp_out_of_tolerance');
  return JSON.parse(rawBody);
}

The secret is used as-is (its UTF-8 bytes) as the HMAC key; don't hex-decode it. Check the signature first and freshness second, as the SDKs do. Conformance vectors e

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

Установить crossly-webhooks в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

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

Receive and verify Crossly webhooks correctly. Register an endpoint (POST /v1/webhooks), verify the Crossly-Signature header (t=unix-seconds,v1=hex HMAC-SHA256 of "t.rawBody") against the RAW request body with a constant-time compare and a 300 second timestamp tolerance, dedupe on the event id, answer 2xx fast, and test with POST /v1/webhooks/{id}/test. Use when writing or debugging a webhook receiver for Crossly in Express, Next.js, Fastify, Cloudflare Workers, Flask/FastAPI or any language.

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

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

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

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

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