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

@afosecure/meetingsdk

v1.6.0

Published

A modern, lightweight React SDK for building peer-to-peer video communication applications. Built on WebRTC with a clean, composable rust API.

Readme

📹 @afosecure/meetingsdk — React Video Meeting SDK

A modern, lightweight React SDK for building peer-to-peer video communication applications using WebRTC. Designed with a clean, composable API and reactive state management.


Features

  • WebRTC peer-to-peer video (no central media server required)
  • React Hooks API for seamless integration
  • Reactive state system for participants & streams
  • Lightweight core optimized for performance
  • Flexible WebSocket signaling backend support
  • Full TypeScript support

📦 Installation

npm install @afosecure/meetingsdk
# or
yarn add @afosecure/meetingsdk
# or
pnpm add @afosecure/meetingsdk

Quick Start

1. Initialize SDK

import { useState } from "react";
import {
  MeetingProvider,
  MeetingState,
  VideoSDKCore,
} from "@afosecure/meetingsdk";

function App() {
  const [core] = useState(
    () =>
      new VideoSDKCore({
        onTrack: (_, peerId) => {
          console.log("📹 Received stream from:", peerId);
        },
        onUserJoined: (participant) => {
          console.log("👤 User joined:", participant.name);
        },
        onUserLeft: (userId) => {
          console.log("👤 User left:", userId);
        },
      }),
  );

  return (
    <MeetingProvider core={core}>
      <VideoCall />
    </MeetingProvider>
  );
}

export default App;

2. Basic Video Call

import { useRef, useState } from "react";
import { useMeeting, useParticipants } from "@afosecure/meetingsdk";

function VideoCall() {
  const { join, startLocalStream, leave, localParticipant } = useMeeting();
  const participants = useParticipants();
  const localVideoRef = useRef<HTMLVideoElement>(null);

  const [roomId, setRoomId] = useState("");
  const [name, setName] = useState("");

  const handleJoin = async () => {
    if (!localVideoRef.current) return;

    await startLocalStream(localVideoRef.current, name);
    await join(roomId, name);
  };

  return (
    <div>
      {!localParticipant ? (
        <>
          <input value={name} onChange={(e) => setName(e.target.value)} />
          <input value={roomId} onChange={(e) => setRoomId(e.target.value)} />
          <button onClick={handleJoin}>Join Meeting</button>
        </>
      ) : (
        <>
          <video ref={localVideoRef} autoPlay muted />
          <button onClick={leave}>Leave</button>

          {participants.map((p) => (
            <div key={p.id}>{p.name}</div>
          ))}
        </>
      )}
    </div>
  );
}

Core Concepts

MeetingState

const state = new MeetingState();

state.getParticipants();

state.subscribe(() => {
  console.log("updated");
});

VideoSDKCore

const core = new VideoSDKCore(state, {
  onTrack: (stream, peerId) => {},
  onUserJoined: (p) => {},
  onUserLeft: (id) => {},
});

Hooks API

useMeeting()

const { join, startLocalStream, leave, localParticipant, meetingId } =
  useMeeting();

useParticipants()

const participants = useParticipants();

useRemoteVideo()

const ref = useRemoteVideo(participantId);

return <video ref={ref} autoPlay />;

useLocalStream()

const stream = useLocalStream();

useStreams()

const streams = useStreams();

Complete Example

export default function App() {
  const [state] = useState(() => new MeetingState());

  const [core] = useState(
    () =>
      new VideoSDKCore(state, {
        onTrack: () => {},
        onUserJoined: () => {},
        onUserLeft: () => {},
      }),
  );

  return (
    <MeetingProvider core={core}>
      <VideoCallContent />
    </MeetingProvider>
  );
}

Server Requirements

Your WebSocket server must support:

Client → Server

  • JOIN
  • OFFER
  • ANSWER
  • ICE

Server → Client

  • EXISTING_USERS
  • USER_JOINED
  • USER_LEFT

Performance Tips

  • Stop media tracks on leave
  • Memoize participant components
  • Use multiple STUN servers
  • Avoid re-rendering video elements

Browser Support

  • Chrome 54+
  • Firefox 55+
  • Safari 11+
  • Edge 79+

📄 License

MIT