Skip to main content
The LiveKitTransport class provides a WebRTC transport layer using LiveKit’s infrastructure. It wraps a LiveKit client to handle audio/video device management, WebRTC connections, and real-time communication between clients and bots. For complete documentation on LiveKit’s API, see the LiveKit Client SDK Reference. This transport is designed for production use cases, leveraging LiveKit’s infrastructure for low-latency, high-quality audio and video streaming. It expects your Pipecat server to include the corresponding LiveKitTransport server-side implementation.

Installation

Usage

Basic Setup

API Reference

Constructor Options

LiveKitTransportConstructorOptions is the RoomOptions type from the livekit-client library. These options are passed directly through to the LiveKit Room constructor. See the LiveKit RoomOptions documentation for a complete list of options.

TransportConnectionParams

On connect(), the LiveKitTransport requires a url and token to connect to a LiveKit room. This can be provided directly to the PipecatClient’s connect() method or via a starting endpoint passed to the PipecatClient’s startBotAndConnect() method. If using an endpoint, your endpoint should return a JSON object with url, token, and optional roomConnectionOptions. See the client connect() documentation for more information.
string
required
The WebSocket URL of your LiveKit server (e.g., wss://your-server.livekit.cloud).
string
required
Authentication token for the LiveKit room. Generate this on your server using LiveKit’s access token API.
RoomConnectOptions
Optional LiveKit room connection options. See the LiveKit RoomConnectOptions documentation for available options.

Media Support

LiveKitTransport carries the microphone, camera, screen share, bot audio, and bot video. screenShare is true only where the browser provides getDisplayMedia, which most mobile browsers, including iOS Safari, don’t. See mediaSupport.

Events

The transport implements the various PipecatClient event handlers. It does not expose the underlying LiveKit Room, so LiveKit-specific room events are not available through it.

More Information

LiveKit Docs

Official LiveKit Documentation

Source

LiveKitTransport

Package

@pipecat-ai/livekit-transport

Choosing a Transport

Transport Selection Guide