pub struct Client { /* private fields */ }Expand description
The VideoSDK server SDK client.
Cloning is cheap: clones share one connection pool and one token cache. The
client mints and attaches the API token for its own requests automatically,
so you never hand-roll a JWT or set the Authorization header.
// Reads VIDEOSDK_API_KEY and VIDEOSDK_SECRET from the environment.
let client = videosdk::Client::new()?;Implementations§
Source§impl Client
impl Client
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Constructs a client from the VIDEOSDK_API_KEY, VIDEOSDK_SECRET and
VIDEOSDK_API_ENDPOINT environment variables.
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Starts building a client.
Sourcepub fn with_max_retries(&self, max_retries: u32) -> Self
pub fn with_max_retries(&self, max_retries: u32) -> Self
Returns a clone of this client that retries a different number of times.
The clone shares the same connection pool and token cache.
Sourcepub fn with_request_timeout(&self, timeout: Duration) -> Self
pub fn with_request_timeout(&self, timeout: Duration) -> Self
Returns a clone of this client with a different per-request timeout.
Duration::ZERO disables the timeout.
Sourcepub fn generate_token(&self) -> Result<String>
pub fn generate_token(&self) -> Result<String>
Mints a fresh management token from the client’s credentials, applying any
configured TokenOptions.
Sourcepub fn access_token(&self) -> Result<AccessTokenBuilder>
pub fn access_token(&self) -> Result<AccessTokenBuilder>
Starts building an access token.
Defaults to a participant token (roles: ["rtc"]); call
AccessTokenBuilder::for_api for a management token.
Sourcepub fn verify_token(&self, token: &str) -> Result<TokenClaims>
pub fn verify_token(&self, token: &str) -> Result<TokenClaims>
Verifies a token against the client’s secret and returns its claims.
Source§impl Client
impl Client
Sourcepub async fn request(
&self,
method: Method,
path: &str,
request: RawRequest,
) -> Result<Value>
pub async fn request( &self, method: Method, path: &str, request: RawRequest, ) -> Result<Value>
Calls any endpoint with an arbitrary HTTP method, applying auth and retries, and returns the undecoded JSON response.
For the common verbs, Client::api reads better.
Source§impl Client
impl Client
Sourcepub fn rooms(&self) -> RoomsResource<'_>
pub fn rooms(&self) -> RoomsResource<'_>
The rooms (meetings) API.
Sourcepub fn sessions(&self) -> SessionsResource<'_>
pub fn sessions(&self) -> SessionsResource<'_>
The sessions API, covering live and past sessions and their participants.
Sourcepub fn participants(&self) -> ParticipantsResource<'_>
pub fn participants(&self) -> ParticipantsResource<'_>
A room-keyed view over a room’s live participants.
Sourcepub fn recordings(&self) -> RecordingsResource<'_>
pub fn recordings(&self) -> RecordingsResource<'_>
The recordings API: room, participant, track, composite and merge.
Sourcepub fn hls(&self) -> HlsResource<'_>
pub fn hls(&self) -> HlsResource<'_>
The HLS API.
Sourcepub fn rtmp(&self) -> RtmpResource<'_>
pub fn rtmp(&self) -> RtmpResource<'_>
The RTMP-out (livestream) API.
Sourcepub fn sip(&self) -> SipResource<'_>
pub fn sip(&self) -> SipResource<'_>
The SIP / telephony API.
Sourcepub fn agents(&self) -> AgentsResource<'_>
pub fn agents(&self) -> AgentsResource<'_>
The AI agents API: dispatch agents and manage cloud deployments.
Sourcepub fn alert_rules(&self) -> AlertRulesResource<'_>
pub fn alert_rules(&self) -> AlertRulesResource<'_>
The alert-rules API: metric-threshold alerts over your telemetry.
Sourcepub fn batch_call(&self) -> BatchCallsResource<'_>
pub fn batch_call(&self) -> BatchCallsResource<'_>
The batch-calls API: bulk outbound phone campaigns.
Sourcepub fn connectors(&self) -> ConnectorsResource<'_>
pub fn connectors(&self) -> ConnectorsResource<'_>
The telephony connectors API.
Sourcepub fn resource_pool(&self) -> ResourcePoolResource<'_>
pub fn resource_pool(&self) -> ResourcePoolResource<'_>
The resource-pool API: pre-acquire composition units. Enterprise tier.
Sourcepub fn transcodings(&self) -> TranscodingsResource<'_>
pub fn transcodings(&self) -> TranscodingsResource<'_>
The transcoding API: post-process recordings and HLS into files.
Sourcepub fn transcription(&self) -> TranscriptionResource<'_>
pub fn transcription(&self) -> TranscriptionResource<'_>
The transcription API.
Sourcepub fn whip(&self) -> WhipResource<'_>
pub fn whip(&self) -> WhipResource<'_>
The WHIP ingress builder: WebRTC-HTTP publish into a room.
Sourcepub fn whep(&self) -> WhepResource<'_>
pub fn whep(&self) -> WhepResource<'_>
The WHEP egress builder: standards-based WebRTC pull from a room.
Sourcepub fn socket_ingress(&self) -> SocketIngressResource<'_>
pub fn socket_ingress(&self) -> SocketIngressResource<'_>
Streams media and data frames into a room over a single-use WebSocket.