crossly-webhooks
БесплатноБез исполняемых скриптовНе проверенReceive and verify Crossly webhooks correctly. Register an endpoint (POST /v1/webhooks), verify the Crossly-Signature header (t=unix-seconds,v1=hex…
от 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
- Create a free Crossly account: https://crossly.net/register
- 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. - Export it as
CROSSLY_PATand send it asAuthorization: Bearer $CROSSLY_PATtohttps://crossly.net/api/v1/*. Full docs: https://crossly.net/docs
The three mistakes that break verification silently
- 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. - 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 uppercasev1must not verify. - Ignoring the timestamp.
tis inside the signed message, so it can't be edited, but without a freshness check a captured request replays forever. Reject when|now − t| > 300seconds.
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
Установить 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), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic