langfuse-webhooks
БесплатноЗапускает вложенные скриптыНе проверенReceive and verify Langfuse webhooks. Use when setting up a Langfuse prompt-management webhook endpoint, verifying the x-langfuse-signature header (t=,v1=…
от hookdeck★ 104 звезды на GitHubОб этом скилле
Langfuse Webhooks
Langfuse (the open-source LLM engineering platform) can run an Automation on prompt
management: when a prompt version is created, updated (labels or tags) or deleted, a "Webhook
Call" action sends a JSON notification to your URL. Each request is signed with the
x-langfuse-signature header, so your endpoint can verify the sender and the exact body.
When to Use This Skill
- How do I receive Langfuse webhooks?
- How do I verify the
x-langfuse-signatureheader (t=<timestamp>,v1=<signature>)? - How do I handle Langfuse prompt version
created,updatedanddeletedevents? - Why does my Langfuse webhook signature verification fail (raw body, timestamp prefix)?
- Why does an
updatedLangfuse webhook arrive twice?
Verification (core)
The header is x-langfuse-signature: t=<timestamp>,v1=<hex>. The signature is the lowercase hex
HMAC-SHA256 of <t>.<raw body>, keyed with the webhook's signing secret as UTF-8 bytes.
const crypto = require('crypto');
function verifyLangfuseSignature(rawBody /* Buffer */, header, secret) {
let t;
const sigs = [];
for (const part of String(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' && t === undefined) t = v; // keep t as the exact string sent
else if (k === 'v1') sigs.push(v); // may repeat (rotation); ignore v0 etc.
}
if (!secret || !t || sigs.length === 0) return false;
const expected = crypto.createHmac('sha256', Buffer.from(secret, 'utf8'))
.update(Buffer.concat([Buffer.from(`${t}.`), rawBody])).digest();
return sigs.some((s) => // validate before decoding, then constant-time
/^[0-9a-fA-F]{64}$/.test(s) &&
crypto.timingSafeEqual(Buffer.from(s.toLowerCase(), 'hex'), expected));
}
- Sign bytes: the raw body exactly as received (
express.raw({ type: '*/*' }), Next.jsawait request.arrayBuffer(), FastAPIawait request.body()). NeverJSON.parse/stringifyfirst. - Use
texactly as it appears in the header; never parse it to a number and re-format it. - The secret is used as-is (UTF-8), not hex- or base64-decoded. Env var:
LANGFUSE_WEBHOOK_SECRET. - Accept the delivery if any
v1=entry matches. A header with not=or nov1=fails. - Hex is case-insensitive: require exactly 64 hex characters, then compare bytes in constant time.
- Python:
hmac.compare_digeston bytes (bytes.fromhexafter a[0-9a-fA-F]{64}check). - Missing header, malformed value or mismatch:
401. - No timestamp window by default. Hookdeck retries and replays resend the original headers and
timestamp, so a fixed window would reject legitimate retries. To opt in, set
LANGFUSE_WEBHOOK_TOLERANCE_SECONDS(unset or0= off);tis Unix seconds.
For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.
Event Types
Route on the body's type first, then on action for prompt versions.
type |
Sent When |
|---|---|
prompt-version |
A prompt automation fires; action says what happened (below) |
monitor-alert |
An alert automation fires because an alert's severity changed; no action, the alert is in payload |
action (prompt-version) |
Sent When |
|---|---|
created |
A prompt version is created |
updated |
A prompt version's labels or tags change (two deliveries: the version gaining and the version losing the label/tag) |
deleted |
A prompt version is deleted |
Langfuse's docs print a created prompt body and a monitor-alert body; the lowercase updated
and deleted values match the enum in Langfuse's open-source code. Project notification channels
(failed exports, deactivated evaluators) can post type: "project-notification" with an event
object, which the docs don't print. Log and acknowledge any type or action you don't handle.
The prompt payload carries id, timestamp, type, apiVersion, action and a prompt object
(name, version, labels, tags, prompt, config, commitMessage, ...). See
references/overview.md.
Delivery
POST with a JSON body. A 2xx confirms receipt; otherwise Langfuse retries with exponential
back-off, and after 5 consecutive failed deliveries it disables the automation's trigger (re-enable
it on the Automations page). Langfuse's open-source worker waits 10 seconds per attempt and makes
4 attempts a few hundred milliseconds apart (self-hosting defaults). Respond quickly and make the
handler idempotent: key on the payload id, which stays the same when a delivery is retried.
Environment Variables
LANGFUSE_WEBHOOK_SECRET=your_langfuse_webhook_secret # shown when the webhook is created; regenerable
# LANGFUSE_WEBHOOK_TOLERANCE_SECON
Установить langfuse-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл langfuse-webhooks?
Receive and verify Langfuse webhooks. Use when setting up a Langfuse prompt-management webhook endpoint, verifying the x-langfuse-signature header (t=,v1= HMAC-SHA256), debugging signature failures, or handling prompt version created, updated and deleted events and alert notifications.
Как установить скилл langfuse-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл langfuse-webhooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic