Overview
A browser SDK for Buddy AI voice sessions — WebRTC via Daily.co and Pipecat, zero framework dependencies.
@juspay/breeze-buddy-client-sdk is the official browser SDK for integrating Buddy AI voice sessions into your web application. It wraps Daily.co’s WebRTC transport and Pipecat’s RTVI protocol into a small, typed API with zero framework dependencies — works equally well in React, Vue, Svelte, or vanilla JS.
Stability
Install
npm install @juspay/breeze-buddy-client-sdk
# or
pnpm add @juspay/breeze-buddy-client-sdk Two ways to start a session
The SDK supports two flows — pick the one that matches where your backend lives.
1. BuddyClient — SDK creates the lead
Use when you want the SDK to handle the full lifecycle: auth, lead creation via /leads, WebRTC connect.
import { BuddyClient } from '@juspay/breeze-buddy-client-sdk';
const client = new BuddyClient({
auth: { token: 'your-jwt-token' },
resellerId: 'my-reseller',
merchantId: 'my-merchant'
});
const session = await client.startSession({
templateId: 'f47ac10b-58cc-4372-a567-0e02b2c3d479',
payload: { customer_name: 'John' }
}); 2. joinRoom — your backend has already provisioned the Daily room
Use when your own server has already called clairvoyance’s /leads and /connect, and handed your frontend just the room credentials.
import { joinRoom } from '@juspay/breeze-buddy-client-sdk';
const session = await joinRoom({
roomUrl: 'https://mydomain.daily.co/room-xyz',
token: 'eyJ...'
}); No auth, no resellerId, no merchantId — joinRoom makes zero API calls.
What you get back — Session
Both flows return a Session handle with:
- Lifecycle:
close(),[Symbol.asyncDispose] - Mic control:
mute(),unmute(),setMicEnabled(bool) - Outbound:
assistantSpeak(text),sendMessage(type, data) - Events:
on(event, handler)/off(event, handler)for every session event
Head to Quickstart for an end-to-end example, or Sessions for the full reference.
When to reach for the SDK vs the raw API
| Your situation | Use |
|---|---|
| Building a browser UI that speaks to Buddy | SDK (BuddyClient or joinRoom) |
| Your server-side code creates the lead and you only need the WebRTC UI | SDK joinRoom |
| Non-browser consumer (server, mobile native) | Raw REST — see Leads |
| Custom wire-level RTVI experiments | Raw @pipecat-ai/client-js + Daily |