Daily WebRTC Transport
The DailyTransport class provides a WebRTC transport layer using Daily.co’s infrastructure. It handles audio/video device management, WebRTC connections, and real-time communication between clients and bots.
Usage
Basic Setup
API Reference
Constructor Options
-
dailyFactoryOptions
These options are passed directly through to the Daily constructor. See the Daily API Reference for a complete list of options.
The room url and optional token required for a Daily call should be provided by your connection endpoint in the form of room_url
and token
respectively. The RTVI client will pass the response from your connection endpoint as-is to the DailyTransport as part of its connect()
process. See the baseUrl and connect endpoint documentation for more information.
States
The transport can be in one of these states:
Methods
Most methods have an equivalent in the RTVI client. The transport is designed to be used with the RTVI client, so in most cases you should use the RTVI client methods to interact with the transport, rather than calling these methods directly. This is especially true for initialize()
, connect()
, and disconnect()
.
-
preAuth()
This is the one method meant to be called directly, which is used to allow you to gather information about the Daily room prior to connecting. As a Daily-specific action, it is not exposed through the RTVI client. This method must be called prior to
connect()
and use the same room_url and token (optional) as what will be returned by your connection endpoint.
Events
The transport implements the various RTVI event handlers. These events will not fire until the transport has been attached to an RTVIClient.
Advanced
Accessing the Daily Call
For advanced use cases, where you may need to work with the Daily call client directly, you can access it via the dailyCallClient
property.
The Daily call client returned is safe-guarded to not allow you to call functions which affect the call’s lifecycle and will redirect you to use either a Transport method or the RTVI client to perform the equivalent action.
More Information
Package
@pipecat-ai/daily-transport