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

@moss-tools/voice-server

v1.0.0-beta.3

Published

Optimized server-side utilities for LiveKit-based Moss voice agents.

Readme

@moss-tools/voice-server

Optimized server-side utilities for LiveKit-based Moss voice agents. Handles secure token generation and connection management.

Features

  • Token generation - Create participant tokens with optimized permissions
  • Clean class-based API - Simple, intuitive interface
  • Type-safe - Full TypeScript support with detailed JSDoc comments

Requirements

  • Node.js 18.0.0 or higher

Install

npm install @moss-tools/voice-server

Usage

import { MossVoiceServer } from "@moss-tools/voice-server";

// Create and initialize (call once at app startup)
const voiceServer = await MossVoiceServer.create({
  projectId: process.env.MOSS_PROJECT_ID!,
  projectKey: process.env.MOSS_PROJECT_KEY!,
  voiceAgentId: process.env.MOSS_VOICE_AGENT_ID!,
});

// Get voice agent server URL for clients
const serverUrl = voiceServer.getServerUrl();

// Create participant tokens
const token = await voiceServer.createParticipantToken(
  { identity: "user_123", name: "John Doe" },
  "support_room_456"
);

The MossVoiceServer class securely fetches and caches your voice agent credentials, then uses them to generate participant tokens.

API

MossVoiceServer.create(config): Promise<MossVoiceServer>

Create and initialize a MossVoiceServer instance by fetching credentials from Moss API.

Parameters:

  • config.projectId - Your Moss project ID
  • config.projectKey - Your Moss project key
  • config.voiceAgentId - Voice agent ID to use

Returns: Initialized MossVoiceServer instance

Example:

const voiceServer = await MossVoiceServer.create({
  projectId: "your-project-id",
  projectKey: "your-project-key",
  voiceAgentId: "your-voice-agent-id",
});

voiceServer.getServerUrl(): string

Get the voice agent server URL for client connections.

Returns: Voice agent server URL (e.g., wss://your-agent.livekit.cloud)

Note: Credentials are kept secure on the server and never exposed.

voiceServer.createParticipantToken(userInfo, roomName, agentName?): Promise<string>

Create and sign a participant token for joining a voice session.

Parameters:

  • userInfo - User identity and name
    • identity - Unique user identifier
    • name - Display name for the participant
  • roomName - Room name to join
  • agentName - (Optional) Override default voice agent name

Returns: Signed JWT token valid for 15 minutes

Example:

const token = await voiceServer.createParticipantToken(
  { identity: "user_123", name: "John Doe" },
  "support_room_456"
);

voiceServer.getAgentName(): string

Get the configured voice agent name.

Returns: Voice agent name

Environment Variables

Configure using environment variables:

MOSS_PROJECT_ID=your-project-id
MOSS_PROJECT_KEY=your-project-key
MOSS_VOICE_AGENT_ID=your-voice-agent-id

Then in your code:

const voiceServer = await MossVoiceServer.create({
  projectId: process.env.MOSS_PROJECT_ID!,
  projectKey: process.env.MOSS_PROJECT_KEY!,
  voiceAgentId: process.env.MOSS_VOICE_AGENT_ID!,
});

Development

npm install
npm run build
npm test

Build output is emitted to dist/.