{"id":29835226,"url":"https://github.com/livekit/client-sdk-cpp","last_synced_at":"2026-01-29T22:00:58.117Z","repository":{"id":178418052,"uuid":"632287234","full_name":"livekit/client-sdk-cpp","owner":"livekit","description":"Official native C++ client SDK for LiveKit: build real-time audio, video, and data applications using the LiveKit protocol.","archived":false,"fork":false,"pushed_at":"2026-01-19T11:40:12.000Z","size":2627,"stargazers_count":32,"open_issues_count":4,"forks_count":12,"subscribers_count":9,"default_branch":"main","last_synced_at":"2026-01-28T02:53:39.726Z","etag":null,"topics":["audio","cpp","data-channel","livekit","livekit-sdk","realtime","realtime-communication","rtc","video","webrtc"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/livekit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-25T05:22:42.000Z","updated_at":"2026-01-26T06:08:54.000Z","dependencies_parsed_at":"2024-01-13T07:00:59.266Z","dependency_job_id":null,"html_url":"https://github.com/livekit/client-sdk-cpp","commit_stats":null,"previous_names":["livekit/client-sdk-cpp"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/livekit/client-sdk-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Fclient-sdk-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Fclient-sdk-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Fclient-sdk-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Fclient-sdk-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/livekit","download_url":"https://codeload.github.com/livekit/client-sdk-cpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Fclient-sdk-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28886880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T21:06:44.224Z","status":"ssl_error","status_checked_at":"2026-01-29T21:06:42.160Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","cpp","data-channel","livekit","livekit-sdk","realtime","realtime-communication","rtc","video","webrtc"],"created_at":"2025-07-29T12:17:33.544Z","updated_at":"2026-01-29T22:00:58.085Z","avatar_url":"https://github.com/livekit.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LiveKit C++ Client SDK\n\nThis SDK enables native C++ applications to connect to LiveKit servers for real-time audio/video communication.\n\n---\n\n## 📦 Requirements\n- **CMake** ≥ 3.20  \n- **Rust / Cargo** (latest stable toolchain)  \n- **Git LFS** (required for examples)\n  Some example data files (e.g., audio assets) are stored using Git LFS.\n  You must install Git LFS before cloning or pulling the repo if you want to run the examples.\n\n**Platform-Specific Requirements:**\n\n### For Building the SDK:\n- **Windows:** Visual Studio 2019+, vcpkg\n- **Linux:** `sudo apt install libprotobuf-dev libssl-dev` (protobuf 3.x)\n- **macOS:** `brew install protobuf` (protobuf 3.x)\n\n### For Using the Pre-built SDK:\n- **Windows:** ✅ All dependencies included (DLLs bundled) - ready to use\n- **Linux:** ⚠️ Requires `libprotobuf` and `libssl-dev`; deploy `liblivekit_ffi.so` with your executable\n- **macOS:** ⚠️ Requires `protobuf`; deploy `liblivekit_ffi.dylib` with your executable\n\n\u003e **Note**: If the SDK was built with Protobuf 6.0+, you also need `libabsl-dev` (Linux) or `abseil` (macOS).\n\n## 🧩 Clone the Repository\n\nMake sure to initialize the Rust submodule (`client-sdk-rust`):\n\n```bash\n# Option 1: Clone with submodules in one step\ngit clone --recurse-submodules https://github.com/livekit/client-sdk-cpp.git\n\n# Option 2: Clone first, then initialize submodules\ngit clone https://github.com/livekit/client-sdk-cpp.git\ncd client-sdk-cpp\ngit submodule update --init --recursive\n```\n\n## ⚙️ BUILD\n\n### Quick Build (Using Build Scripts)\n\n**Linux/macOS:**\n```bash\n./build.sh clean        # Clean CMake build artifacts\n./build.sh clean-all    # Deep clean (C++ + Rust + generated files)\n./build.sh debug        # Build Debug version\n./build.sh release      # Build Release version\n./build.sh verbose      # Verbose build output\n```\n**Windows**\n```bash\ncmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=\"$PWD/vcpkg/scripts/buildsystems/vcpkg.cmake\"  # Generate Makefiles in build folder\n# Build (Release or Debug)\ncmake --build build --config Release\n# or:\ncmake --build build --config Debug\n# Clean CMake build artifacts\nRemove-Item -Recurse -Force build\n```\nNote (Windows), This assumes vcpkg is checked out in the repo root at .\\vcpkg\\.\nYou must install protobuf via vcpkg (so CMake can find ProtobufConfig.cmake and protoc), for example:\n```bash\n.\\vcpkg\\vcpkg install protobuf:x64-windows\n```\n\n**Windows:**\n```powershell\n.\\build.cmd clean       # Clean CMake build artifacts\n.\\build.cmd clean-all   # Deep clean (C++ + Rust + generated files)\n.\\build.cmd debug       # Build Debug version\n.\\build.cmd release     # Build Release version\n.\\build.cmd verbose     # Verbose build output\n```\n\n### Advanced Build (Using CMake Presets)\n\nFor more control and platform-specific builds, see the detailed instructions in [README_BUILD.md](README_BUILD.md).\n\n**Prerequisites (Windows only):**\n- Set `VCPKG_ROOT` environment variable pointing to your vcpkg installation\n\n```powershell\n# Windows PowerShell\n$env:VCPKG_ROOT = \"C:\\path\\to\\vcpkg\"\n```\n\n**Prerequisites (Linux/macOS):**\n- Install system dependencies (see above)\n\n**Quick start:**\n```bash\n# Windows\ncmake --preset windows-release\ncmake --build --preset windows-release\n\n# Linux\ncmake --preset linux-release\ncmake --build --preset linux-release\n\n# macOS\ncmake --preset macos-release\ncmake --build --preset macos-release\n```\n\n📖 **For complete build instructions, troubleshooting, and platform-specific notes, see [README_BUILD.md](README_BUILD.md)**\n\n## 🧪 Run Example\n\n### Generate Tokens\nBefore running any participant, create JWT tokens with the proper identity and room name, example\n```bash\nlk token create -r test -i your_own_identity  --join --valid-for 99999h --dev --room=your_own_room\n```\n\n### SimpleRoom\n\n```bash\n./build/examples/SimpleRoom --url $URL --token \u003cjwt-token\u003e\n```\n\nYou can also provide the URL and token via environment variables:\n```bash\nexport LIVEKIT_URL=ws://localhost:7880\nexport LIVEKIT_TOKEN=\u003cjwt-token\u003e\n./build/examples/SimpleRoom\n```\n\n**End-to-End Encryption (E2EE)**\nYou can enable E2E encryption for the streams via --enable_e2ee and --e2ee_key flags,\nby running the following cmds in two terminals or computers. **Note, jwt_token needs to be different identity**\n```bash\n./build/examples/SimpleRoom --url $URL --token \u003cjwt-token\u003e --enable_e2ee --e2ee_key=\"your_key\"\n```\n**Note**, **all participants must use the exact same E2EE configuration and shared key.**\nIf the E2EE keys do not match between participants:\n- Media cannot be decrypted\n- Video tracks will appear as a black screen\n- Audio will be silent\n- No explicit error may be shown at the UI level\n\nPress Ctrl-C to exit the example.\n\n### SimpleRpc\nThe SimpleRpc example demonstrates how to:\n- Connect multiple participants to the same LiveKit room\n- Register RPC handlers (e.g., arrival, square-root, divide, long-calculation)\n- Send RPC requests from one participant to another\n- Handle success, application errors, unsupported methods, and timeouts\n- Observe round-trip times (RTT) for each RPC call\n\n#### 🔑 Generate Tokens\nBefore running any participant, create JWT tokens with **caller**, **greeter** and **math-genius** identities and room name.\n```bash\nlk token create -r test -i caller --join --valid-for 99999h --dev --room=your_own_room\nlk token create -r test -i greeter --join --valid-for 99999h --dev --room=your_own_room\nlk token create -r test -i math-genius --join --valid-for 99999h --dev --room=your_own_room\n```\n\n#### ▶ Start Participants\nEvery participant is run as a separate terminal process, note --role needs to match the token identity.\n```bash\n./build/examples/SimpleRpc --url $URL --token \u003cjwt-token\u003e --role=math-genius\n```\nThe caller will automatically:\n- Wait for the greeter and math-genius to join\n- Perform RPC calls\n- Print round-trip times\n- Annotate expected successes or expected failures\n\n### SimpleDataStream\n- The SimpleDataStream example demonstrates how to:\n- Connect multiple participants to the same LiveKit room\n- Register text stream and byte stream handlers by topic (e.g. \"chat\", \"files\")\n- Send a text stream (chat message) from one participant to another\n- Send a byte stream (file/image) from one participant to another\n- Attach custom stream metadata (e.g. sent_ms) via stream attributes\n- Measure and print one-way latency on the receiver using sender timestamps\n- Receive streamed chunks and reconstruct the full payload on the receiver\n\n#### 🔑 Generate Tokens\nBefore running any participant, create JWT tokens with caller and greeter identities and your room name.\n```bash\nlk token create -r test -i caller  --join --valid-for 99999h --dev --room=your_own_room\nlk token create -r test -i greeter --join --valid-for 99999h --dev --room=your_own_room\n```\n\n#### ▶ Start Participants\nStart the receiver first (so it registers stream handlers before messages arrive):\n```bash\n./build/examples/SimpleDataStream --url $URL --token \u003cjwt-token\u003e \n```\nOn another terminal or computer, start the sender\n```bash\n./build/examples/SimpleDataStream --url $URL --token \u003cjwt-token\u003e \n```\n\n**Sender** (e.g. greeter)\n- Waits for the peer, then sends a text stream (\"chat\") and a file stream (\"files\") with timestamps and metadata, logging stream IDs and send times.\n\n**Receiver** (e.g. caller)\n- Registers handlers for text and file streams, logs stream events, computes one-way latency, and saves the received file locally.\n\n\n##  🧰 Recommended Setup\n### macOS\n```bash\nbrew install cmake protobuf rust\n```\n\n### Ubuntu / Debian\n```bash\nsudo apt update\nsudo apt install -y cmake protobuf-compiler build-essential\ncurl https://sh.rustup.rs -sSf | sh\n```\n\n## 🛠️ Development Tips\n###  Update Rust version\n```bash\ncd client-sdk-cpp\ngit fetch origin\ngit switch -c try-rust-main origin/main\n\n# Sync submodule URLs and check out what origin/main pins (recursively):\ngit submodule sync --recursive\ngit submodule update --init --recursive --checkout\n\n# Now, in case the nested submodule under yuv-sys didn’t materialize, force it explicitly:\ncd ..\ngit -C client-sdk-rust/yuv-sys submodule sync --recursive\ngit -C client-sdk-rust/yuv-sys submodule update --init --recursive --checkout\n\n# Sanity check:\ngit submodule status --recursive\n```\n\n###  If yuv-sys fails to build\n```bash\ncargo clean -p yuv-sys\ncargo build -p yuv-sys -vv\n```\n\n### Full clean (Rust + C++ build folders)\nIn some cases, you may need to perform a full clean that deletes all build artifacts from both the Rust and C++ folders:\n```bash\n./build.sh clean-all\n```\n\n### Clang format\nCPP SDK is using clang C++ format\n```bash\nbrew install clang-format\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivekit%2Fclient-sdk-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flivekit%2Fclient-sdk-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivekit%2Fclient-sdk-cpp/lists"}