LiveKit.AspNetCore.ServerSdk 3.2.0

dotnet add package LiveKit.AspNetCore.ServerSdk --version 3.2.0
                    
NuGet\Install-Package LiveKit.AspNetCore.ServerSdk -Version 3.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LiveKit.AspNetCore.ServerSdk" Version="3.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LiveKit.AspNetCore.ServerSdk" Version="3.2.0" />
                    
Directory.Packages.props
<PackageReference Include="LiveKit.AspNetCore.ServerSdk" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LiveKit.AspNetCore.ServerSdk --version 3.2.0
                    
#r "nuget: LiveKit.AspNetCore.ServerSdk, 3.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LiveKit.AspNetCore.ServerSdk@3.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LiveKit.AspNetCore.ServerSdk&version=3.2.0
                    
Install as a Cake Addin
#tool nuget:?package=LiveKit.AspNetCore.ServerSdk&version=3.2.0
                    
Install as a Cake Tool

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 = await _webhookReceiver.ReceiveAsync(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 rooms
  • ILiveKitPhoneNumberService - Manage phone numbers
  • ILiveKitCloudAgentService - Manage LiveKit Cloud agents
  • ILiveKitConnectorService - Manage WhatsApp and Twilio call connectors
  • ILiveKitAgentSimulationService - Run and manage agent simulations
  • ILiveKitAgentDBService - Manage agent databases

Documentation

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed