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

@2stars/video-react

v0.5.0

Published

Official React bindings for the 2Stars Video Platform — Provider + hooks on top of @2stars/video-js.

Downloads

63

Readme

@2stars/video-react

Official React bindings for the 2Stars Video Platform. A thin Provider + hooks layer on top of @2stars/video-js — none of the heavy lifting is reimplemented; this package just makes it idiomatic in React.

import { StarsProvider, useRoom, usePeers, VideoTile } from '@2stars/video-react';

function App() {
  return (
    <StarsProvider token={participantToken}>
      <Call />
    </StarsProvider>
  );
}

function Call() {
  const { room, status } = useRoom();
  const peers = usePeers();
  if (status !== 'connected') return <div>Connecting…</div>;
  return peers.map(p => <VideoTile key={p.id} peer={p} />);
}

Install

npm install @2stars/video-react @2stars/video-js react react-dom

@2stars/video-js, react, and react-dom are peer dependencies — your app controls those versions.

Quick start

You authenticate users by handing the SDK a short-lived participant token that your backend obtains from the 2Stars API. Never embed your 2Stars API key in the browser bundle.

// Backend (Node) — mint a token per participant
const res = await fetch('https://api.2stars.io/video/v1/tokens', {
  method: 'POST',
  headers: { authorization: 'Bearer hbs_live_…', 'content-type': 'application/json' },
  body: JSON.stringify({ roomCode, participantId, displayName, ttlSeconds: 3600 }),
});
const { token } = await res.json();
// Send `token` to the browser, use it as the prop below.

// Frontend (React)
<StarsProvider token={participantToken} />

What's in the box

Provider

  • <StarsProvider token> — root Provider. Connects, exposes a context every hook reads.

Hooks — connection & room

  • useStarsClient() — raw client (escape hatch)
  • useRoom(){ room, status }
  • useConnectionState() / useConnectionStatus() — fine-grained signaling status
  • useRoomKeyReady() — E2E key handshake state
  • useVisibility() — page-visibility tracking (for adaptive bitrate)
  • useMode() — P2P / SFU current routing mode

Hooks — media

  • useLocalCamera() — manage local camera + mic
  • useScreenShare() — start / stop screen share
  • useScreenSharers() — list peers currently sharing screens
  • usePeers() — every remote peer in the room
  • useActiveSpeaker() — highest-audio peer right now
  • useGridLayout() — adaptive grid sizing
  • useBackground() — virtual / blurred background
  • useAvatar() — AI-rendered avatar mode

Hooks — chat

  • useMessages() — paginated message list
  • useSendMessage()sendMessage(text) callback

Hooks — AI

  • useTranscription() — live transcript
  • useTranslation() / useTranslatedAudio() — real-time translation
  • useCorrection() — pre-send message correction
  • useFactCheck() — inline fact check
  • useAIParticipant() — AI participant ("Hebbs") state
  • useWakeWord() — wake-word detection state
  • useWhiteboard() — AI-generated whiteboards

Hooks — control

  • useModeration() — kick / mute / ban / lock
  • useRemoteControl() — request / grant remote desktop control over a shared screen

Components

  • <VideoTile peer> — single peer's video + audio tile
  • <RoomGrid> — adaptive grid of every peer
  • <ChatStrip> — message + composer strip
  • <WhiteboardSurface> — AI whiteboard display

Companion SDKs

License

MIT — see LICENSE.