TokenSource API examples#18
Open
alan-george-lk wants to merge 10 commits into
Open
Conversation
Add one example per token source type (literal, endpoint, sandbox, custom, caching) that connects to a room, plus a shared common.h for the logging delegate and connect/observe session loop. The sandbox example reads its sandbox ID from the environment so no IDs are committed. These build against a local install of the SDK's token source API branch via -DLIVEKIT_LOCAL_SDK_DIR; see token_source/README.md. Co-authored-by: Cursor <cursoragent@cursor.com>
Rename the per-type token source examples and shared helper to a token_source_ prefix so source filenames match their executable target names, and update the CMake source list, includes, and README references. Pin the README build instructions to client-sdk-cpp commit bbf6a41 and update the caching example comment to reference invalidate() now that force_refresh was dropped from the SDK API. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…tion into feature/token_source_examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v1.3.0+, each as its own executable undertoken_source/Examples
token_source_literal— connect with a URL + JWT you already have (LiteralTokenSource)token_source_endpoint— fetch credentials from your backend token endpoint (EndpointTokenSource)token_source_sandbox— use LiveKit Cloud’s sandbox token server for local dev (SandboxTokenSource)token_source_custom— plug in your own async credential provider (CustomTokenSource)token_source_caching— wrap another source with JWT-aware caching (CachingTokenSource)