
Security News
Package Maintainers Call for Improvements to GitHub’s New npm Security Plan
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
@livekit/egress-sdk
Advanced tools
This lightweight SDK makes it simple to build your own Room Composite templates.
LiveKit uses an instance of headless Chrome to composite the room. This means you can use the same application code to design an interactive experience that's livestreamed or recorded.
The general flow of events are as follows:
Egress.StartRoomCompositeEgress
request to LiveKit<baseurl>?url=<>&template=<>&token=<>
START_RECORDING
to recordEND_RECORDING
to terminate the streamYour webapp will need to connect to a LiveKit room using the token provided. This mechanism provides authentication to your application as well as giving you information about the current room that's to be recorded.
This template SDK takes care of communicating with Egress recorder, performing the following:
yarn add @livekit/egress-sdk
import EgressHelper from '@livekit/egress-sdk'
import { Room } from 'livekit-client'
const room = new Room({
adaptiveStream: true,
})
// as soon as room is connected, notify egress helper so it can listen to events
// when autoEnd is set, recording will stop when all participants have left.
EgressHelper.setRoom(room, {
autoEnd: true,
})
// advanced feature, if you'd like your recording to switch between different
// layouts programmatically using EgressService.UpdateLayout, those changes
// can be handled here
EgressHelper.onLayoutChanged((layout) => {
})
// connect to the room, and render your application UI as usual
// EgressHelper provides URL and token that are passed in by Egress Service
await room.connect(
EgressHelper.getLiveKitURL(),
EgressHelper.getAccessToken(),
);
// as soon as your application is set up and ready, call this API to start recording
EgressHelper.startRecording();
We provide a few default templates/layouts here. It should serve as a good guide for creating your own templates.
In order to speed up the development cycle of your recording templates, we provide a convenient utility in livekit-cli. test-egress-template
will spin up a few virtual publishers, and then simulate them joining your room. It'll also point a browser instance to your local template, with the correct URL parameters filled in.
Here's an example:
livekit-cli test-egress-template
--base-url http://localhost:3000 \
--url <livekit-instance>
--api-key <key>
--api-secret <secret>
--room <your-room> --layout <your-layout> --publishers 3
This command will launch a browser pointed at http://localhost:3000
, while simulating 3 publishers publishing to your livekit instance.
FAQs
A lightweight SDK for developing RoomComposite templates
The npm package @livekit/egress-sdk receives a total of 4,855 weekly downloads. As such, @livekit/egress-sdk popularity was classified as popular.
We found that @livekit/egress-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 29 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
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.