npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

red5pro-conference-sdk

v1.0.3

Published

Red5 Pro Conference SDK

Readme

Red5 Pro Conference SDK

The Red5 Pro Conference SDK is a powerful, professional-grade toolkit for building multi-party video conferencing applications on the Red5 Pro platform. It handles room management, media streaming (WHIP/WHEP), WebRTC statistics, and advanced features like virtual backgrounds and local recording.

Table of Contents

Installation

Install the SDK via npm:

npm install red5pro-conference-sdk

Quick Start

import { ConferenceClient, ConferenceEvents } from 'red5pro-conference-sdk';

// 1. Configure the client
const config = {
  host: 'your-red5-pro-host',
  nodeGroup: 'your-node-group',
  iceServers: [{ urls: 'stun:stun.l.google.com:19302' }],
  pubnubPublishKey: 'your-pubnub-publish-key',
  pubnubSubscribeKey: 'your-pubnub-subscribe-key'
};

const client = new ConferenceClient(config);

// 2. Listen for events
client.on(ConferenceEvents.USER_PUBLISHED, (event) => {
  console.log('Successfully published to room:', event.streamName);
});

client.on(ConferenceEvents.NEW_PARTICIPANT, (participant) => {
  console.log('New participant joined:', participant.userId);
  // Auto-subscribe to the new participant
  client.subscribe(participant);
});

// 3. Join a room
const joinParams = {
  roomId: 'my-awesome-room',
  userId: 'user-' + Math.floor(Math.random() * 1000),
  token: 'your-auth-token',
  role: 'publisher',
  mediaStream: await navigator.mediaDevices.getUserMedia({ video: true, audio: true }),
  videoEnabled: true,
  audioEnabled: true
};

await client.join(
  joinParams.roomId,
  joinParams.userId,
  joinParams.token,
  joinParams.role,
  joinParams.mediaStream,
  joinParams.videoEnabled,
  joinParams.audioEnabled
);

Configuration

The ConferenceConfig object supports the following parameters:

| Parameter | Type | Description | |-----------|------|-------------| | host | string | Red5 Pro Server host address. | | nodeGroup | string | Optional node group for autoscaling. | | iceServers | RTCIceServer[] | Array of ICE servers for WebRTC. | | reconnectionEnabled | boolean | Enable automatic reconnection. Default: true. | | maxVideoBitrateKbps | number | Maximum video bitrate for publishing. | | pubnubPublishKey | string | PubNub Publish Key for chat/signaling. | | pubnubSubscribeKey | string | PubNub Subscribe Key for chat/signaling. |

Core API

Room Management

  • join(roomId, userId, token, role, mediaStream, ...): Join a conference room.
  • leave(): Disconnect and leave the room.

Media Controls

  • muteVideo() / unmuteVideo(): Control local camera.
  • muteAudio() / unmuteAudio(): Control local microphone.
  • switchVideoDeviceWithTrackReplacement(deviceId): Seamlessly switch cameras.

Publishing & Subscribing

  • subscribe(user): Start viewing a participant's stream.
  • unsubscribe(userId): Stop viewing a participant's stream.

Events

The SDK uses ConferenceEvents for all notifications.

import { ConferenceEvents } from 'red5pro-conference-sdk';

client.on(ConferenceEvents.ROOM_STATE_UPDATE, (state) => {
  console.log('Room users updated:', state.users);
});

client.on(ConferenceEvents.CHAT_MESSAGE, (message) => {
  console.log('New message:', message.text);
});

client.on(ConferenceEvents.ISSUES_DETECTED, (issues) => {
  console.warn('Network or WebRTC issues:', issues);
});

Advanced Features

Virtual Backgrounds

Requires @mediapipe/selfie_segmentation.

await client.initializeVirtualBackground();
await client.enableVirtualBackground('blur', { blurAmount: 10 });
// Types: 'none', 'blur', 'slight-blur', 'image', 'color'

Screen Sharing

await client.startScreenShare({
  includeAudio: true,
  metaData: { type: 'presentation' }
});
await client.stopScreenShare();

Local Recording

Records participant streams directly in the browser and creates a ZIP file.

// Enable local recording
const zip = await client.generateLocalRecordingZip();
// Download the recording
await client.downloadLocalRecording('my-conference-record');