This repository contains a collection of small, self-contained examples for the LiveKit C++ SDK.
The goal of these examples is to demonstrate common usage patterns of the LiveKit C++ SDK (connecting to a room, publishing tracks, RPC, data streams, etc.) without requiring users to build the SDK from source.
These examples automatically download a prebuilt LiveKit C++ SDK release from GitHub at CMake configure time.
This is handled by the CMake helper: LiveKitSDK.cmake.
By default, the examples download the latest released LiveKit C++ SDK.
You can pin a specific SDK version using the LIVEKIT_SDK_VERSION CMake option.
Use the latest release:
cmake -S . -B buildUse a specific version:
cmake -S . -B build -DLIVEKIT_SDK_VERSION=1.3.0Reconfigure to change versions:
rm -rf build
cmake -S . -B build -DLIVEKIT_SDK_VERSION=1.3.0Build against a local SDK:
rm -rf build
# install the SDK into $HOME/livekit-sdk-install (or any other directory)
cmake --install <sdk-build-dir> --prefix "$HOME/livekit-sdk-install"
# build the examples against the local SDK
cmake -S . -B build -DLIVEKIT_LOCAL_SDK_DIR="$HOME/livekit-sdk-install"cmake -S . -B build
cmake --build buildcmake -S . -B build
cmake --build build --config ReleaseThe LiveKit Release SDK is downloaded into build/_deps/livekit-sdk/
After building, example binaries are located under:
build/<example-name>/For example:
./build/basic_room/basic_room --url <ws-url> --token <token>Prebuilt SDKs are downloaded automatically for:
- Windows: x64
- macOS: x64, arm64 (Apple Silicon)
- Linux: x64
If no matching SDK is available for your platform, CMake configuration will fail with a clear error.
