Supported browsers
The SRTC Web SDK supports mainstream desktop and mobile browsers:
Tip: We recommend that users use the latest version of Chrome for the best experience.
WeChat Mini Program
When you need audio and video in a WeChat Mini Program, we recommend embedding a page built with this Web SDK via the Mini Program’s <web-view>, rather than building a separate native Mini Program implementation. One Web codebase then covers both browsers and Mini Programs, features and future updates stay consistent, and maintenance cost is lowest.
Key points:
- The embedded page must be served over HTTPS, and its domain must be configured as a business domain in the Mini Program admin console and pass verification
- Pass parameters between the Mini Program and the embedded page through the
web-view communication mechanism; the channel name, token, and so on can be delivered via URL query
- The page runs in the WeChat in-app browser; on iOS 14.3 and above and on Android it can publish and receive normally. Only older systems below iOS 14.3 are limited by the system WebView and can only receive
URL protocol restrictions
WebRTC APIs restrict the page protocol. Choose the protocol that fits your deployment:
Installation
npm
CDN
For projects without a build tool, include the SDK directly in HTML with a <script> tag:
After loading from the CDN, the global variable SRTC is available directly.
Local download
- Download srtc.js and srtc.d.ts
- Copy both files into your project directory
Importing
ES Module (recommended, with npm)
Script tag (with CDN or local files)
Using with reactive frameworks
Don’t put the SRTC instance or the Channel returned by join() into deeply reactive containers such as Vue’s reactive() / ref() or Pinia state. The SDK relies on object identity comparisons in many places (channels, tracks, subscriptions); once the instance is proxied, these comparisons break, and they fail silently—the typical symptom is that you receive no channel events at all, with no error reported.
Store them with markRaw() or shallowRef: