| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
This SDK enables native C++ applications to connect to LiveKit servers for real-time audio/video communication.
Make sure to initialize the Rust submodule (client-sdk-rust):
# Option 1: Clone with submodules in one step
git clone --recurse-submodules https://github.com/livekit/client-sdk-cpp.git
# Option 2: Clone first, then initialize submodules
git clone https://github.com/livekit/client-sdk-cpp.git
cd client-sdk-cpp
git submodule update --init --recursiveAll build actions are managed by the provided build.sh script.
./build.sh clean # Clean CMake build artifacts
./build.sh clean-all # Deep clean (C++ + Rust + generated files)
./build.sh debug # Build Debug version
./build.sh release # Build Release version
./build.sh verbose # Verbose build outputBefore running any participant, create JWT tokens with the proper identity and room name, example
lk token create -r test -i your_own_identity --join --valid-for 99999h --dev --room=your_own_room./build/examples/SimpleRoom --url $URL --token <jwt-token>You can also provide the URL and token via environment variables:
export LIVEKIT_URL=ws://localhost:7880
export LIVEKIT_TOKEN=<jwt-token>
./build/examples/SimpleRoomEnd-to-End Encryption (E2EE) You can enable E2E encryption for the streams via --enable_e2ee and --e2ee_key flags, by running the following cmds in two terminals or computers. Note, jwt_token needs to be different identity
./build/examples/SimpleRoom --url $URL --token <jwt-token> --enable_e2ee --e2ee_key="your_key"Note, all participants must use the exact same E2EE configuration and shared key. If the E2EE keys do not match between participants:
Press Ctrl-C to exit the example.
The SimpleRpc example demonstrates how to:
Before running any participant, create JWT tokens with caller, greeter and math-genius identities and room name.
lk token create -r test -i caller --join --valid-for 99999h --dev --room=your_own_room
lk token create -r test -i greeter --join --valid-for 99999h --dev --room=your_own_room
lk token create -r test -i math-genius --join --valid-for 99999h --dev --room=your_own_roomEvery participant is run as a separate terminal process, note --role needs to match the token identity.
./build/examples/SimpleRpc --url $URL --token <jwt-token> --role=math-geniusThe caller will automatically:
Before running any participant, create JWT tokens with caller and greeter identities and your room name.
lk token create -r test -i caller --join --valid-for 99999h --dev --room=your_own_room
lk token create -r test -i greeter --join --valid-for 99999h --dev --room=your_own_roomStart the receiver first (so it registers stream handlers before messages arrive):
./build/examples/SimpleDataStream --url $URL --token <jwt-token> On another terminal or computer, start the sender
./build/examples/SimpleDataStream --url $URL --token <jwt-token> Sender (e.g. greeter)
Receiver (e.g. caller)
brew install cmake protobuf rustsudo apt update
sudo apt install -y cmake protobuf-compiler build-essential
curl https://sh.rustup.rs -sSf | shcd client-sdk-cpp
git fetch origin
git switch -c try-rust-main origin/main
# Sync submodule URLs and check out what origin/main pins (recursively):
git submodule sync --recursive
git submodule update --init --recursive --checkout
# Now, in case the nested submodule under yuv-sys didn’t materialize, force it explicitly:
cd ..
git -C client-sdk-rust/yuv-sys submodule sync --recursive
git -C client-sdk-rust/yuv-sys submodule update --init --recursive --checkout
# Sanity check:
git submodule status --recursivecargo clean -p yuv-sys
cargo build -p yuv-sys -vvIn some cases, you may need to perform a full clean that deletes all build artifacts from both the Rust and C++ folders:
./build.sh clean-allCPP SDK is using clang C++ format
brew install clang-format| Back | FazBrowse Home | New Git URL |