livekit-webhooks
БесплатноЗапускает вложенные скриптыНе проверенReceive and verify LiveKit webhooks (LiveKit Cloud and self-hosted livekit-server). Use when setting up LiveKit webhook handlers, debugging the…
от hookdeck★ 104 звезды на GitHubОб этом скилле
LiveKit Webhooks
LiveKit (livekit.io) is the open-source WebRTC platform: an SFU for realtime audio, video
and data, plus Agents, SIP telephony and Egress/Ingress. LiveKit Cloud and self-hosted
livekit-server send the same webhook request, signed the same way.
When to Use This Skill
- How do I receive LiveKit webhooks?
- How do I verify a LiveKit webhook (
AuthorizationJWT +sha256claim)? - Why does every LiveKit webhook delivery fail with 401 / an empty body?
- How do I handle
participant_joined,room_finishedoregress_ended? - How do I configure webhooks in LiveKit Cloud or in a self-hosted
config.yaml?
Webhooks vs SDK events: webhook event names are snake_case (
participant_joined). PascalCase names (ParticipantConnected,TrackSubscribed) are in-process client SDK callbacks (RoomEvent/ParticipantEvent), not webhooks. LiveKit's docs cover both on one page; only the snake_case list is delivered over HTTP.
Verification (core)
This is not an HMAC-in-a-custom-header scheme. LiveKit sends
Authorization: <JWT> (bare token, no Bearer prefix) and
Content-Type: application/webhook+json. Verify in two mandatory steps: the JWT
signature only covers its claims, and the body is bound only through the sha256 claim.
- JWT: HS256 keyed with the project API secret,
issmust equal the API key,expmust be present and unexpired (10 s clock tolerance). Pin the algorithm. - Body:
sha256claim == base64(SHA-256(raw body)), standard base64 with padding.
import crypto from 'node:crypto';
import { jwtVerify } from 'jose';
async function verifyLiveKitWebhook(rawBody, authHeader, apiKey, apiSecret) {
if (!authHeader) throw new Error('authorization header is empty');
const token = authHeader.replace(/^Bearer\s+/i, '').trim(); // proxies may add it
const { payload } = await jwtVerify(token, new TextEncoder().encode(apiSecret), {
algorithms: ['HS256'], issuer: apiKey, requiredClaims: ['exp'], clockTolerance: 10,
});
if (typeof payload.sha256 !== 'string' || !payload.sha256) throw new Error('sha256 was not found in the token');
const expected = Buffer.from(crypto.createHash('sha256').update(rawBody).digest('base64'));
const received = Buffer.from(payload.sha256);
if (expected.length !== received.length || !crypto.timingSafeEqual(expected, received)) {
throw new Error('sha256 checksum of body does not match');
}
return payload;
}
Python is the same with PyJWT: jwt.decode(token, key=api_secret, algorithms=["HS256"], issuer=api_key, leeway=10, options={"require": ["exp", "iss"]}), then
hmac.compare_digest(base64.b64encode(hashlib.sha256(raw_body).digest()), claim.encode()).
Official one-liners: Node new WebhookReceiver(apiKey, apiSecret).receive(body, authHeader)
(livekit-server-sdk); Python WebhookReceiver(TokenVerifier(api_key, api_secret)).receive(body, auth)
(livekit-api). Fail closed (401) if LIVEKIT_API_KEY/LIVEKIT_API_SECRET are unset.
Raw body + content type: Express needs
express.raw({ type: 'application/webhook+json' });express.json()/defaultexpress.raw()match onlyapplication/json, leave the body empty, and every delivery 401s. Next.js:await request.text(). FastAPI:await request.body().
For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.
Common Event Types
The webhooks docs list 12 events, all in the top-level event field:
| Event | Triggered When |
|---|---|
room_started |
First participant joins an empty room |
room_finished |
Room closes (room.close(), or empty timeout expired after the last participant left) |
participant_joined |
Media connection established, state becomes ACTIVE |
participant_left |
Participant left and all cleanup completed |
participant_connection_aborted |
Connection aborted unexpectedly (e.g. media connection failed) |
track_published / track_unpublished |
Participant (un)published a track; room/participant carry only SID, name, identity |
egress_started / egress_updated / egress_ended |
Recording/streaming started, updated (e.g. file size), ended |
ingress_started / ingress_ended |
External stream ingest started / ended |
agent_job_pending, agent_job_started and agent_job_ended exist in LiveKit's protocol
definition (livekit_webhook.proto, webhook/consts.go) but not in the docs table or the
Cloud test-event picker. Handle unknown names with a 200, never a throwing default.
Body is protojson: { event, id, createdAt, room?, participant?, track?, egressInfo?, ingressInfo?, numDropped? }. Zero/default fields are omitted, int64s
(createdAt, joinedAt…) arrive as JSON strings, enums as names ("VIDEO"). Dedupe on
id. A non-zero numDropped means events were lost. See
[references/overview.md](refere
Установить livekit-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл livekit-webhooks?
Receive and verify LiveKit webhooks (LiveKit Cloud and self-hosted livekit-server). Use when setting up LiveKit webhook handlers, debugging the Authorization-header JWT and sha256 body-hash verification, fixing the application/webhook+json content-type trap, or handling room_started, room_finished, participant_joined, participant_left, track_published, egress_ended and ingress_started events.
Как установить скилл livekit-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл livekit-webhooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
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