Class LiveKitWebhookReceiver
public sealed class LiveKitWebhookReceiver : ILiveKitWebhookReceiver
- Inheritance
-
LiveKitWebhookReceiver
- Implements
- Inherited Members
Constructors
LiveKitWebhookReceiver(ILiveKitTokenVerifier)
Initializes a new instance of the LiveKitWebhookReceiver class.
public LiveKitWebhookReceiver(ILiveKitTokenVerifier tokenVerifier)
Parameters
tokenVerifierILiveKitTokenVerifierThe token verifier service.
Exceptions
- ArgumentNullException
Thrown when tokenVerifier is null.
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
public Task<WebhookEvent> ReceiveAsync(string body, string? authorizationHeader = null, bool skipAuth = false, CancellationToken cancellationToken = default)
Parameters
bodystringThe raw JSON body of the webhook request.
authorizationHeaderstringThe Authorization header value containing the JWT token.
skipAuthboolIf true, skips authentication and signature validation. Use only for testing.
cancellationTokenCancellationTokenCancellation 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.