Table of Contents

Class LiveKitTokenBuilder

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

Constructors

LiveKitTokenBuilder(string, string, string)

Initializes a new instance of the LiveKitTokenBuilder class.

public LiveKitTokenBuilder(string apiKey, string apiSecret, string identity)

Parameters

apiKey string

The LiveKit API key.

apiSecret string

The LiveKit API secret.

identity string

The unique identity for the participant.

Methods

ToJwt()

Builds and returns the JWT token string.

public string ToJwt()

Returns

string

WithAttribute(string, string)

Adds a single attribute.

public ILiveKitTokenBuilder WithAttribute(string key, string value)

Parameters

key string
value string

Returns

ILiveKitTokenBuilder

WithAttributeIf(bool, string, string)

Conditionally adds an attribute.

public ILiveKitTokenBuilder WithAttributeIf(bool cond, string key, string value)

Parameters

cond bool
key string
value string

Returns

ILiveKitTokenBuilder

WithAttributes(IDictionary<string, string>)

Sets all attributes.

public ILiveKitTokenBuilder WithAttributes(IDictionary<string, string> attributes)

Parameters

attributes IDictionary<string, string>

Returns

ILiveKitTokenBuilder

WithKind(string)

Sets the participant kind.

public ILiveKitTokenBuilder WithKind(string kind)

Parameters

kind string

Returns

ILiveKitTokenBuilder

WithMetadata(string)

Sets the metadata for the participant.

public ILiveKitTokenBuilder WithMetadata(string metadata)

Parameters

metadata string

Returns

ILiveKitTokenBuilder

WithParticipantName(string)

Sets the participant name.

public ILiveKitTokenBuilder WithParticipantName(string name)

Parameters

name string

Returns

ILiveKitTokenBuilder

WithRoomConfiguration(RoomConfiguration)

Sets room configuration.

public ILiveKitTokenBuilder WithRoomConfiguration(RoomConfiguration roomConfiguration)

Parameters

roomConfiguration RoomConfiguration

Returns

ILiveKitTokenBuilder

WithRoomConfiguration(Action<RoomConfiguration>)

Configures room configuration.

public ILiveKitTokenBuilder WithRoomConfiguration(Action<RoomConfiguration> configureRoomConfiguration)

Parameters

configureRoomConfiguration Action<RoomConfiguration>

Returns

ILiveKitTokenBuilder

WithRoomPreset(string)

Sets the room preset.

public ILiveKitTokenBuilder WithRoomPreset(string roomPreset)

Parameters

roomPreset string

Returns

ILiveKitTokenBuilder

WithSipGrant(SipGrant)

Sets SIP grant permissions.

public ILiveKitTokenBuilder WithSipGrant(SipGrant sipGrant)

Parameters

sipGrant SipGrant

Returns

ILiveKitTokenBuilder

WithSipGrant(Action<SipGrant>)

Configures SIP grant permissions.

public ILiveKitTokenBuilder WithSipGrant(Action<SipGrant> configureSipGrant)

Parameters

configureSipGrant Action<SipGrant>

Returns

ILiveKitTokenBuilder

WithTimeToLive(TimeSpan)

Sets the token time-to-live.

public ILiveKitTokenBuilder WithTimeToLive(TimeSpan ttl)

Parameters

ttl TimeSpan

Returns

ILiveKitTokenBuilder

WithVideoGrant(VideoGrant)

Sets video grant permissions.

public ILiveKitTokenBuilder WithVideoGrant(VideoGrant videoGrant)

Parameters

videoGrant VideoGrant

Returns

ILiveKitTokenBuilder

WithVideoGrant(Action<VideoGrant>)

Configures video grant permissions.

public ILiveKitTokenBuilder WithVideoGrant(Action<VideoGrant> configureVideoGrant)

Parameters

configureVideoGrant Action<VideoGrant>

Returns

ILiveKitTokenBuilder