openrtc-react
v3.0.0
Published
Explicit-owner React contexts and passive hooks for OpenRTC capabilities.
Readme
openrtc-react
Optional React bindings for explicitly owned OpenRTC clients and capabilities. This package is staged locally; registry publishing follows the agreed release.
<OpenRTCProvider client={workspace.client}>
<CapabilityProvider capability={activeSession.ticket}>
<Participants />
</CapabilityProvider>
</OpenRTCProvider>useOpenRTC() and useCapability() return the supplied owners. usePeers() and
useConnectionMetrics() subscribe to public capability projections using
useSyncExternalStore. Metrics are observed and measured by OpenRTC itself.
Providers never allocate, start, join, dial, retry or close a client/capability. Unmount unsubscribes observers only. The workspace closes its root client at shutdown or authentication-authority replacement; each session explicitly closes its capability at final disposal. A null capability produces empty snapshots. Switching capabilities immediately fences the old projection; late callbacks from unsubscribed generations are ignored. Works with browser, Node and native public owners; native apps should retain one root client per WebView.
