🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@pipecat-ai/websocket-transport

Package Overview
Dependencies
Maintainers
7
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pipecat-ai/websocket-transport

Pipecat Base Transport for RealTime WebSocket APIs Package

latest
Source
npmnpm
Version
1.4.0
Version published
Maintainers
7
Created
Source

Websocket Transport

Demo NPM Version

Websocket transport package for use with @pipecat-ai/client-js.

Installation

npm install \
@pipecat-ai/client-js \
@pipecat-ai/websocket-transport

Overview

The WebSocketTransport class provides a Websocket transport layer establishing a connection with Pipecat WebSocketTransport. It handles audio device management and real-time communication between client and bot.

Features

  • 🎤 Microphone input handling
  • 🤖 Bot participant tracking
  • đź’¬ Real-time messaging

Usage

Basic Setup

import { PipecatClient } from "@pipecat-ai/client-js";
import { WebSocketTransport } from "@pipecat-ai/websocket-transport";

const pcClient = new PipecatClient({
    transport: new WebSocketTransport(),
    enableMic: true,   // Default microphone on
    callbacks: {
      // Event handlers
    },
});

pcClient.connect({
  ws_url: 'https://your.websocket/endpoint'
});
// OR...
pcClient.connect({
  endpoint: 'https://your-server/connect', // endpoint to return ws_url
});

API Reference

States

The transport can be in one of these states:

  • "initializing"
  • "initialized"
  • "connecting"
  • "connected"
  • "ready"
  • "disconnecting"
  • "error"

Events

The transport implements the various Pipecat event handlers. Check out the docs or samples for more info.

Error Handling

The transport includes error handling for:

  • Connection failures
  • Device errors

License

BSD-2 Clause

FAQs

Package last updated on 30 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts