> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pipecat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# SmallWebRTCTransport

> A lightweight WebRTC transport for peer-to-peer connections with Pipecat for iOS

`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. It expects your Pipecat server to include the corresponding [`SmallWebRTCTransport` server-side](/api-reference/server/services/transport/small-webrtc) implementation.

## Installation

Add the `SmallWebRTCTransport` package to your project:

```swift theme={null}
.package(url: "https://github.com/pipecat-ai/pipecat-client-ios-small-webrtc.git", from: "0.0.1")

// Add to your target dependencies
.target(name: "YourApp", dependencies: [
    .product(name: "PipecatClientIOSSmallWebrtc", package: "pipecat-client-ios-small-webrtc")
])
```

## Usage

Create a client using the `SmallWebRTCTransport`:

```swift theme={null}
import PipecatClientIOS
import PipecatClientIOSSmallWebrtc

let rtviClientOptions = RTVIClientOptions.init(
    enableMic: currentSettings.enableMic,
    enableCam: currentSettings.enableCam,
    params: RTVIClientParams(
        config: [
            .init(
                service: SmallWebRTCTransport.SERVICE_NAME,
                options: [
                    .init(name: "server_url", value: .string($PIPECAT_SERVER_URL))
                ]
            )
        ]
    )
)
self.rtviClientIOS = RTVIClient.init(
    transport: SmallWebRTCTransport.init(options: rtviClientOptions),
    options: rtviClientOptions
)
self.rtviClientIOS?.start() { result in
    switch result {
    case .failure(let error):
        // handle error
    case .success(_):
        // handle success
    }
}
```

## API Reference

<CardGroup cols={2}>
  <Card horizontal title="Demo" icon="play" href="https://github.com/pipecat-ai/pipecat-examples/tree/main/p2p-webrtc/video-transform/client/ios">
    Video transform Demo
  </Card>

  <Card horizontal title="Source" icon="github" href="https://github.com/pipecat-ai/pipecat-client-ios-small-webrtc/">
    Small WebRTC transport
  </Card>
</CardGroup>

<Card title="SmallWebRTCTransport Reference" icon="book-open" href="https://docs-ios.pipecat.ai/PipecatClientIOSSmallWebrtc/documentation/pipecatclientiossmallwebrtc">
  Complete API documentation for the Small WebRTC transport implementation
</Card>
