livekit_token_source/lib.rs
1// Copyright 2026 LiveKit, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Token sources for the LiveKit Rust SDK.
16//!
17//! A token source procures the credentials — server URL and participant
18//! token — needed to join a LiveKit room. Construct one via the
19//! [`literal`] / [`endpoint`] / [`development_token_server`] factory
20//! functions, or implement [`TokenSourceFixed`] / [`TokenSourceConfigurable`]
21//! to plug in a custom credential backend. Wrap a configurable source with
22//! [`TokenSourceConfigurable::cached`] to reuse credentials until they expire.
23
24mod caching;
25mod error;
26mod request;
27mod response;
28mod token_source;
29
30pub use caching::TokenSourceCached;
31pub use caching::TokenSourceInMemoryStore;
32pub use caching::TokenSourceStore;
33pub use error::TokenSourceError;
34pub use request::TokenSourceFetchOptions;
35pub use response::TokenSourceResponse;
36pub use response::TokenSourceResult;
37pub use token_source::development_token_server;
38pub use token_source::endpoint;
39pub use token_source::literal;
40pub use token_source::TokenSourceConfigurable;
41pub use token_source::TokenSourceDevelopmentTokenServer;
42pub use token_source::TokenSourceEndpoint;
43pub use token_source::TokenSourceFixed;
44pub use token_source::TokenSourceLiteral;