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 🙏

© 2025 – Pkg Stats / Ryan Hefner

echo-voicebot

v1.1.3

Published

React TypeScript library for WebSocket-based voice interactions

Readme

Echo Voicebot Library

A React TypeScript library for WebSocket-based voice interactions with real-time audio streaming and transcription support.

Installation

npm install echo-voicebot

Quick Start

Basic Usage with Component

import React from 'react';
import { VoicebotWidget, VoicebotConfig } from 'echo-voicebot';

const App = () => {
  const config: VoicebotConfig = {
    userId: 'user123',
    assistantId: 'assistant456',
    flowId: 'flow789',
    autoStream: true,
    language: 'en-US'
  };

  return (
    <div>
      <h1>My Voice App</h1>
      <VoicebotWidget 
        config={config}
        showTranscripts={true}
        showControls={true}
      />
    </div>
  );
};

export default App;

Advanced Usage with Hook

import React from 'react';
import { useVoicebot, VoicebotConfig } from 'echo-voicebot';

const CustomVoiceComponent = () => {
  const config: VoicebotConfig = {
    userId: 'user123',
    assistantId: 'assistant456',
    flowId: 'flow789'
  };

  const { 
    status, 
    isStreaming, 
    transcripts, 
    connectionUrls,
    connect, 
    disconnect, 
    startStreaming, 
    stopStreaming 
  } = useVoicebot(config, {
    onTranscript: (message) => console.log('New transcript:', message),
    onStatusChange: (status) => console.log('Status changed:', status),
    onError: (error) => console.error('Error:', error)
  });

  return (
    <div>
      <button onClick={connect}>Connect</button>
      <button onClick={startStreaming} disabled={status !== 'connected'}>
        Start Recording
      </button>
      <p>Status: {status}</p>
      <div>
        {transcripts.map((t, i) => (
          <p key={i}>{t.speaker}: {t.text}</p>
        ))}
      </div>
    </div>
  );
};

Configuration

VoicebotConfig

| Property | Type | Required | Description | |----------|------|----------|-------------|

| userId | string | ✅ | User identifier | | assistantId | string | ✅ | Assistant identifier | | flowId | string | ✅ | Flow identifier | | callSid | string | ❌ | Call session ID | | language | string | ❌ | Language code (default: 'en-US') | | interruptions | boolean | ❌ | Enable interruptions | | prompt | string | ❌ | Assistant prompt | | autoStream | boolean | ❌ | Auto-start streaming on connect |

Callbacks

const callbacks: VoicebotCallbacks = {
  onTranscript: (message) => {
    // Handle new transcript message
  },
  onStatusChange: (status) => {
    // Handle connection status changes
  },
  onError: (error) => {
    // Handle errors
  },
  onCallEnd: () => {
    // Handle call end
  }
};

React Native Support

For React Native, you'll need to install additional dependencies:

npm install react-native-webrtc

Then use the library the same way:

import { VoicebotWidget } from 'echo-voicebot';

// Same usage as React

Flutter Integration

For Flutter apps using webview_flutter:

// Add to pubspec.yaml
dependencies:
  webview_flutter: ^4.0.0

// Create a WebView that loads your React component
WebView(
  initialUrl: 'your-react-app-url-with-voicebot-widget',
  javascriptMode: JavascriptMode.unrestricted,
)

API Reference

Hook: useVoicebot

Returns an object with:

  • status: Current connection status
  • isStreaming: Whether audio streaming is active
  • transcripts: Array of transcript messages
  • connectionUrls: WebSocket URLs used for connection
  • connect(): Connect to WebSocket
  • disconnect(): Disconnect from WebSocket
  • startStreaming(): Start audio recording
  • stopStreaming(): Stop audio recording

Component: VoicebotWidget

Props:

  • config: VoicebotConfig object
  • callbacks?: Optional callbacks
  • className?: CSS class name
  • showTranscripts?: Show transcript panel (default: true)
  • showControls?: Show control buttons (default: true)

License

MIT#� �e�c�h�o�-�v�o�i�c�e�b�o�t� � �