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

@inves/voiceai-client

v1.0.2

Published

Client SDK for VoiceAI real-time voice conversation platform

Readme

@inves/voiceai-client

Client SDK for VoiceAI — real-time voice conversations with AI agents over WebRTC.

Features

  • WebRTC audio — bidirectional voice streaming with echo cancellation & noise suppression
  • React hookuseVoiceAI() with state management & automatic cleanup
  • Vanilla JS — framework-agnostic VoiceAIClient class
  • TypeScript — full type definitions included
  • Lightweight — zero runtime dependencies (React is an optional peer dep)

Install

npm install @inves/voiceai-client

Quick Start — Vanilla JS

import { VoiceAIClient } from '@inves/voiceai-client';

const client = new VoiceAIClient({
  serverUrl: 'https://voice.yourdomain.com',
  apiKey: 'vai_your_api_key',
  onStateChange: (state) => console.log('State:', state),
  onTranscript: (msg) => console.log(`${msg.role}: ${msg.content}`),
  onError: (err) => console.error(err.code, err.message),
});

// Start a conversation
const sessionId = await client.startSession({
  assistantType: 'interview',
  contextVariables: { candidate_name: 'Alice' },
});

// ... conversation happens over WebRTC audio ...

// Get transcript & end session
const transcript = await client.getTranscript();
await client.endSession();

Quick Start — React

import { useVoiceAI } from '@inves/voiceai-client/react';

function VoiceChat() {
  const {
    state, transcript, error, audioLevel,
    startSession, endSession, isActive,
  } = useVoiceAI({
    serverUrl: 'https://voice.yourdomain.com',
    apiKey: 'vai_your_api_key',
  });

  return (
    <div>
      <p>Status: {state}</p>
      <button onClick={() => startSession({ assistantType: 'support' })}>
        Start Call
      </button>
      <button onClick={endSession} disabled={!isActive}>
        End Call
      </button>
      {transcript.map((msg, i) => (
        <p key={i}><b>{msg.role}:</b> {msg.content}</p>
      ))}
    </div>
  );
}

API Reference

VoiceAIClient

| Method | Description | |---|---| | startSession(options) | Start a voice session. Returns session ID. | | endSession() | End session, stop mic, close WebRTC. | | getTranscript(sessionId?) | Fetch full transcript from server. | | getSessionStatus(sessionId?) | Get current session status. | | currentState | Current SessionState value. | | activeSessionId | Current session ID or null. | | isActive | true if in an active conversation. |

useVoiceAI(options) (React)

Returns: { state, sessionId, transcript, error, audioLevel, startSession, endSession, getTranscript, isIdle, isConnected, isActive }

Automatically cleans up on component unmount.

Session States

idleconnectingconnectedlisteningprocessingspeakingended

Error Codes

| Code | Meaning | |---|---| | NETWORK_ERROR | Server unreachable | | AUTH_ERROR | Invalid API key (401/403) | | SESSION_ERROR | Session creation/lookup failed | | CAPACITY_ERROR | Max concurrent sessions (503) | | WEBRTC_ERROR | SDP exchange or connection failed | | MEDIA_ERROR | Microphone access denied | | CONNECTION_LOST | WebRTC dropped mid-session |

Requirements

  • Browser with WebRTC support (Chrome, Firefox, Safari, Edge)
  • Microphone access
  • A running VoiceAI server instance

License

MIT