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

voxlink

v1.0.0

Published

A reusable npm package for real-time audio and video calling using WebRTC and Socket.IO.

Readme

VoxLink

VoxLink is a reusable npm package for real-time audio and video calling, built on WebRTC and Socket.IO. It is designed for modern React applications but supports vanilla JavaScript/TypeScript as well.

Features

  • WebRTC-based peer-to-peer media streaming.
  • Socket.IO signaling for connection management.
  • React Hooks & Components for easy integration.
  • TypeScript Support for full type safety.
  • Modular & Configurable.

Installation

npm install voxlink socket.io-client

Usage

React Integration

VoxLink provides a useCall hook and pre-built components.

Important: Import the styles at the root of your application (e.g., App.tsx or index.tsx).

import 'voxlink/dist/styles.css'; 
import React, { useState } from 'react';
import { useCall, VideoCall, ControlBar, MuteButton, EndCallButton, CameraFlipButton } from 'voxlink';
import 'voxlink/dist/styles.css'; // Basic styling

const App = () => {
  const [targetId, setTargetId] = useState('');
  const { 
    localStream, 
    remoteStream, 
    status, 
    startCall, 
    endCall, 
    toggleMute, 
    toggleVideo,
    isMuted,
    isVideoEnabled 
  } = useCall('http://localhost:3000'); // Your Socket.IO server URL

  return (
    <div style={{ height: '100vh', width: '100vw' }}> {/* Container should have height */}
      <VideoCall 
         localStream={localStream} 
         remoteStream={remoteStream} 
         className="my-video-call"
       />

      <ControlBar>
        {status === 'idle' ? (
          <>
            <input 
              type="text" 
              placeholder="Target ID" 
              value={targetId} 
              onChange={(e) => setTargetId(e.target.value)} 
              style={{ padding: '8px', borderRadius: '4px' }}
            />
            <button onClick={() => startCall(targetId)}>Start</button>
          </>
        ) : (
          <>
            <MuteButton isMuted={isMuted} toggleMute={toggleMute} />
            <CameraFlipButton toggleVideo={toggleVideo} />
            <EndCallButton endCall={endCall} />
          </>
        )}
      </ControlBar>
    </div>
  );
};

export default App;

Vanilla JS / TypeScript Usage

You can use the core VoxLinkClient directly.

import { VoxLinkClient } from 'voxlink';

const client = new VoxLinkClient({ serverUrl: 'http://localhost:3000' });

// Handle incoming streams
client.on('stream-added', (stream) => {
  const videoElement = document.getElementById('remote-video') as HTMLVideoElement;
  videoElement.srcObject = stream;
  videoElement.play();
});

// Start a call
async function startCall(targetId: string) {
  const localStream = await client.startLocalStream();
  // Attach local stream to video element...
  await client.call(targetId);
}

API Reference

useCall(serverUrl: string, iceServers?: RTCIceServer[])

Returns an object with:

  • localStream: MediaStream | null
  • remoteStream: MediaStream | null
  • status: 'idle' | 'calling' | 'connected' | 'ended'
  • isMuted, isVideoEnabled, isScreenSharing: boolean
  • startCall(targetId: string): Function to initiate a call.
  • endCall(): Function to end the call.
  • toggleMute(): Toggle audio.
  • toggleVideo(): Toggle video.

Components

  • <VideoCall />: Renders local and remote video. Props: localStream, remoteStream, localVideoStyle, remoteVideoStyle.
  • <AudioCall />: Renders remote audio (if no video is needed).
  • <MuteButton />, <CameraFlipButton />, <ScreenShareButton />, <EndCallButton />: Helper buttons.

Production Setup

To use VoxLink in production, you must handle configuration for different environments and ensuring connectivity via TURN servers.

1. Environment Configuration

Use environment variables to separate your development and production signaling servers.

Example (.env):

REACT_APP_SIGNALING_SERVER=https://api.myapp.com

Example (App.tsx):

const SERVER_URL = process.env.REACT_APP_SIGNALING_SERVER || 'http://localhost:3000';

const App = () => {
  const { startCall } = useCall(SERVER_URL);
  // ...
};

2. ICE Servers (STUN/TURN)

For production, relying on public STUN servers is not enough because many users are behind symmetric NATs or firewalls. You need TURN servers.

Recommended Setup:

// Define your ICE servers (e.g., from Twilio, Xirsys, or your own coturn instance)
const iceServers = [
  { urls: 'stun:stun.l.google.com:19302' }, // Public STUN
  { 
    urls: 'turn:your-turn-server.com:3478', 
    username: 'user', 
    credential: 'password' 
  }
];

const App = () => {
  // Pass iceServers as the second argument
  const { startCall } = useCall(SERVER_URL, iceServers);
  
  // ...
};

Note: Ensure iceServers is stable (defined outside component or memoized) to avoid reconnects on re-renders.

Requirements

  • Uses Socket.IO server for signaling.
  • Requires a TURN server for production usage over the internet (default uses public STUN).