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

# Web calls in mobile apps and other backends

> Bolna web call SDKs for React Native, Flutter, iOS and Android, plus copy-paste session routes for Node, Python, Go, Java, PHP, Ruby and C# backends.

A web call always has two parts:

* **A client SDK** in the browser or app. It opens the WebRTC audio and talks to the agent.
* **A session route** on your backend. It holds your `bn-` API key and mints one short-lived, single-use session per call.

Every client SDK below uses the same session route, the same call states, events and error codes as the [browser SDK](https://www.bolna.ai/docs/developer-resources/sdks/web-call).

## Client SDKs

| Platform | Package | Install | Repository |
| - | - | - | - |
| Web (any site, any backend) | `@bolna/web-call` | `npm install @bolna/web-call` or CDN script | [bolna-ai/web-call](https://github.com/bolna-ai/web-call) |
| React Native (iOS + Android) | `@bolna/web-call-react-native` | `npm install @bolna/web-call-react-native react-native-webrtc` | [bolna-ai/web-call-react-native](https://github.com/bolna-ai/web-call-react-native) |
| Flutter (iOS, Android, desktop) | `bolna_web_call` | `flutter pub add bolna_web_call` | [bolna-ai/web-call-flutter](https://github.com/bolna-ai/web-call-flutter) |
| iOS (Swift) | `BolnaWebCall` | Swift Package Manager | [bolna-ai/web-call-ios](https://github.com/bolna-ai/web-call-ios) |
| Android (Kotlin) | `ai.bolna:web-call` | Gradle, Maven Central | [bolna-ai/web-call-android](https://github.com/bolna-ai/web-call-android) |

React and Vue apps use the browser SDK directly. A React hook and a Vue 3 composable are in [`example/frameworks`](https://github.com/bolna-ai/web-call/tree/main/example/frameworks).

> [!NOTE]
>
> Mobile apps need microphone permission: `NSMicrophoneUsageDescription` on iOS and `RECORD_AUDIO` on Android. Each repository README lists the full platform setup.

### React Native

```ts theme={"system"}
import { BolnaWebCall } from "@bolna/web-call-react-native";

const call = new BolnaWebCall({ sessionUrl: "https://your-backend.example.com/api/bolna-session" });
call.on("state-change", (state) => console.log(state));
await call.start({ userData: { name: "Ada" } });
```

### Flutter

```dart theme={"system"}
final call = BolnaWebCall(
  SessionSource.url(Uri.parse('https://your-backend.example.com/api/bolna-session')),
  userData: {'name': 'Ada'},
);
call.onStateChange.listen(print);
await call.start();
```

### iOS

```swift theme={"system"}
let call = BolnaWebCall(source: .url(URL(string: "https://your-backend.example.com/api/bolna-session")!))
call.onStateChange = { print($0) }
try await call.start(userData: ["name": "Ada"])
```

### Android

```kotlin theme={"system"}
val call = BolnaWebCall(context, SessionSource.Url("https://your-backend.example.com/api/bolna-session"))
call.listener = object : BolnaWebCallListener {
    override fun onStateChange(state: CallState) = println(state)
}
call.start(mapOf("name" to "Ada")) // from a coroutine, after RECORD_AUDIO is granted
```

## Session route in your backend language

Your backend does not need a Bolna package. The session route is one HTTP call:

```text theme={"system"}
POST /api/bolna-session          body: {} or {"user_data": {...}}   (sent by the SDK)
  └─▶ POST https://api.bolna.ai/web-call/session
        Authorization: Bearer <BOLNA_API_KEY>
        {"agent_id": "<BOLNA_AGENT_ID>", "user_data": {...}}
```

Return Bolna's JSON and status code unchanged. A `429` must reach the SDK as a `429` so it reports `at_capacity`. Add your own user authentication to the route.

| Language | Example |
| - | - |
| Node.js (`node:http`, serves `POST /session`) | [`example/server-example.js`](https://github.com/bolna-ai/web-call/blob/main/example/server-example.js) |
| Python (FastAPI) | [`example/backends/python-fastapi`](https://github.com/bolna-ai/web-call/tree/main/example/backends/python-fastapi) |
| Go (net/http) | [`example/backends/go`](https://github.com/bolna-ai/web-call/tree/main/example/backends/go) |
| Java (JDK, Spring) | [`example/backends/java`](https://github.com/bolna-ai/web-call/tree/main/example/backends/java) |
| PHP (plain, Laravel) | [`example/backends/php`](https://github.com/bolna-ai/web-call/tree/main/example/backends/php) |
| Ruby (Sinatra, Rails) | [`example/backends/ruby-sinatra`](https://github.com/bolna-ai/web-call/tree/main/example/backends/ruby-sinatra) |
| C# (ASP.NET Core) | [`example/backends/csharp-aspnet`](https://github.com/bolna-ai/web-call/tree/main/example/backends/csharp-aspnet) |

The other examples serve `POST /api/bolna-session`, the URL used in the quick starts above. Point `sessionUrl` at whichever path your route uses. Each example reads `BOLNA_API_KEY` and `BOLNA_AGENT_ID` from the environment. The [backends README](https://github.com/bolna-ai/web-call/tree/main/example/backends) shows how to run each one.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.