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

vg-x07df

v1.9.3

Published

Headless SDK for callpad audio/video

Readme

CallPad SDK

Production-ready headless SDK for CallPad audio/video calls with React integration.

Installation

npm install vg-x07df
# or
yarn add vg-x07df
# or
pnpm add vg-x07df

Quick Start

import { CallpadSdkProvider, useCallActions, useCallState } from 'vg-x07df';

function App() {
  return (
    <CallpadSdkProvider config={{ apiUrl: 'your-api-url' }}>
      <CallInterface />
    </CallpadSdkProvider>
  );
}

function CallInterface() {
  const { initiate, accept, end } = useCallActions();
  const { status, participants } = useCallState();

  const handleStartCall = () => {
    initiate(['[email protected]'], 'VIDEO');
  };

  return (
    <div>
      <h1>Call Status: {status}</h1>
      <button onClick={handleStartCall}>Start Video Call</button>
      <div>Participants: {participants.length}</div>
    </div>
  );
}

Features

  • 🎥 Audio & Video Calls - High-quality real-time communication
  • React Hooks - Modern React integration with custom hooks
  • 🔧 Headless UI - Bring your own UI components
  • 📱 Responsive - Works across desktop and mobile
  • 🔒 Secure - End-to-end encrypted communications
  • 🎛️ Media Controls - Camera, microphone, and screen sharing
  • 👥 Multi-participant - Support for group calls
  • 📊 Call Quality - Real-time quality monitoring
  • 🔔 Event System - Comprehensive call event handling

API Reference

Providers

  • CallpadSdkProvider - Main provider component for SDK configuration

Hooks

  • useCallActions() - Actions for managing calls (initiate, accept, decline, end, cancel)
  • useCallState() - Current call state and session information
  • useParticipants() - Participant management and information
  • useMediaControls() - Camera, microphone, and screen sharing controls
  • useDevices() - Audio/video device selection
  • useEvent() - SDK event subscriptions
  • useCallQuality() - Real-time call quality metrics
  • useErrors() - Error handling and management

LiveKit Integration

import { LiveKitProvider, useTrack } from 'vg-x07df/livekit';

// Access LiveKit room and tracks directly
const track = useTrack();

Video Call Features

Video Initialization

The SDK automatically initializes camera capability but keeps it disabled by default for privacy:

  • Camera permissions are requested when the room connects
  • Video starts disabled (privacy-first approach)
  • Users must explicitly enable video via UI controls
  • Room is optimized with adaptive streaming and dynacast for performance

Using Video Controls

import { useTrackToggle, Track } from "vg-x07df/livekit";

function VideoControls() {
  // Toggle video on/off
  const { toggle: toggleVideo, enabled: isVideoEnabled } = useTrackToggle({
    source: Track.Source.Camera
  });

  return (
    <button onClick={toggleVideo}>
      {isVideoEnabled ? "Turn Off Video" : "Turn On Video"}
    </button>
  );
}

Displaying Video

import { VideoTrack, useParticipantTracks, Track } from "vg-x07df/livekit";
import { hasVideoTrack } from "vg-x07df/utils";

function ParticipantVideo({ participant }) {
  const tracks = useParticipantTracks(participant, Track.Source.Camera);
  
  return (
    <div className="participant-container">
      {hasVideoTrack(participant) ? (
        <VideoTrack 
          participant={participant} 
          source={Track.Source.Camera}
          className="video-element"
        />
      ) : (
        <div className="avatar-fallback">
          {participant.identity}
        </div>
      )}
    </div>
  );
}

Video Utilities

The SDK provides utility functions for common video operations:

import { hasVideoTrack, getVideoTrack, hasVideoCapability } from "vg-x07df/utils";

// Check if participant has active video (enabled and published)
const hasActiveVideo = hasVideoTrack(participant);

// Get video track publication
const videoTrack = getVideoTrack(participant);

// Check if video capability exists (track exists, may be muted)
const canHaveVideo = hasVideoCapability(participant);

Complete Video Implementation Example

import { 
  VideoTrack, 
  useTrackToggle, 
  useParticipantTracks, 
  Track,
  useParticipants 
} from "vg-x07df/livekit";
import { hasVideoTrack } from "vg-x07df/utils";

function VideoCallInterface() {
  const participants = useParticipants();
  const { toggle: toggleVideo, enabled: isVideoEnabled } = useTrackToggle({ 
    source: Track.Source.Camera 
  });

  return (
    <div className="video-call-container">
      {/* Video Controls */}
      <div className="controls">
        <button onClick={toggleVideo}>
          {isVideoEnabled ? "Turn Off Video" : "Turn On Video"}
        </button>
      </div>

      {/* Participant Videos */}
      <div className="participants-grid">
        {participants.map((participant) => (
          <div key={participant.identity} className="participant-tile">
            {hasVideoTrack(participant) ? (
              <VideoTrack 
                participant={participant} 
                source={Track.Source.Camera}
                className="video-element"
              />
            ) : (
              <div className="avatar-placeholder">
                {participant.identity.charAt(0).toUpperCase()}
              </div>
            )}
            <span className="participant-name">
              {participant.identity}
            </span>
          </div>
        ))}
      </div>
    </div>
  );
}

Video Troubleshooting

Camera permissions denied:

  • The SDK handles permissions gracefully
  • Users will see a browser permission prompt on first video toggle
  • If permissions are denied, the call continues as audio-only
  • Check browser settings if video toggle doesn't work

Video not appearing:

  • Verify hasVideoTrack(participant) returns true
  • Check that useTrackToggle shows enabled: true
  • Ensure the VideoTrack component has the correct participant prop
  • Confirm the participant has published their video track

Performance issues with multiple videos:

  • The SDK uses optimized settings (720p, adaptive streaming, dynacast)
  • Video quality automatically adjusts based on available bandwidth
  • Multiple video streams are handled efficiently with simulcast
  • Consider reducing video quality for low-bandwidth scenarios

Audio works but video doesn't:

  • Check if camera is being used by another application
  • Verify camera permissions in browser settings
  • Try refreshing the page to reinitialize camera access
  • Check browser console for camera-related errors

Requirements

  • React ≥18.0.0
  • React DOM ≥18.0.0
  • LiveKit Client ≥2.8.0
  • Socket.IO Client ≥4.7.0

TypeScript Support

This package includes full TypeScript definitions. No additional @types packages needed.

import type { CallState, Participant, CallQuality } from 'vg-x07df';