Class BaseService
- Namespace
- Livekit.Server.Sdk.Dotnet
- Assembly
- LivekitApi.dll
Base class of the service clients: holds the credentials and the HttpClient, signs every call with a short-lived token and sends it as a Twirp request.
public class BaseService
- Inheritance
-
BaseService
- Derived
- Inherited Members
Constructors
BaseService(string, string, string, HttpClient)
Stores the credentials and the HttpClient the requests are sent with.
public BaseService(string host, string apiKey = null, string apiSecret = null, HttpClient client = null)
Parameters
hoststringURL of the LiveKit server,
http(s)://orws(s)://; a subpath such ashttps://host/livekitis kept.apiKeystringAPI key; the
LIVEKIT_API_KEYenvironment variable when omitted.apiSecretstringAPI secret; the
LIVEKIT_API_SECRETenvironment variable when omitted.clientHttpClientOptional HttpClient to send the requests with. The SDK never modifies it, so it can be shared with other clients and code.
Fields
httpClient
The HttpClient the requests are sent with: the one supplied to the constructor, or one owned by the SDK (which shares a connection pool with the other SDK-owned clients).
protected readonly HttpClient httpClient
Field Value
Methods
AuthHeader(VideoGrants)
Builds the bearer token of a call that needs videoGrants, valid for
DefaultTtl.
protected string AuthHeader(VideoGrants videoGrants)
Parameters
videoGrantsVideoGrantsRoom permissions the call needs.
Returns
- string
The signed JWT, sent as bearer token.
AuthHeader(VideoGrants, SIPGrants)
Builds the bearer token of a SIP call that needs videoGrants and
sipGrants, valid for DefaultTtl.
protected string AuthHeader(VideoGrants videoGrants, SIPGrants sipGrants)
Parameters
videoGrantsVideoGrantsRoom permissions the call needs.
sipGrantsSIPGrantsSIP permissions the call needs.
Returns
- string
The signed JWT, sent as bearer token.