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

@omnia-voice/sdk

v0.2.3

Published

Omnia Voice SDK - Build voice AI experiences with ease

Readme

@omnia/voice-sdk

Build voice AI experiences with ease. The Omnia Voice SDK provides a simple way to integrate voice AI agents into your web and mobile applications.

Features

  • 🎙️ Real-time voice conversations with AI agents
  • 🔊 High-quality audio via WebRTC
  • 📝 Live transcription of conversations
  • ⚛️ React hooks for easy integration
  • 📱 Works on web and mobile
  • 🔒 Secure - API key authentication

Installation

npm install @omnia/voice-sdk
# or
yarn add @omnia/voice-sdk
# or
pnpm add @omnia/voice-sdk

Quick Start

Vanilla JavaScript/TypeScript

import { OmniaVoice } from '@omnia/voice-sdk';

// Create client
const voice = new OmniaVoice({
  apiKey: 'your-api-key',
});

// Listen for events
voice.on('transcriptUpdated', (entry) => {
  console.log(`${entry.role}: ${entry.text}`);
});

voice.on('agentStateChanged', (state) => {
  console.log(`Agent is now: ${state}`);
});

// Connect to an agent
await voice.connect({ agentId: 'agent-123' });

// ... conversation happens automatically ...

// Disconnect when done
await voice.disconnect();

React

import {
  OmniaVoiceProvider,
  useOmniaVoice,
} from '@omnia/voice-sdk/react';

// Wrap your app with the provider
function App() {
  return (
    <OmniaVoiceProvider config={{ apiKey: 'your-api-key' }}>
      <VoiceChat />
    </OmniaVoiceProvider>
  );
}

// Use the hook in your components
function VoiceChat() {
  const {
    connect,
    disconnect,
    isConnected,
    agentState,
    transcript,
  } = useOmniaVoice();

  return (
    <div>
      <p>Agent: {agentState}</p>

      <button
        onClick={() =>
          isConnected ? disconnect() : connect({ agentId: 'agent-123' })
        }
      >
        {isConnected ? 'End Call' : 'Start Call'}
      </button>

      <div>
        {transcript.map((entry) => (
          <p key={entry.id}>
            <strong>{entry.role}:</strong> {entry.text}
          </p>
        ))}
      </div>
    </div>
  );
}

API Reference

OmniaVoice

The main client class.

const voice = new OmniaVoice(config);

Config Options

| Option | Type | Required | Description | |--------|------|----------|-------------| | apiKey | string | Yes | Your Omnia API key | | baseUrl | string | No | API base URL (default: https://api.play-omnia.com) | | debug | boolean | No | Enable debug logging |

Methods

| Method | Description | |--------|-------------| | connect(options) | Connect to a voice agent | | disconnect() | Disconnect from the call | | setMicrophoneEnabled(enabled) | Enable/disable microphone | | sendMessage(text) | Send a text message to the agent | | on(event, callback) | Add event listener | | off(event, callback) | Remove event listener |

Properties

| Property | Type | Description | |----------|------|-------------| | connectionState | ConnectionState | Current connection state | | agentState | AgentState | Current agent state | | isMicrophoneEnabled | boolean | Whether microphone is enabled | | transcript | TranscriptEntry[] | Conversation transcript | | duration | number | Call duration in ms |

Events

| Event | Payload | Description | |-------|---------|-------------| | connectionStateChanged | ConnectionState | Connection state changed | | agentStateChanged | AgentState | Agent state changed | | transcriptUpdated | TranscriptEntry | New transcript entry | | callStarted | ConnectionDetails | Call started | | callEnded | number | Call ended (duration in ms) | | error | Error | Error occurred |

Connect Options

interface ConnectOptions {
  // Use a pre-configured agent from your dashboard
  agentId?: string;

  // Or provide raw configuration
  config?: {
    systemPrompt?: string;
    greeting?: string;
    voice?: string;
    language?: string;
    temperature?: number;
    recordingEnabled?: boolean;
  };

  // Override specific agent settings
  overrides?: {
    greeting?: string;
    // ... any config field
  };

  // Custom metadata
  metadata?: Record<string, any>;
}

React Hooks

useOmniaVoice

Main hook for voice functionality.

const {
  // State
  connectionState,
  agentState,
  isMicrophoneEnabled,
  transcript,
  duration,
  isConnected,
  isConnecting,

  // Actions
  connect,
  disconnect,
  setMicrophoneEnabled,
  sendMessage,
} = useOmniaVoice();

useVoiceCall

Simplified hook for call management.

const {
  startCall,
  endCall,
  toggleCall,
  isLoading,
  error,
  isConnected,
} = useVoiceCall({ agentId: 'agent-123' });

useMicrophone

Hook for microphone control.

const {
  isMuted,
  isEnabled,
  toggle,
  mute,
  unmute,
} = useMicrophone();

useTranscript

Get the conversation transcript.

const transcript = useTranscript();

useFormattedDuration

Get the call duration as mm:ss.

const duration = useFormattedDuration(); // "02:30"

Types

ConnectionState

type ConnectionState =
  | 'disconnected'
  | 'connecting'
  | 'connected'
  | 'reconnecting'
  | 'failed'

AgentState

type AgentState =
  | 'idle'
  | 'listening'
  | 'thinking'
  | 'speaking'

TranscriptEntry

interface TranscriptEntry {
  id: string;
  role: 'user' | 'agent';
  text: string;
  isFinal: boolean;
  timestamp: number;
}

Examples

Basic Voice Chat

import { OmniaVoiceProvider, useOmniaVoice } from '@omnia/voice-sdk/react';

function VoiceChat() {
  const { connect, disconnect, isConnected, transcript, agentState } = useOmniaVoice();

  return (
    <div className="voice-chat">
      <div className="status">
        Agent: <span className={agentState}>{agentState}</span>
      </div>

      <div className="transcript">
        {transcript.map((entry) => (
          <div key={entry.id} className={`message ${entry.role}`}>
            {entry.text}
          </div>
        ))}
      </div>

      <button
        onClick={() => isConnected ? disconnect() : connect({ agentId: 'my-agent' })}
        className={isConnected ? 'end-call' : 'start-call'}
      >
        {isConnected ? '🔴 End Call' : '🟢 Start Call'}
      </button>
    </div>
  );
}

With Microphone Control

function VoiceChatWithMic() {
  const { connect, disconnect, isConnected } = useOmniaVoice();
  const { isMuted, toggle } = useMicrophone();

  return (
    <div>
      <button onClick={() => isConnected ? disconnect() : connect({ agentId: 'my-agent' })}>
        {isConnected ? 'End' : 'Start'}
      </button>

      {isConnected && (
        <button onClick={toggle}>
          {isMuted ? '🔇 Unmute' : '🔊 Mute'}
        </button>
      )}
    </div>
  );
}

Dynamic Configuration

function DynamicAgent() {
  const { connect } = useOmniaVoice();

  const startCustomAgent = () => {
    connect({
      config: {
        systemPrompt: 'You are a friendly sales assistant for our shoe store.',
        greeting: 'Welcome to ShoeWorld! What kind of shoes are you looking for today?',
        voice: 'Sarah',
        language: 'en',
      },
    });
  };

  return <button onClick={startCustomAgent}>Talk to Sales</button>;
}

License

MIT