LiveKit.AspNetCore.ServerSdk
2.2.1
See the version list below for details.
dotnet add package LiveKit.AspNetCore.ServerSdk --version 2.2.1
NuGet\Install-Package LiveKit.AspNetCore.ServerSdk -Version 2.2.1
<PackageReference Include="LiveKit.AspNetCore.ServerSdk" Version="2.2.1" />
<PackageVersion Include="LiveKit.AspNetCore.ServerSdk" Version="2.2.1" />
<PackageReference Include="LiveKit.AspNetCore.ServerSdk" />
paket add LiveKit.AspNetCore.ServerSdk --version 2.2.1
#r "nuget: LiveKit.AspNetCore.ServerSdk, 2.2.1"
#:package LiveKit.AspNetCore.ServerSdk@2.2.1
#addin nuget:?package=LiveKit.AspNetCore.ServerSdk&version=2.2.1
#tool nuget:?package=LiveKit.AspNetCore.ServerSdk&version=2.2.1
LiveKit ASP.NET Core Server SDK
ASP.NET Core SDK for LiveKit Server API. Provides HTTP clients and services for managing rooms, participants, recordings, ingress, SIP, and more.
Features
- ✅ Room Management - Create, list, and delete rooms
- ✅ Participant Management - Manage participants, tracks, and subscriptions
- ✅ Egress - Record and stream rooms, participants, or tracks
- ✅ Ingress - Bring external media (RTMP, WHIP, URL pull) into LiveKit
- ✅ SIP Integration - Manage SIP trunks, dispatch rules, and make calls
- ✅ Token Generation - JWT token builder with fluent API
- ✅ Webhook Validation - Two-layer security (JWT + SHA256)
- ✅ Agent Dispatch - Deploy AI agents to rooms
- ✅ Phone Numbers - Search, purchase, and manage phone numbers
Installation
Install the packages from NuGet:
dotnet add package LiveKit.AspNetCore.ServerSdk
dotnet add package LiveKit.AspNetCore.ServerSdk.Abstractions
Or via Package Manager:
Install-Package LiveKit.AspNetCore.ServerSdk
Install-Package LiveKit.AspNetCore.ServerSdk.Abstractions
Quick Start
1. Configure Services
In your Program.cs or Startup.cs:
builder.Services.AddLiveKit(options =>
{
options.BaseUrl = "wss://your-livekit-server.com";
options.ApiKey = "your-api-key";
options.ApiSecret = "your-api-secret";
});
2. Generate Access Tokens
public class TokenController : ControllerBase
{
private readonly ILiveKitTokenService _tokenService;
public TokenController(ILiveKitTokenService tokenService)
{
_tokenService = tokenService;
}
[HttpGet]
public IActionResult GetToken(string identity, string roomName)
{
var token = _tokenService
.CreateTokenBuilder(identity)
.WithKind(ParticipantInfo.Types.Kind.Standard)
.WithVideoGrant(video =>
{
video.RoomJoin = true;
video.Room = roomName;
video.CanPublish = true;
video.CanSubscribe = true;
})
.ToJwt();
return Ok(new { token });
}
}
3. Manage Rooms
public class RoomsController : ControllerBase
{
private readonly ILiveKitRoomService _roomService;
public RoomsController(ILiveKitRoomService roomService)
{
_roomService = roomService;
}
[HttpPost]
public async Task<IActionResult> CreateRoom(string name)
{
var request = new CreateRoomRequest { Name = name };
var room = await _roomService.CreateRoomAsync(request);
return Ok(room);
}
[HttpGet]
public async Task<IActionResult> ListRooms()
{
var request = new ListRoomsRequest();
var response = await _roomService.ListRoomsAsync(request);
return Ok(response);
}
[HttpDelete("{roomName}")]
public async Task<IActionResult> DeleteRoom(string roomName)
{
var request = new DeleteRoomRequest { Room = roomName };
var response = await _roomService.DeleteRoomAsync(request);
return NoContent();
}
}
4. Handle Webhooks
Create a controller for receiving webhook events:
public class WebhookController : ControllerBase
{
private readonly ILiveKitWebhookReceiver _webhookReceiver;
public WebhookController(ILiveKitWebhookReceiver webhookReceiver)
{
_webhookReceiver = webhookReceiver;
}
[HttpPost("/webhook")]
public async Task<IActionResult> ReceiveWebhook()
{
var body = await new StreamReader(Request.Body).ReadToEndAsync();
var authHeader = Request.Headers["Authorization"].ToString();
var webhookEvent = _webhookReceiver.Receive(body, authHeader);
// Handle webhook event
switch (webhookEvent.Event)
{
case LiveKitWebhookEvents.ROOM_STARTED:
// Handle room started
break;
case LiveKitWebhookEvents.PARTICIPANT_JOINED:
// Handle participant joined
break;
case LiveKitWebhookEvents.PARTICIPANT_LEFT:
// Handle participant left
break;
case LiveKitWebhookEvents.TRACK_PUBLISHED:
// Handle track published
break;
// Add more cases as needed
}
return Ok();
}
}
Available Services
Room Service
ILiveKitRoomService - Manage rooms and participants
Egress Service
ILiveKitEgressService - Record and stream content
Ingress Service
ILiveKitIngressService - Create ingress endpoints for external media
SIP Service
ILiveKitSipService - Manage SIP trunks and dispatch rules
Token Service
ILiveKitTokenService - Generate JWT tokens for client authentication
Webhook Receiver
ILiveKitWebhookReceiver - Validate and parse webhook events
Additional Services
ILiveKitAgentDispatchService- Deploy agents to roomsILiveKitPhoneNumberService- Manage phone numbersILiveKitCloudAgentService- Manage LiveKit Cloud agents
Documentation
- LiveKit Documentation
- Authentication Guide
- Server APIs
- RoomService APIs
- Egress APIs
- Ingress APIs
- SIP APIs
- Webhooks
License
MIT License - see LICENSE file for details
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
This README was generated by claude-sonnet-4-20250514
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- LiveKit.AspNetCore.ServerSdk.Abstractions (>= 2.2.1)
- Microsoft.Extensions.DependencyInjection (>= 8.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Http (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Options (>= 8.0.0)
- Microsoft.IdentityModel.JsonWebTokens (>= 8.0.1)
- System.Text.Json (>= 8.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.2.0 | 89 | 9/27/2026 |
| 3.1.0 | 167 | 7/20/2026 |
| 3.0.0 | 140 | 7/5/2026 |
| 2.2.2 | 371 | 5/27/2026 |
| 2.2.1 | 114 | 5/27/2026 |
| 2.2.0 | 130 | 5/22/2026 |
| 2.1.8 | 127 | 5/7/2026 |
| 2.1.7 | 110 | 5/7/2026 |
| 2.1.6 | 118 | 5/7/2026 |
| 2.1.5 | 179 | 4/25/2026 |
| 2.1.4 | 148 | 4/21/2026 |
| 2.1.3 | 249 | 4/18/2026 |
| 2.1.2 | 114 | 4/18/2026 |
| 2.1.1 | 256 | 3/23/2026 |
| 2.1.0 | 140 | 3/12/2026 |
| 2.0.0 | 126 | 3/4/2026 |
| 1.2.2 | 123 | 3/3/2026 |
| 1.2.0 | 124 | 3/3/2026 |
| 1.1.3 | 124 | 3/3/2026 |