pub struct LiveKitApi { /* private fields */ }Expand description
A single entry point to every LiveKit server API, exposing each service
through an accessor (room(), egress(), ingress(), sip(),
agent_dispatch(), connector()).
Construct it with an API key and secret (with_api_key,
or new to read them from the environment) for backend use, or
with a pre-signed token (with_token) for client-side use
where the API secret must not be exposed.
Implementations§
Source§impl LiveKitApi
impl LiveKitApi
pub fn with_api_key(host: &str, api_key: &str, api_secret: &str) -> Self
Sourcepub fn new(host: &str) -> ServiceResult<Self>
pub fn new(host: &str) -> ServiceResult<Self>
Reads the key and secret from the LIVEKIT_API_KEY and
LIVEKIT_API_SECRET environment variables.
Sourcepub fn with_token(host: &str, token: &str) -> Self
pub fn with_token(host: &str, token: &str) -> Self
Authenticates with a pre-signed token, sent verbatim on every request. The token’s grants must cover the calls made through this client.
Sourcepub fn with_failover(self, enabled: bool) -> Self
pub fn with_failover(self, enabled: bool) -> Self
Enables or disables region failover on every service (enabled by default). Failover only engages for LiveKit Cloud hosts.
Sourcepub fn with_request_timeout(self, timeout: Duration) -> Self
pub fn with_request_timeout(self, timeout: Duration) -> Self
Overrides the default per-request timeout (10s) on every service.