Table of Contents

Interface ILiveKitWebhookReceiver

Namespace
LiveKit.Services
Assembly
LiveKit.AspNetCore.ServerSdk.Abstractions.dll

Service for receiving and validating LiveKit webhook events.

LiveKit sends webhook events to notify your server when room events occur, such as room started/finished, participant joined/left, track published/unpublished, and egress/ingress events.

The webhook receiver validates that requests came from LiveKit by verifying the JWT token signature and comparing the SHA256 hash of the request body.

See LiveKit Webhooks Documentation for more information.

public interface ILiveKitWebhookReceiver

Methods

ReceiveAsync(string, string?, bool, CancellationToken)

Receives and validates a webhook event from LiveKit.

This method performs two-layer security validation: 1. JWT Token Verification - Validates the token signature and expiration 2. SHA256 Checksum - Verifies the request body hasn't been tampered with

Task<WebhookEvent> ReceiveAsync(string body, string? authorizationHeader = null, bool skipAuth = false, CancellationToken cancellationToken = default)

Parameters

body string

The raw JSON body of the webhook request.

authorizationHeader string

The Authorization header value containing the JWT token.

skipAuth bool

If true, skips authentication and signature validation. Use only for testing.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<WebhookEvent>

The parsed webhook event containing event type, room, participant, and other event-specific data.

Exceptions

ArgumentException

Thrown when validation fails or the body cannot be parsed.

InvalidOperationException

Thrown when the SHA256 checksum validation fails.