From 58c1507df5027d071107044ccb2f4a0198c34e04 Mon Sep 17 00:00:00 2001 From: Alan George Date: Thu, 2 Jul 2026 09:54:19 -0600 Subject: [PATCH 1/2] Minor doc cleanup --- README.md | 2 +- docs/token-source-factory-recommendation.md | 131 -------------------- 2 files changed, 1 insertion(+), 132 deletions(-) delete mode 100644 docs/token-source-factory-recommendation.md diff --git a/README.md b/README.md index 8c582262..fecf0113 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Use this SDK to add realtime video, audio and data features to your C++ app. By - [LiveKit docs](https://docs.livekit.io) - [SDK reference](https://docs.livekit.io/reference/client-sdk-cpp/) -- [Repository docs](./docs/README.md) — building, [authentication](./docs/authentication.md), testing, logging, tracing +- [Repository docs](./docs/README.md) — building, authentication, testing, logging, tracing ## Using the SDK diff --git a/docs/token-source-factory-recommendation.md b/docs/token-source-factory-recommendation.md deleted file mode 100644 index e94e2f3f..00000000 --- a/docs/token-source-factory-recommendation.md +++ /dev/null @@ -1,131 +0,0 @@ -# TokenSource Factory Shape Options - -This note summarizes possible public API shapes for constructing TokenSource -implementations in the C++ SDK. - -## 1. Existing API - -Concrete classes expose mechanism-specific static factories: - -```cpp -LiteralTokenSource::fromLiteral(url, token); -LiteralTokenSource::fromProvider(provider); -CustomTokenSource::fromCustom(callback); -EndpointTokenSource::fromEndpoint(url, options); -SandboxTokenSource::fromSandboxTokenServer(sandbox_id, options); -CachingTokenSource::wrap(std::move(source)); -``` - -Pros: - -- Matches Android/JS naming concepts fairly closely. -- Explicit at the call site. -- Preserves the current `std::unique_ptr` ownership model. - -Cons: - -- Verbose and repetitive because the class name already says the mechanism. - -Example: - -```cpp -auto source = SandboxTokenSource::fromSandboxTokenServer("sandbox-id"); -``` - -## 2. Per-Class `create()` (selected) - -Keep concrete classes, but standardize factory names: - -```cpp -LiteralTokenSource::create(url, token); -LiteralTokenSource::create(provider); -CustomTokenSource::create(callback); -EndpointTokenSource::create(url, options); -SandboxTokenSource::create(sandbox_id, options); -CachingTokenSource::create(std::move(source)); -``` - -Pros: - -- More idiomatic with this SDK's existing `AudioFrame::create` / - `VideoFrame::create` style. -- Concise while keeping each concrete source discoverable. -- Keeps the current factory ownership model. - -Cons: - -- Less directly aligned with Android/JS names. -- The provider overload needs clear documentation because it shares the same - name as the static literal credential factory. - -Example: - -```cpp -auto source = SandboxTokenSource::create("sandbox-id"); -``` - -## 3. Root `TokenSource` Factory - -Add a root factory facade, similar to Android/JS: - -```cpp -TokenSource::fromLiteral(url, token); -TokenSource::fromCustom(callback); -TokenSource::fromEndpoint(url, options); -TokenSource::fromSandboxTokenServer(sandbox_id, options); -``` - -Alternative JS-style naming: - -```cpp -TokenSource::literal(...); -TokenSource::custom(...); -TokenSource::endpoint(...); -TokenSource::sandboxTokenServer(...); -``` - -Pros: - -- Best cross-SDK discoverability. -- Groups all TokenSource creation in one place. -- Avoids repeating mechanism names on concrete classes. - -Cons: - -- `TokenSource` would be a factory facade, not the polymorphic interface. -- May confuse the distinction between `TokenSourceFixed` and - `TokenSourceConfigurable`. - -Example: - -```cpp -auto source = TokenSource::fromSandboxTokenServer("sandbox-id"); -``` - -## 4. Constructors - -Make concrete sources directly constructible: - -```cpp -LiteralTokenSource source(url, token); -CustomTokenSource source(callback); -EndpointTokenSource source(url, options); -SandboxTokenSource source(sandbox_id, options); -``` - -Pros: - -- Most C++-native for concrete types. -- Shortest syntax for stack usage. - -Cons: - -- Larger shift from the current `std::unique_ptr` ownership story. -- Caching/wrapping may require heap allocation or additional helper APIs. - -Example: - -```cpp -SandboxTokenSource source("sandbox-id"); -auto credentials = source.fetch(request).get(); -``` From 2b15a3799c8716d3cafd128b367e7c8bc85cb919 Mon Sep 17 00:00:00 2001 From: Alan George Date: Thu, 2 Jul 2026 10:00:55 -0600 Subject: [PATCH 2/2] Change badge to actual workflow --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index fecf0113..7d4e1ccb 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,7 @@ Use this SDK to add realtime video, audio and data features to your C++ app. By connecting to LiveKit Cloud or a self-hosted server, you can quickly build applications such as multimodal AI, live streaming, or video calls with just a few lines of code. -[![Builds](https://github.com/livekit/client-sdk-cpp/actions/workflows/builds.yml/badge.svg?branch=main)](https://github.com/livekit/client-sdk-cpp/actions/workflows/builds.yml) -[![Tests](https://github.com/livekit/client-sdk-cpp/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/livekit/client-sdk-cpp/actions/workflows/tests.yml) +[![CI](https://github.com/livekit/client-sdk-cpp/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/livekit/client-sdk-cpp/actions/workflows/ci.yml) ## Docs