openrtc-tauri
v2.9.7
Published
First-party Tauri adapter package for OpenRTC native runtimes.
Downloads
3,708
Readme
openrtc-tauri
First-party Tauri adapter package for openrtc.
Use this package with OpenRTC(...) or a native IPC runtime in a
Tauri desktop or mobile application.
This package pairs with the first-party Rust crate openrtc-tauri-plugin. The
TypeScript bridge invokes only the registered plugin command namespace
(plugin:openrtc-tauri-plugin|...). It does not probe legacy plugin namespaces
or bare Tauri commands. Without the Rust plugin, OpenRTC.native(...) fails
closed by design instead of silently selecting another lifecycle owner.
Install
pnpm add openrtc openrtc-tauri @tauri-apps/apiIn your Tauri Rust crate:
[dependencies]
# Use the published crate after the native release path is cut.
# Until then, workspace consumers may use a path dependency.
openrtc-tauri-plugin = "2.5.0"tauri::Builder::default()
.plugin(openrtc_tauri_plugin::init_from_env())
.run(tauri::generate_context!())?;Usage
import { OpenRTC } from 'openrtc';
import { createBridge } from 'openrtc-tauri/ipc';
const client = OpenRTC.native({
apiKey: 'pk_live_...',
auth: {
getAssertion: ({ forceRefresh }) => appAuth.openRtcAssertion({ forceRefresh }),
},
}, createBridge());The package root and openrtc-tauri/ipc expose the same lightweight bridge.
Connection, authentication, capability, and retry behavior remains in the
OpenRTC client and Rust plugin rather than a second Tauri adapter.
Rust Plugin
openrtc-tauri-plugin owns the native lifecycle surface for Tauri apps:
- provider-neutral
openrtc::client::Clientconstruction from an API key and avenue-scoped grant provider - current identity/grant relay without Firebase project configuration
- native device identity, Iroh startup, endpoint tickets, presence, auto-connect, connection state, device/session subscriptions, and peer streams
Product apps should install the plugin instead of copying rtc_commands.rs from
another application. App-specific commands can live beside it, but OpenRTC
connection lifecycle and device discovery should remain in the plugin/runtime.
File paths, transfer queues/history, bucket sharing, drive grants, and other
product commands must remain beside the plugin in the consumer host. Route
reusable file bytes through named peer channels or the optional
openrtc-file-transfer package; do not add product send_file commands to this
plugin's permission surface.
The TypeScript package is publish-ready and depends on the public openrtc npm
package. The Rust plugin still depends on the OpenRTC Rust crate release path:
publish openrtc and openrtc-tauri-plugin crates together before documenting
native Tauri as fully standalone for external apps.
Tauri Permissions
Add the plugin default permission set to the app capability that owns your OpenRTC WebView:
{
"permissions": ["openrtc-tauri-plugin:default"]
}Messages such as desktop_set_pluto_auth_token not allowed or
list_rtc_connection_states not allowed. Plugin not found mean the Rust plugin
is not registered under openrtc-tauri-plugin or the capability is missing the
default permission set. Auth relay commands are required for native managed
sessions that use scoped tokens; connection-state replay is optional telemetry
and OpenRTC will continue without it.
