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

origx-cloud-sdk

v1.1.2

Published

Complete developer-first WebRTC client SDK for Origx Cloud calling rooms

Readme

Origx Cloud Client SDK

The developer-first, lightweight WebRTC client SDK for integrating Audio and Video calling into modern web applications using Origx Cloud.

Version: 1.1.2

Installation

npm install origx-cloud-sdk

Quick Start

1. Initialize and Join a Room

Generate a secure token on your backend using your Application Secret Key, then connect:

import { OrigxCloud } from "origx-cloud-sdk";

const rtc = new OrigxCloud({
  appId: "your_application_id",
  token: "secure_token_from_your_backend",
  channelName: "lobby-room-101",
  uid: "user-42"
});

await rtc.join();

2. Capture and Render Media

// Request camera + microphone access
const localStream = await rtc.getLocalStream(true, true);

// Render local video
document.getElementById("local-video").srcObject = localStream;

// Render incoming peer video
rtc.on("track", (remoteUid, remoteStream, track) => {
  document.getElementById("remote-video").srcObject = remoteStream;
});

3. Mute Controls

Muting automatically notifies all peers in the room — no extra code needed.

// Microphone
rtc.muteAudio(true);   // mute
rtc.muteAudio(false);  // unmute

// Camera
rtc.muteVideo(true);   // camera off
rtc.muteVideo(false);  // camera on

4. React to Peer Mute State

Listen for the peerState event to know when a remote participant mutes or turns off their camera:

rtc.on("peerState", (uid, state) => {
  if (state.audioMuted) {
    showMuteIcon(uid);
  }
  if (state.videoMuted) {
    showCameraOffPlaceholder(uid);
  }
});

5. Video Effects (Filters)

Apply real-time visual filters to your outgoing video stream. The effect is processed via canvas and sent to peers using RTCRtpSender.replaceTrack().

Available effects: none, blur, grayscale, sepia, vintage, invert, cool, warm

// Apply a filter — returns the processed MediaStream for local preview
const effectStream = await rtc.applyEffect("sepia");
document.getElementById("local-video").srcObject = effectStream;

// Remove the filter and restore original camera
await rtc.removeEffect();
document.getElementById("local-video").srcObject = rtc.localStream;

// Check what effect is currently active
const current = rtc.getActiveEffect(); // "sepia" | "none" | null

6. Disconnect

Cleanly closes all peer connections, stops media tracks, and cancels any active effect loop:

rtc.leave();

SDK Events

| Event | Arguments | Description | |---|---|---| | joined | (channelName, uid) | Successfully connected to the channel | | userJoined | (uid) | A remote participant joined | | userLeft | (uid) | A remote participant disconnected | | track | (uid, stream, track) | Received an incoming media track | | peerState | (uid, { audioMuted, videoMuted }) | Peer toggled mute or camera | | audioMuted | (uid) | Peer muted their microphone | | audioUnmuted | (uid) | Peer unmuted their microphone | | videoStopped | (uid) | Peer turned off their camera | | videoStarted | (uid) | Peer turned on their camera | | disconnected | — | WebSocket signaling disconnected | | error | (Error) | An RTC or signaling error occurred |

Example

rtc.on("joined", (channelName, uid) => {
  console.log(`Connected to ${channelName} as ${uid}`);
});

rtc.on("userJoined", (uid) => {
  console.log(`Peer ${uid} joined`);
});

rtc.on("userLeft", (uid) => {
  console.log(`Peer ${uid} left`);
  // Clean up their video element
});

rtc.on("peerState", (uid, state) => {
  if (state.audioMuted !== undefined) {
    toggleMuteUI(uid, state.audioMuted);
  }
  if (state.videoMuted !== undefined) {
    toggleCameraUI(uid, state.videoMuted);
  }
});

rtc.on("error", (err) => {
  console.error("RTC error:", err.message);
});

rtc.on("disconnected", () => {
  console.log("Signaling disconnected");
});

API Reference

new OrigxCloud(config)

| Option | Type | Required | Description | |---|---|---|---| | appId | string | ✅ | Your Origx application ID | | token | string | ✅ | Signed JWT token from your backend | | channelName | string | ✅ | Room/channel identifier | | uid | string | ✅ | Unique user identifier |

Methods

| Method | Returns | Description | |---|---|---| | join() | Promise<void> | Connect to the signaling server and join the room | | leave() | void | Disconnect, stop tracks, clean up | | getLocalStream(audio, video) | Promise<MediaStream> | Request camera/mic access | | muteAudio(mute: boolean) | void | Toggle mic; notifies peers automatically | | muteVideo(mute: boolean) | void | Toggle camera; notifies peers automatically | | applyEffect(name: string) | Promise<MediaStream> | Apply a live video filter; returns processed stream | | removeEffect() | Promise<void> | Remove filter, restore original camera track to peers | | getActiveEffect() | string \| null | Returns the currently active effect name | | on(event, callback) | void | Subscribe to an event | | off(event, callback) | void | Unsubscribe from an event |