Skip to main content

Crate livekit_token_source

Crate livekit_token_source 

Source
Expand description

Token sources for the LiveKit Rust SDK.

A token source procures the credentials — server URL and participant token — needed to join a LiveKit room. Construct one via the literal / endpoint / development_token_server factory functions, or implement TokenSourceFixed / TokenSourceConfigurable to plug in a custom credential backend. Wrap a configurable source with TokenSourceConfigurable::cached to reuse credentials until they expire.

Structs§

TokenSourceCached
The return type of TokenSourceConfigurable::cached: wraps another token source and stores the last fetched credentials, serving them for repeat fetches with equal options for as long as they stay valid.
TokenSourceDevelopmentTokenServer
The return type of development_token_server.
TokenSourceEndpoint
The return type of endpoint.
TokenSourceFetchOptions
Per-call overrides used to parameterize a token request.
TokenSourceInMemoryStore
The default TokenSourceStore: keeps credentials in memory, losing them when the process exits.
TokenSourceLiteral
The return type of literal.
TokenSourceResponse
The credentials returned by a token source: the server to connect to and the participant token to authenticate with.

Enums§

TokenSourceError
Errors returned when procuring credentials from a token source.

Traits§

TokenSourceConfigurable
A token source that generates credentials from per-call TokenSourceFetchOptions (room name, participant identity, agent dispatch, …).
TokenSourceFixed
A token source whose credentials are not parameterized: fetch takes no options and every call resolves the same way.
TokenSourceStore
Persistence backend for TokenSourceCached.

Functions§

development_token_server
Creates a token source that queries a LiveKit development token server for credentials, for quick prototyping / getting-started use cases.
endpoint
Creates a token source that fetches credentials from the given URL using the standard token endpoint format.
literal
Creates a token source holding a single, literal set of credentials, returned as-is on every fetch.

Type Aliases§

TokenSourceResult
Result alias used by all token source operations.