{"id":24803921,"url":"https://github.com/livekit/rust-sdks","last_synced_at":"2026-05-18T22:01:17.732Z","repository":{"id":65438301,"uuid":"490045365","full_name":"livekit/rust-sdks","owner":"livekit","description":"LiveKit realtime and server SDKs for Rust","archived":false,"fork":false,"pushed_at":"2026-03-26T12:53:09.000Z","size":20870,"stargazers_count":404,"open_issues_count":68,"forks_count":156,"subscribers_count":20,"default_branch":"main","last_synced_at":"2026-03-26T16:51:03.268Z","etag":null,"topics":["bindings","crossplatform","libwebrtc","rust","webrtc"],"latest_commit_sha":null,"homepage":"https://livekit.io","language":"Assembly","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":"2022-05-08T20:14:31.000Z","updated_at":"2026-03-25T23:05:33.000Z","dependencies_parsed_at":"2026-01-27T05:02:52.068Z","dependency_job_id":null,"html_url":"https://github.com/livekit/rust-sdks","commit_stats":null,"previous_names":["livekit/rust-sdks","livekit/client-sdk-rust"],"tags_count":319,"template":false,"template_full_name":null,"purl":"pkg:github/livekit/rust-sdks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Frust-sdks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Frust-sdks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Frust-sdks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Frust-sdks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/livekit","download_url":"https://codeload.github.com/livekit/rust-sdks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/livekit%2Frust-sdks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31313846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["bindings","crossplatform","libwebrtc","rust","webrtc"],"created_at":"2025-01-30T06:13:55.230Z","updated_at":"2026-05-15T00:12:32.253Z","avatar_url":"https://github.com/livekit.png","language":"Assembly","funding_links":[],"categories":["Assembly"],"sub_categories":[],"readme":"\u003c!--BEGIN_BANNER_IMAGE--\u003e\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"/.github/banner_dark.png\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"/.github/banner_light.png\"\u003e\n  \u003cimg style=\"width:100%;\" alt=\"The LiveKit icon, the name of the repository and some sample code in the background.\" src=\"https://raw.githubusercontent.com/livekit/rust-sdks/main/.github/banner_light.png\"\u003e\n\u003c/picture\u003e\n\n\u003c!--END_BANNER_IMAGE--\u003e\n\n# 📹🎙️🦀 Rust Client SDK for LiveKit\n\n\u003c!--BEGIN_DESCRIPTION--\u003e\nUse this SDK to add realtime video, audio and data features to your Rust app. By connecting to \u003ca href=\"https://livekit.io/\"\u003eLiveKit\u003c/a\u003e Cloud or a self-hosted server, you can quickly build applications such as multi-modal AI, live streaming, or video calls with just a few lines of code.\n\u003c!--END_DESCRIPTION--\u003e\n\n[![crates.io](https://img.shields.io/crates/v/livekit.svg)](https://crates.io/crates/livekit)\n[![livekit docs.rs](https://img.shields.io/docsrs/livekit)](https://docs.rs/livekit/latest/)\n[![Builds](https://github.com/livekit/rust-sdks/actions/workflows/builds.yml/badge.svg?branch=main)](https://github.com/livekit/rust-sdks/actions/workflows/builds.yml)\n[![Tests](https://github.com/livekit/rust-sdks/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/livekit/rust-sdks/actions/workflows/tests.yml)\n\n## Features\n\n- [x] Receiving tracks\n- [x] Publishing tracks\n- [x] Data channels\n- [x] Simulcast\n- [x] SVC codecs (AV1/VP9)\n- [ ] Adaptive Streaming\n- [ ] Dynacast\n- [x] Hardware video enc/dec\n  - [x] H.264, H.265 using VideoToolbox (MacOS/iOS)\n  - [x] H.264, H.265 on NVidia discrete GPUs (Linux)\n  - [x] H.264, H.265 on AMD CPUs \u0026 GPUs (Linux)\n  - [ ] H.264, H.265 on NVidia Jetson (Linux)\n- Supported Platforms\n  - [x] Windows\n  - [x] MacOS\n  - [x] Linux\n  - [x] iOS\n  - [x] Android\n\n## Crates\n\n- `livekit-api`: Server APIs and auth token generation\n- `livekit`: LiveKit real-time SDK\n- `livekit-ffi`: Internal crate, used to generate bindings for other languages\n- `livekit-protocol`: LiveKit protocol generated code\n\nWhen adding the SDK as a dependency to your project, make sure to add the\n[necessary `rustflags`](https://github.com/livekit/rust-sdks/blob/main/.cargo/config.toml)\nto your cargo config, otherwise linking may fail.\n\nAlso, please refer to the list of the [supported platform toolkits](https://github.com/livekit/rust-sdks/blob/main/.github/workflows/builds.yml).\n\n## Getting started\n\nCurrently, Tokio is required to use this SDK, however we plan to make the async executor runtime agnostic.\n\n## Using Server API\n\n### Generating an access token\n\n```rust\nuse livekit_api::access_token;\nuse std::env;\n\nfn create_token() -\u003e Result\u003cString, access_token::AccessTokenError\u003e {\n    let api_key = env::var(\"LIVEKIT_API_KEY\").expect(\"LIVEKIT_API_KEY is not set\");\n    let api_secret = env::var(\"LIVEKIT_API_SECRET\").expect(\"LIVEKIT_API_SECRET is not set\");\n\n    let token = access_token::AccessToken::with_api_key(\u0026api_key, \u0026api_secret)\n        .with_identity(\"rust-bot\")\n        .with_name(\"Rust Bot\")\n        .with_grants(access_token::VideoGrants {\n             room_join: true,\n             room: \"my-room\".to_string(),\n             ..Default::default()\n        })\n        .to_jwt();\n    return token\n}\n```\n\n### Creating a room with RoomService API\n\n```rust\nuse livekit_api::services::room::{CreateRoomOptions, RoomClient};\n\n#[tokio::main]\nasync fn main() {\n    let room_service = RoomClient::new(\"http://localhost:7880\").unwrap();\n\n    let room = room_service\n        .create_room(\"my_room\", CreateRoomOptions::default())\n        .await\n        .unwrap();\n\n    println!(\"Created room: {:?}\", room);\n}\n```\n\n## Using Real-time SDK\n\n### Connect to a Room and listen for events:\n\n```rust\nuse livekit::prelude::*;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c()\u003e {\n    let (room, mut room_events) = Room::connect(\u0026url, \u0026token).await?;\n\n    while let Some(event) = room_events.recv().await {\n        match event {\n            RoomEvent::TrackSubscribed { track, publication, participant } =\u003e {\n                // ...\n            }\n            _ =\u003e {}\n        }\n    }\n\n    Ok(())\n}\n```\n\n### Receive video frames of a subscribed track\n\n```rust\n...\nuse futures::StreamExt; // this trait is required for iterating on audio \u0026 video frames\nuse livekit::prelude::*;\n\nmatch event {\n    RoomEvent::TrackSubscribed { track, publication, participant } =\u003e {\n        match track {\n            RemoteTrack::Audio(audio_track) =\u003e {\n                let rtc_track = audio_track.rtc_track();\n                let mut audio_stream = NativeAudioStream::new(rtc_track);\n                tokio::spawn(async move {\n                    // Receive the audio frames in a new task\n                    while let Some(audio_frame) = audio_stream.next().await {\n                        log::info!(\"received audio frame - {audio_frame:#?}\");\n                    }\n                });\n            },\n            RemoteTrack::Video(video_track) =\u003e {\n                let rtc_track = video_track.rtc_track();\n                let mut video_stream = NativeVideoStream::new(rtc_track);\n                tokio::spawn(async move {\n                    // Receive the video frames in a new task\n                    while let Some(video_frame) = video_stream.next().await {\n                        log::info!(\"received video frame - {video_frame:#?}\");\n                    }\n                });\n            },\n        }\n    },\n    _ =\u003e {}\n}\n```\n\n## Examples\n\n![](https://github.com/livekit/rust-sdks/blob/main/examples/images/simple-room-demo.gif)\n\n- [basic room](https://github.com/livekit/rust-sdks/tree/main/examples/basic_room): simple example connecting to a room.\n- [wgpu_room](https://github.com/livekit/rust-sdks/tree/main/examples/wgpu_room): complete example app with video rendering using wgpu and egui.\n- [mobile](https://github.com/livekit/rust-sdks/tree/main/examples/mobile): mobile app targeting iOS and Android\n- [play_from_disk](https://github.com/livekit/rust-sdks/tree/main/examples/play_from_disk): publish audio from a wav file\n- [save_to_disk](https://github.com/livekit/rust-sdks/tree/main/examples/save_to_disk): save received audio to a wav file\n\n## Building\n\n### MacOS\n\nWhen building on MacOS, `-ObjC` linker flag is needed. LiveKit's WebRTC implementation make use of ObjectiveC libraries on the Mac. You may get the following error if the app isn't linked with ObjC:\n\n```\n*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RTCVideoCodecInfo nativeSdpVideoFormat]: unrecognized selector sent to instance 0x600003bc6660'\n```\n\n## Environment variables\n\n### `LIVEKIT_PREFERRED_HW_ENCODER`\n\nOn Linux builds that include support for multiple hardware video encoders (NVENC and VAAPI), this variable selects which one is preferred when both are available at runtime. Accepted values:\n\n- `nvenc` — prefer the NVIDIA NVENC encoder.\n- `vaapi` — prefer the VAAPI encoder.\n\nIf unset (the default), NVENC is preferred. If the requested encoder is not supported or not compiled in, the SDK logs a warning and falls back to the other available hardware encoder (or software encoders). Any other value is ignored with a warning.\n\n## Motivation and Design Goals\n\nLiveKit aims to provide an open source, end-to-end WebRTC stack that works everywhere. We have two goals in mind with this SDK:\n\n1. Build a standalone, cross-platform LiveKit client SDK for Rustaceans.\n2. Build a common core for other platform-specific SDKs (e.g. Unity, Unreal, iOS, Android)\n\nRegarding (2), we've already developed a number of [client SDKs](https://github.com/livekit?q=client-sdk\u0026type=all) for several platforms and encountered a few challenges in the process:\n\n- There's a significant amount of business/control logic in our signaling protocol and WebRTC. Currently, this logic needs to be implemented in every new platform we support.\n- Interactions with media devices and encoding/decoding are specific to each platform and framework.\n- For multi-platform frameworks (e.g. Unity, Flutter, React Native), the aforementioned tasks proved to be extremely painful.\n\nThus, we posited a Rust SDK, something we wanted build anyway, encapsulating all our business logic and platform-specific APIs into a clean set of abstractions, could also serve as the foundation for our other SDKs!\n\nWe'll first use it as a basis for our Unity SDK (under development), but over time, it will power our other SDKs, as well.\n\n\u003c!--BEGIN_REPO_NAV--\u003e\n\u003cbr/\u003e\u003ctable\u003e\n\u003cthead\u003e\u003ctr\u003e\u003cth colspan=\"2\"\u003eLiveKit Ecosystem\u003c/th\u003e\u003c/tr\u003e\u003c/thead\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\u003ctd\u003eAgents SDKs\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://github.com/livekit/agents\"\u003ePython\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/agents-js\"\u003eNode.js\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eLiveKit SDKs\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://github.com/livekit/client-sdk-js\"\u003eBrowser\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-swift\"\u003eSwift\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-android\"\u003eAndroid\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-flutter\"\u003eFlutter\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-react-native\"\u003eReact Native\u003c/a\u003e · \u003cb\u003eRust\u003c/b\u003e · \u003ca href=\"https://github.com/livekit/node-sdks\"\u003eNode.js\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/python-sdks\"\u003ePython\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-unity\"\u003eUnity\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-unity-web\"\u003eUnity (WebGL)\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-esp32\"\u003eESP32\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/client-sdk-cpp\"\u003eC++\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eStarter Apps\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://github.com/livekit-examples/agent-starter-python\"\u003ePython Agent\u003c/a\u003e · \u003ca href=\"https://github.com/livekit-examples/agent-starter-node\"\u003eTypeScript Agent\u003c/a\u003e · \u003ca href=\"https://github.com/livekit-examples/agent-starter-react\"\u003eReact App\u003c/a\u003e · \u003ca href=\"https://github.com/livekit-examples/agent-starter-swift\"\u003eSwiftUI App\u003c/a\u003e · \u003ca href=\"https://github.com/livekit-examples/agent-starter-android\"\u003eAndroid App\u003c/a\u003e · \u003ca href=\"https://github.com/livekit-examples/agent-starter-flutter\"\u003eFlutter App\u003c/a\u003e · \u003ca href=\"https://github.com/livekit-examples/agent-starter-react-native\"\u003eReact Native App\u003c/a\u003e · \u003ca href=\"https://github.com/livekit-examples/agent-starter-embed\"\u003eWeb Embed\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eUI Components\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://github.com/livekit/components-js\"\u003eReact\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/components-android\"\u003eAndroid Compose\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/components-swift\"\u003eSwiftUI\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/components-flutter\"\u003eFlutter\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eServer APIs\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://github.com/livekit/node-sdks\"\u003eNode.js\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/server-sdk-go\"\u003eGolang\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/server-sdk-ruby\"\u003eRuby\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/server-sdk-kotlin\"\u003eJava/Kotlin\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/python-sdks\"\u003ePython\u003c/a\u003e · \u003cb\u003eRust\u003c/b\u003e · \u003ca href=\"https://github.com/agence104/livekit-server-sdk-php\"\u003ePHP (community)\u003c/a\u003e · \u003ca href=\"https://github.com/pabloFuente/livekit-server-sdk-dotnet\"\u003e.NET (community)\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eResources\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://docs.livekit.io\"\u003eDocs\u003c/a\u003e · \u003ca href=\"https://docs.livekit.io/mcp\"\u003eDocs MCP Server\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/livekit-cli\"\u003eCLI\u003c/a\u003e · \u003ca href=\"https://cloud.livekit.io\"\u003eLiveKit Cloud\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eLiveKit Server OSS\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://github.com/livekit/livekit\"\u003eLiveKit server\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/egress\"\u003eEgress\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/ingress\"\u003eIngress\u003c/a\u003e · \u003ca href=\"https://github.com/livekit/sip\"\u003eSIP\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003eCommunity\u003c/td\u003e\u003ctd\u003e\u003ca href=\"https://community.livekit.io\"\u003eDeveloper Community\u003c/a\u003e · \u003ca href=\"https://livekit.io/join-slack\"\u003eSlack\u003c/a\u003e · \u003ca href=\"https://x.com/livekit\"\u003eX\u003c/a\u003e · \u003ca href=\"https://www.youtube.com/@livekit_io\"\u003eYouTube\u003c/a\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003c!--END_REPO_NAV--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivekit%2Frust-sdks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flivekit%2Frust-sdks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flivekit%2Frust-sdks/lists"}