Gathering detailed insights and metrics for @twilio/webrtc
Gathering detailed insights and metrics for @twilio/webrtc
Gathering detailed insights and metrics for @twilio/webrtc
Gathering detailed insights and metrics for @twilio/webrtc
WebRTC-related APIs and shims used by twilio-video.js
npm install @twilio/webrtc
Typescript
Module System
Node Version
NPM Version
JavaScript (99.34%)
Shell (0.66%)
Total Downloads
12,593,183
Last Day
135
Last Week
7,730
Last Month
34,007
Last Year
579,478
NOASSERTION License
49 Stars
1,652 Commits
18 Forks
25 Watchers
15 Branches
22 Contributors
Updated on Feb 11, 2025
Minified
Minified + Gzipped
Latest Version
4.6.0
Package Id
@twilio/webrtc@4.6.0
Unpacked Size
136.67 kB
Size
31.82 kB
File Count
28
NPM Version
8.3.1
Node Version
16.14.0
Cumulative downloads
Total Downloads
Last Day
-10.6%
135
Compared to previous day
Last Week
-13.2%
7,730
Compared to previous week
Last Month
-15.1%
34,007
Compared to previous month
Last Year
-52.8%
579,478
Compared to previous year
24
twilio-webrtc.js contains the various WebRTC shims used by twilio-video.js. It is not intended for general consumption.
npm install --save @twilio/webrtc
The following WebRTC API shims are available:
1const { 2 getStats, 3 getUserMedia, 4 MediaStream, 5 MediaStreamTrack, 6 RTCIceCandidate, 7 RTCPeerConnection, 8 RTCSessionDescription 9} = require('@twilio/webrtc');
getStats
resolves with normalized WebRTC statistics for the active ICE
candidate pair and each MediaStreamTrack
, local or remote, of a particular
RTCPeerConnection
.
1/** 2 * Get the statistics for a given RTCPeerConnection. 3 * @param {RTCPeerConnection} peerConnection 4 * @returns {Promise<StandardizedStatsResponse>} 5 */ 6function getStats(peerConnection) {}
NOTE: StandardizedStatsResponse
normalizes the different formats of the stats returned by RTCPeerConnection#getStats
in different
browsers. It does not conform to the W3C spec.
getUserMedia
accepts a MediaStreamConstraints
object and resolves
with a MediaStream
. By default, it requests both audio and video.
1/** 2 * Request media from the user. 3 * @param {MediaStreamConstraints} [constraints={audio: true, video: true}] 4 * @returns {Promise<MediaStream>} 5 */ 6function getUserMedia(constraints) {}
RTCPeerConnection
abstracts away some of the browser-specific implementations
of WebRTC, and implements some WebRTC features that are not present in some
browsers.
MediaStreamTrack
changes, the
browser treats this as a removal of the existing MediaStreamTrack
and the addition of a new
MediaStreamTrack
.maxPacketLifeTime
on RTCDataChannels by
remapping the legacy property maxRetransmitTime
to maxPacketLifeTime
. See
this bug for
more information.removeTrack
with an RTCRtpSender
that is not created by the RTCPeerConnection
in question throws an exception.setLocalDescription
and setRemoteDescription
in
have-local-offer
and have-remote-offer
signaling states respectively.createOffer
in signaling state have-local-offer
.RTCPeerConnection.prototype.peerIdentity
is accessed.MediaStreamTrack
changes, the
browser treats this as a removal of the existing MediaStreamTrack
and the addition of a new
MediaStreamTrack
.addTrack
method does not return the RTCRtpSender
associated with the added track.RTCSessionDescription
abstracts away some of the browser-specific implementations
of WebRTC for Firefox and Safari, and works around this bug
in Chrome, where the native RTCSessionDescription
constructor throws when its argument is
{ type: 'rollback'}
.
MediaStream
, MediaStreamTrack
, and RTCIceCandidate
abstracts away their
browser-prefixed counterparts for earlier browser versions.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 11/30 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More