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

@audiocodes/ac-bot-api

v0.6.0

Published

AudioCodes Bot API SDK

Readme

AudioCodes Bot API SDK

npm

AudioCodes Voice AI Connect is a platform that bridges telephony systems with traditional chat bots and conversational AI bots. It allows businesses to automate customer interactions, enhance engagement, and streamline workflows.

This package provides a WebSocket client for the AudiCodes Bot API, enabling developers to create bots that can interact with users in real-time over WebSocket connections.

AC Bot API WebSocket short overview

AC Bot API is a protocol that allows developers to create bots that can interact with users in real-time over WebSocket connections. It provides a way to send and receive text or voice over WebSocket connections.

How to use

The BotConversationWebSocket emits the following events:

  • conversation.start: Emitted when a session is initiated.
  • userStream: Emitted when a user stream starts, providing the audio stream and message details.
  • activity: Emitted when an activity is received.
  • end: Emitted when the conversation ends.
  • error: Emitted when an error occurs during message sending.

Here is a sample:

import {
  BotConversationWebSocket,
  BotApiWebSocket,
  BotActivity,
  BotActivityEventName,
  BotActivityType
} from '@audiocodes/ac-bot-api';

class TextEchoBot {
  constructor(private botConversation: BotConversationWebSocket) {
    this.botConversation.on('activity', (activity: BotActivity) => {
      this.handleActivity(activity);
    });
    this.botConversation.on('end', (activity) => {
      console.log('Conversation ended:', activity);
    });
  }

  private handleActivity(activity: BotActivity) {
    console.log('Received activity:', JSON.stringify(activity));
    if (activity.type === 'event') {
      if (activity.name === BotActivityEventName.start) {
        this.botConversation.playTextMessage('Welcome to sample webSocket Bot! How can I assist you today?');
        return;
      }
    }
    if (activity.type === 'message' && activity.text) {
      // delete trailing period
      const request = activity.text.toLowerCase().replace(/\.$/u, '');
      if (request === 'disconnect') {
        return this.botConversation.sendActivity([{
          type: BotActivityType.event,
          name: BotActivityEventName.hangup
        }]);
      }
      return this.botConversation.playTextMessage(activity.text);
    }
  }
}

const api = new BotApiWebSocket().listen({
  port: 8081,
  token: process.env.ACCESS_TOKEN || 'TOKEN'
}, () => {
  console.info(`Bot API listening on port ${api.port}`);
});

api.on('conversation', (conversation: BotConversationWebSocket, { initiateMessage }) => {
  console.info(`New conversation started. caller: ${initiateMessage.caller}`);
  new TextEchoBot(conversation);
});

See more detailed example in AudioCodes Bot samples repository