Table of Contents

Interface ILiveKitTokenBuilder

Namespace
LiveKit.Authentication
Assembly
LiveKit.AspNetCore.ServerSdk.Abstractions.dll

Builder for creating LiveKit authentication tokens.

Provides a fluent API for constructing access tokens with video grants, SIP grants, and participant attributes. See LiveKit Authentication Documentation for more information.

public interface ILiveKitTokenBuilder

Methods

ToJwt()

Builds and returns the JWT token string.

string ToJwt()

Returns

string

WithAttribute(string, string)

Adds a single attribute.

ILiveKitTokenBuilder WithAttribute(string key, string value)

Parameters

key string
value string

Returns

ILiveKitTokenBuilder

WithAttributeIf(bool, string, string)

Conditionally adds an attribute.

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

Parameters

cond bool
key string
value string

Returns

ILiveKitTokenBuilder

WithAttributes(IDictionary<string, string>)

Sets all attributes.

ILiveKitTokenBuilder WithAttributes(IDictionary<string, string> attributes)

Parameters

attributes IDictionary<string, string>

Returns

ILiveKitTokenBuilder

WithKind(string)

Sets the participant kind.

ILiveKitTokenBuilder WithKind(string kind)

Parameters

kind string

Returns

ILiveKitTokenBuilder

WithMetadata(string)

Sets the metadata for the participant.

ILiveKitTokenBuilder WithMetadata(string metadata)

Parameters

metadata string

Returns

ILiveKitTokenBuilder

WithParticipantName(string)

Sets the participant name.

ILiveKitTokenBuilder WithParticipantName(string name)

Parameters

name string

Returns

ILiveKitTokenBuilder

WithRoomConfiguration(RoomConfiguration)

Sets room configuration.

ILiveKitTokenBuilder WithRoomConfiguration(RoomConfiguration roomConfiguration)

Parameters

roomConfiguration RoomConfiguration

Returns

ILiveKitTokenBuilder

WithRoomConfiguration(Action<RoomConfiguration>)

Configures room configuration.

ILiveKitTokenBuilder WithRoomConfiguration(Action<RoomConfiguration> configureRoomConfiguration)

Parameters

configureRoomConfiguration Action<RoomConfiguration>

Returns

ILiveKitTokenBuilder

WithRoomPreset(string)

Sets the room preset.

ILiveKitTokenBuilder WithRoomPreset(string roomPreset)

Parameters

roomPreset string

Returns

ILiveKitTokenBuilder

WithSipGrant(SipGrant)

Sets SIP grant permissions.

ILiveKitTokenBuilder WithSipGrant(SipGrant sipGrant)

Parameters

sipGrant SipGrant

Returns

ILiveKitTokenBuilder

WithSipGrant(Action<SipGrant>)

Configures SIP grant permissions.

ILiveKitTokenBuilder WithSipGrant(Action<SipGrant> configureSipGrant)

Parameters

configureSipGrant Action<SipGrant>

Returns

ILiveKitTokenBuilder

WithTimeToLive(TimeSpan)

Sets the token time-to-live.

ILiveKitTokenBuilder WithTimeToLive(TimeSpan ttl)

Parameters

ttl TimeSpan

Returns

ILiveKitTokenBuilder

WithVideoGrant(VideoGrant)

Sets video grant permissions.

ILiveKitTokenBuilder WithVideoGrant(VideoGrant videoGrant)

Parameters

videoGrant VideoGrant

Returns

ILiveKitTokenBuilder

WithVideoGrant(Action<VideoGrant>)

Configures video grant permissions.

ILiveKitTokenBuilder WithVideoGrant(Action<VideoGrant> configureVideoGrant)

Parameters

configureVideoGrant Action<VideoGrant>

Returns

ILiveKitTokenBuilder