Table of Contents

Class LiveKitTokenService

Namespace
LiveKit.Authentication
Assembly
LiveKit.AspNetCore.ServerSdk.dll
public sealed class LiveKitTokenService : ILiveKitTokenService
Inheritance
LiveKitTokenService
Implements
Inherited Members

Constructors

LiveKitTokenService(IOptions<LiveKitOptions>)

Initializes a new instance of the LiveKitTokenService class.

public LiveKitTokenService(IOptions<LiveKitOptions> options)

Parameters

options IOptions<LiveKitOptions>

The LiveKit configuration options.

Methods

CreateServerToken(string?, TimeSpan?)

Creates a server token for API calls.

public string CreateServerToken(string? roomName = null, TimeSpan? ttl = null)

Parameters

roomName string
ttl TimeSpan?

Returns

string

CreateServerToken(string?, TimeSpan?, string?)

Creates a server token for API calls that forward or move a participant to another room.

public string CreateServerToken(string? roomName, TimeSpan? ttl, string? destinationRoom)

Parameters

roomName string

The room the token grants access to, if any.

ttl TimeSpan?

The token time-to-live. Defaults to 5 minutes.

destinationRoom string

The room a participant can be forwarded or moved to, if any.

Returns

string

CreateTokenBuilder(string)

Creates a token builder for the specified identity.

public ILiveKitTokenBuilder CreateTokenBuilder(string identity)

Parameters

identity string

Returns

ILiveKitTokenBuilder