DailyTransport server-side implementation.
Usage
Basic Setup
API Reference
Constructor Options
boolean
default:"false"
If set to
true, the transport will buffer local audio until the bot is ready. This is useful for ensuring that bot gets any audio from the user that started before the bot is ready to process it.The
DailyTransportConstructorOptions extends the DailyFactoryOptions type that is accepted by the underlying Daily instance. These options are passed directly through to the Daily constructor. See the Daily API Reference for a complete list of options. dailyConfig.useDevicePreferenceCookies defaults to true unless you set it.While you can provide the room url and optional token as part of your
constructor options, the typical pattern is to provide them via a connection
endpoint with
startBot() or directly as part of connect(). See below.TransportConnectionParams
Onconnect(), the DailyTransport optionally takes a set of DailyCallOptions to connect to a Daily 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 matching the DailyCallOptions type. The transport also accepts room_url or dailyRoom in place of url, and dailyToken in place of token. See the client connect() documentation for more information.
Methods
For most operations, you will not interact with the transport directly. Most methods have an equivalent in thePipecatClient and should be called from the PipecatClient. However, there are a few transport-specific methods that you may need to call directly. When doing so, be sure to access your transport via the transport property of the PipecatClient instance.
-
preAuth()Gathers information about the Daily room before connecting. As a Daily-specific action, it is not exposed through thePipecatClient. Call it beforeconnect()with the sameurlandtoken(optional) that you will use onconnect(). The options you pass replace the constructor options that the transport later passes to Daily’sstartCamera()andjoin(), including thestartAudioOffandstartVideoOffvalues derived fromenableMicandenableCam, so include any of those you still need. -
getSessionInfo()Returns the Daily call client’smeetingSessionSummary()for the current session.
Media Support
DailyTransport carries the microphone, camera, screen share, bot audio, and bot video. screenShare is true only where the browser supports screen capture. See mediaSupport.
Events
The transport implements the variousPipecatClient event handlers. For Daily-specific events, you can attach listeners to the underlying Daily call client. For a list of available events, see the Daily API Reference.
DailyTransport also calls two callbacks of its own. Pass them in the PipecatClient callbacks option; in TypeScript, type that object as the exported DailyEventCallbacks:
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 thedailyCallClient 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
PipecatClient to perform the equivalent
action.More Information
Demo
Simple Chatbot Demo
Source
DailyTransportPackage
@pipecat-ai/daily-transport