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

vpss

v0.7.5

Published

Virtual Participant Simulation Service - Mock participants for video call testing

Downloads

1,738

Readme

VPSS - Virtual Participant Simulation Service

Mock participants for video call testing. VPSS provides a web interface and API to simulate multiple participants in a video call.

Installation

# Run directly with npx (no installation required)
npx vpss

# Or install globally
npm install -g vpss
vpss

The server starts on http://localhost:4747 by default.

CLI Options

vpss [options]

Options:
  -p, --port <number>  Port to run the server on (default: 4747)
  -d, --dev            Run in development mode
  -h, --help           Show help

Examples:
  vpss                  Start on default port 4747
  vpss --port 3000      Start on port 3000
  vpss -p 8080          Start on port 8080

Features

  • Web UI to manage mock participants
  • REST API for programmatic control
  • WebSocket for real-time updates
  • Simulate video, audio, screen share, and hand raised states
  • Multiple participant roles (host, co-host, participant, guest)

REST API

List Participants

GET /api/mock-participants

Response:

[
  {
    "id": "abc123",
    "name": "John Doe",
    "role": "participant",
    "isVideoOn": true,
    "isAudioOn": true,
    "isHandRaised": false,
    "isScreensharingOn": false
  }
]

Create Participant

POST /api/mock-participants
Content-Type: application/json

{
  "name": "Jane Smith",
  "role": "participant"
}

Update Participant

PATCH /api/mock-participants/:id
Content-Type: application/json

{
  "isVideoOn": false,
  "isAudioOn": true,
  "isHandRaised": true
}

Valid update fields:

  • isVideoOn (boolean)
  • isAudioOn (boolean)
  • isHandRaised (boolean)
  • isScreensharingOn (boolean)
  • role (string)

Delete Participant

DELETE /api/mock-participants/:id

WebSocket Integration

Connect to ws://localhost:4747/ws for real-time participant updates.

Message Types

participant_added

{
  "type": "participant_added",
  "participant": { ... },
  "allParticipants": [ ... ]
}

participant_updated

{
  "type": "participant_updated",
  "participant": { ... },
  "allParticipants": [ ... ]
}

participant_removed

{
  "type": "participant_removed",
  "participantId": "abc123"
}

Example Client

const ws = new WebSocket('ws://localhost:4747/ws');

ws.onmessage = (event) => {
  const data = JSON.parse(event.data);

  switch (data.type) {
    case 'participant_added':
      console.log('New participant:', data.participant);
      break;
    case 'participant_updated':
      console.log('Updated:', data.participant);
      break;
    case 'participant_removed':
      console.log('Removed:', data.participantId);
      break;
  }
};

Integration Examples

Fetch API (Browser)

// List all participants
const response = await fetch('http://localhost:4747/api/mock-participants');
const participants = await response.json();

// Create a participant
await fetch('http://localhost:4747/api/mock-participants', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ name: 'Test User', role: 'participant' })
});

// Toggle video for a participant
await fetch(`http://localhost:4747/api/mock-participants/${id}`, {
  method: 'PATCH',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ isVideoOn: false })
});

cURL

# List participants
curl http://localhost:4747/api/mock-participants

# Create participant
curl -X POST http://localhost:4747/api/mock-participants \
  -H "Content-Type: application/json" \
  -d '{"name": "Test User", "role": "participant"}'

# Update participant
curl -X PATCH http://localhost:4747/api/mock-participants/abc123 \
  -H "Content-Type: application/json" \
  -d '{"isVideoOn": false}'

# Delete participant
curl -X DELETE http://localhost:4747/api/mock-participants/abc123

React SDK

VPSS ships with React utilities for easy integration. Install the package and import directly.

useParticipants Hook

The simplest way to get participant data. Returns a live-updating array that automatically syncs via WebSocket.

import { useParticipants } from 'vpss';

function ParticipantList() {
  const participants = useParticipants();

  return (
    <ul>
      {participants.map(p => (
        <li key={p.id}>{p.name} ({p.role})</li>
      ))}
    </ul>
  );
}

Optionally pass a custom base URL:

const participants = useParticipants('http://localhost:3000');

useParticipantsState Hook

For full control with loading states, errors, and CRUD operations:

import { useParticipantsState } from 'vpss';

function ParticipantManager() {
  const {
    participants,
    loading,
    error,
    createParticipant,
    updateParticipant,
    deleteParticipant,
  } = useParticipantsState();

  if (loading) return <div>Loading...</div>;
  if (error) return <div>Error: {error.message}</div>;

  return (
    <ul>
      {participants.map(p => (
        <li key={p.id}>
          {p.name} ({p.role})
          <button onClick={() => updateParticipant(p.id, { isVideoOn: !p.isVideoOn })}>
            Toggle Video
          </button>
          <button onClick={() => deleteParticipant(p.id)}>Remove</button>
        </li>
      ))}
      <button onClick={() => createParticipant({ name: 'New User', role: 'participant' })}>
        Add Participant
      </button>
    </ul>
  );
}

Options:

useParticipantsState({
  baseUrl: 'http://localhost:4747',  // VPSS server URL (optional)
})

useParticipant Hook

For managing a single participant:

import { useParticipant } from 'vpss';

function ParticipantCard({ id }: { id: string }) {
  const { participant, loading, update, remove } = useParticipant(id);

  if (loading) return <div>Loading...</div>;
  if (!participant) return <div>Not found</div>;

  return (
    <div>
      <h2>{participant.name}</h2>
      <button onClick={() => update({ isVideoOn: !participant.isVideoOn })}>
        Toggle Video
      </button>
      <button onClick={remove}>Remove</button>
    </div>
  );
}

VPSSProvider

Share participant state across components:

import { VPSSProvider, useVPSS } from 'vpss';

function App() {
  return (
    <VPSSProvider baseUrl="http://localhost:4747" realtime>
      <ParticipantCount />
      <ParticipantList />
    </VPSSProvider>
  );
}

function ParticipantCount() {
  const { participants } = useVPSS();
  return <div>Total: {participants.length}</div>;
}

withParticipants HOC

Class component support:

import { withParticipants, WithParticipantsProps } from 'vpss';

class ParticipantList extends React.Component<WithParticipantsProps> {
  render() {
    const { participants, participantsLoading } = this.props;
    if (participantsLoading) return <div>Loading...</div>;
    return <ul>{participants.map(p => <li key={p.id}>{p.name}</li>)}</ul>;
  }
}

export default withParticipants(ParticipantList);

TypeScript Types

import type {
  Participant,
  ParticipantUpdate,
  CreateParticipantInput,
  UseParticipantsOptions,
} from 'vpss';

Development

# Clone and install
git clone https://github.com/ooosome/vpss.git
cd vpss
pnpm install

# Development server
pnpm dev

# Build
pnpm build

# Run tests
pnpm test

License

MIT