Skip to main content
SmallWebRTCTransport enables peer-to-peer WebRTC connections between clients and your Pipecat application. It implements bidirectional audio and video streaming using WebRTC for real-time communication. This transport is intended for lightweight implementations, particularly for local development and testing. It expects your Pipecat server to include the corresponding SmallWebRTCTransport server-side implementation.

Usage

Basic Setup

import { PipecatClient } from "@pipecat-ai/client-js";
import {
  RNSmallWebRTCTransport,
  SmallWebRTCTransportConstructorOptions,
} from '@pipecat-ai/react-native-small-webrtc-transport';
import { DailyMediaManager } from '@pipecat-ai/react-native-daily-media-manager/src';

const options: SmallWebRTCTransportConstructorOptions = {
  mediaManager: new DailyMediaManager()
};
const pcClient = new PipecatClient({
  transport: new RNSmallWebRTCTransport(options),
  enableCam: false, // Default camera off
  enableMic: true, // Default microphone on
  callbacks: {
    // Event handlers
  },
});

const connectParams: APIRequest = {
  endpoint: baseUrl + '/start'
};
await client?.startBotAndConnect(connectParams);

API Reference

The Pipecat React Native SDK leverages the Pipecat JavaScript SDK for seamless integration with React Native applications. For detailed information, please reference to the Javascript SDK docs.Just ensure you use the appropriate transport layer for React Native.

More Information