|
3 | 3 | Token sources for the LiveKit Rust SDK. A token source procures the credentials — server URL and |
4 | 4 | participant token — needed to join a LiveKit room. |
5 | 5 |
|
6 | | -Three sources ship with the crate, constructed via the `TokenSource` factory functions: |
| 6 | +Three sources ship with the crate, constructed via factory functions: |
7 | 7 |
|
8 | | -- `TokenSource::literal` — a fixed set of pre-provisioned credentials. |
9 | | -- `TokenSource::endpoint` — fetches credentials from a token endpoint implementing the |
| 8 | +- `literal` — a fixed set of pre-provisioned credentials. |
| 9 | +- `endpoint` — fetches credentials from a token endpoint implementing the |
10 | 10 | [standard format](https://docs.livekit.io/frontends/build/authentication/endpoint/). |
11 | | -- `TokenSource::development_token_server` — queries a LiveKit |
| 11 | +- `development_token_server` — queries a LiveKit |
12 | 12 | [development token server](https://docs.livekit.io/frontends/build/authentication/sandbox-token-server/) |
13 | 13 | for prototyping. **Not for production use.** |
14 | 14 |
|
15 | 15 | Custom credential backends can implement the `TokenSourceFixed` or `TokenSourceConfigurable` |
16 | 16 | traits. |
17 | 17 |
|
18 | 18 | ```rust |
19 | | -use livekit_token_source::{TokenSource, TokenSourceConfigurable, TokenSourceFetchOptions}; |
| 19 | +use livekit_token_source::{TokenSourceConfigurable, TokenSourceFetchOptions}; |
20 | 20 |
|
21 | | -let source = TokenSource::endpoint("https://example.com/api/token", vec![]); |
| 21 | +let source = livekit_token_source::endpoint("https://example.com/api/token"); |
22 | 22 | let options = TokenSourceFetchOptions::new() |
23 | 23 | .with_room_name("my-room") |
24 | 24 | .with_participant_identity("user-123"); |
|
0 commit comments