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

@vogent/vogent-web-client

v0.1.7

Published

A TypeScript/JavaScript client library for integrating Vogent into web applications.

Readme

Vogent Web Client

A TypeScript/JavaScript client library for integrating Vogent into web applications.

Installation

Bun

bun add @vogent/vogent-web-client

NPM

npm install @vogent/vogent-web-client

Yarn

yarn add @vogent/vogent-web-client

Prerequisites

Before using VogentCall, you need to obtain the following from the Vogent API:

  • sessionId: Unique session identifier
  • dialId: Unique dial/call identifier
  • token: Authentication token

You may call the Create Dial endpoint on the browser to create a browser dial (not a phone call), but you must be using a public API key. Do not use a private API key on the client.

Usage

import { VogentCall } from '@vogent/vogent-web-client';

// First, create a dial using the Vogent API
const response = await fetch('https://api.vogent.ai/api/dials', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer pub_vogent_...', // Make sure this is a public key, and not a private key.
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    callAgentId: 'your_call_agent_id',
    browserCall: true  // Set to true for web-based calls
  })
});

const { dialToken, sessionId, dialId } = await response.json();

// Create a new call instance with the dial details
const call = new VogentCall({
  sessionId: sessionId,
  dialId: dialId,
  token: dialToken
});

// Start the call
await call.start();

// Connect audio
const audioConn = await call.connectAudio();

// Monitor transcripts in real-time
const unsubscribe = call.monitorTranscript((transcript) => {
  transcript.forEach(({ text, speaker }) => {
    console.log(`${speaker}: ${text}`);
  });
});

// Listen for status changes
call.on('status', (status) => {
  console.log('Call status:', status);
});

// When done, clean up
unsubscribe();
await call.hangup();

API Reference

Constructor

new VogentCall(dialDetails, config?)

Parameters:

  • dialDetails (required):

    • sessionId (string): Unique session identifier
    • dialId (string): Unique dial/call identifier
    • token (string): Authentication token
  • config (optional):

    • baseUrl (string): API base URL (defaults to 'https://api.vogent.ai')

Example:

const call = new VogentCall(
  {
    sessionId: "session_123",
    dialId: "dial_456",
    token: "auth_token_789"
  },
  {
    baseUrl: "https://api.vogent.ai" // optional
  }
);

Methods

start()

Starts the call session. Note: This does not connect audio automatically.

await call.start();

Returns: Promise<void>


connectAudio(liveListen?)

Establishes the audio connection for the call.

const audioConn = await call.connectAudio();

Parameters:

  • liveListen (boolean, optional): Set to true for monitoring legs (e.g., humans listening to the call who the AI should not interact with). Defaults to false.

Returns: Promise<VogentAudioConn> - Audio connection handle

Example:

// Regular participant
const audioConn = await call.connectAudio();

// Monitor-only participant (live listening)
const monitorConn = await call.connectAudio(true);

monitorTranscript(callback)

Subscribes to real-time transcript updates.

const unsubscribe = call.monitorTranscript((transcript) => {
  // Handle transcript updates
});

Parameters:

  • callback (function): Called with transcript updates. Receives an array of transcript objects.

Transcript Object:

type Transcript = {
  text: string;      // The transcript text
  speaker: string;   // 'HUMAN', 'AI', or 'IVR' (if IVR detection is enabled)
}[];

Returns: () => void - Unsubscribe function

Example:

const unsubscribe = call.monitorTranscript((transcript) => {
  transcript.forEach(({ text, speaker }) => {
    if (speaker === 'AI') {
      console.log('AI said:', text);
    } else if (speaker === 'HUMAN') {
      console.log('Human said:', text);
    }
  });
});

// Later, when you want to stop monitoring
unsubscribe();

on(event, callback)

Registers an event handler for call status changes.

call.on('status', (status) => {
  console.log('Status changed:', status);
});

Parameters:

  • event (string): Currently only supports 'status'
  • callback (function): Called when the dial status changes

setPaused(paused)

Pauses or resumes the AI during the call.

await call.setPaused(true);  // Pause the AI
await call.setPaused(false); // Resume the AI

Parameters:

  • paused (boolean): true to pause the AI, false to resume

Returns: Promise<void>


hangup()

Ends the current call.

await call.hangup();

Returns: Promise<void>

Utilities

dialStatusIsComplete(status)

Helper function to check if a dial status indicates the call has completed.

import { dialStatusIsComplete } from '@vogent/vogent-web-client';

call.on('status', (status) => {
  if (dialStatusIsComplete(status)) {
    console.log('Call is complete');
    // Clean up resources
  }
});

TypeScript Support

This library is written in TypeScript and includes full type definitions.

import { VogentCall, Transcript, VogentAudioConn } from '@vogent/vogent-web-client';

Support

For more information and support: