Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
twilio-video
Advanced tools
twilio-video.js allows you to add real-time voice and video to your web apps.
Note that this is a beta release. You may encounter bugs and instability, and the APIs available in this release may change in subsequent releases.
We want your feedback! Email Rob Brazier, Product Manager for Programmable Video at rbrazier@twilio.com with suggested improvements, feature requests and general feedback. If you need technical support, contact help@twilio.com.
npm install twilio-video@beta --save
Using this method, you can require
twilio-video.js like so:
const Video = require('twilio-video');
Until we release twilio-video.js 1.0.0 proper, you must specify a specific pre-release. For example,
bower install twilio-video#1.0.0-beta6 --save
Releases of twilio-video.js are hosted on a CDN, and you can include these directly in your web app using a <script> tag.
<script src="//media.twiliocdn.com/sdk/js/video/releases/1.0.0-beta6/twilio-video.min.js"></script>
Using this method, twilio-video.js will set a browser global:
const Video = Twilio.Video;
The following is a simple example showing a Client connecting to a Room. For more information, refer to the API Docs.
const Video = require('twilio-video');
Video.connect('$TOKEN', { name: 'room-name' }).then(room => {
console.log('Connected to Room "%s"', room.name);
room.participants.forEach(participantConnected);
room.on('participantConnected', participantConnected);
room.on('participantDisconnected', participantDisconnected);
room.once('disconnected', error => room.participants.forEach(participantDisconnected));
});
function participantConnected(participant) {
console.log('Participant "%s" connected', participant.identity);
const div = document.createElement('div');
div.id = participant.sid;
div.innerText = participant.identity;
participant.on('trackAdded', track => trackAdded(div, track));
participant.tracks.forEach(track => trackAdded(div, track));
participant.on('trackRemoved', trackRemoved);
document.body.appendChild(div);
}
function participantDisconnected(participant) {
console.log('Participant "%s" disconnected', participant.identity);
participant.tracks.forEach(trackRemoved);
document.getElementById(participant.sid).remove();
}
function trackAdded(div, track) {
div.appendChild(track.attach());
}
function trackRemoved(track) {
track.detach().forEach(element => element.remove());
}
See CHANGELOG.md.
See LICENSE.md.
Fork and clone the repository. Then, install dependencies with
npm install
Then run the build
script:
npm run build
The builds and docs will be placed in the dist/
directory.
Bug fixes welcome! If you're not familiar with the GitHub pull request/contribution process, this is a nice tutorial.
FAQs
Twilio Video JavaScript Library
The npm package twilio-video receives a total of 94,949 weekly downloads. As such, twilio-video popularity was classified as popular.
We found that twilio-video demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.