# Example Configuration

This guide explains how to configure the minimal example: token service, user, environment, call, and publishing. The main app logic lives in **main.c**.

## Configuration options

1. **Token service** — Where the app fetches the token (your backend or Stream's)
2. **User / environment** — Passed to the token service (user_id, environment name)
3. **Call selection** — Which call to join (call_type and call_id)
4. **Publishing** — Mute audio/video flags

## Configuration in main.c

Edit the configuration section near the top of `examples/minimal/main/main.c`:

```c
// Token service (app fetches token, then passes to SDK)
#define STREAM_AUTH_BASE_URL "https://pronto.getstream.io/"  // Your backend or Stream's token service
#define STREAM_ENVIRONMENT "pronto"   // "production", "staging", or "pronto"
#define STREAM_USER_ID "esp32_user"   // User ID (can be NULL for auto-generated)

// Call selection
#define STREAM_CALL_TYPE "default"    // Call type (e.g., "default", "livestream")
#define STREAM_CALL_ID "abcd" // Call ID to join (can be NULL to create new call)
```

Flow:

1. The app calls `app_request_auth_data(STREAM_AUTH_BASE_URL, STREAM_ENVIRONMENT, STREAM_USER_ID, exp, &auth_data)` to get auth data from the token service.
2. The app passes `auth_data` in `stream_video_join_call_params_t.auth_data` to `stream_video_join_call()`.
3. The SDK uses that auth data for coordinator, joinCall, and SFU; it does not fetch the token.

Join parameters:

- **auth_data** — From your token fetch (required). Must contain valid `user_id`, `api_key`, and `token`.
- **call_type** — From `STREAM_CALL_TYPE`
- **call_id** — From `STREAM_CALL_ID` (or `NULL` to create a new call)
- **create** — Set to `true` to create the call if it does not exist
- **result_cb** — Callback with join success or failure
- **mute_audio** / **mute_video** — Set to mute publishing

## Complete flow

1. `stream_video_init()`
2. Fetch token: `app_request_auth_data(..., &auth_data)`
3. `stream_video_join_call(&params, &client)` with `params.auth_data = &auth_data`
4. `stream_video_leave_call(client)` when done
5. `stream_video_deinit()`

## WiFi and SDK options

- **WiFi** — SSID and password can be configured through `idf.py menuconfig`. Open the menu with:

```bash
idf.py menuconfig
```

Navigate to **Component config**:

![Component config](https://getstream.io/docs-assets/images/f1035d8605dd.png)

Then select **Stream Video Example**:

![Stream Video Example](https://getstream.io/docs-assets/images/cfa0c8d9e50f.png)

Here you can set your **WiFi SSID** and **WiFi password**:

![WiFi password configuration](https://getstream.io/docs-assets/images/453428842c90.png)

Alternatively, you can set these values directly in `sdkconfig.defaults`.

- **Token service URL** — Change `STREAM_AUTH_BASE_URL` to point to your own backend that returns `{ userId, apiKey, token }`. See [Client auth](https://getstream.io/video/docs/esp32/guides/client-auth/).
- **Video, audio, board, ICE** — All SDK options (resolution, bitrate, board, STUN/TURN, etc.) are under **Stream Video SDK** in menuconfig. See [SDK configuration](https://getstream.io/video/docs/esp32/guides/sdk-configuration/).

---

For the most recent version of this documentation, visit [https://getstream.io/video/docs/esp32/guides/example-configuration/](https://getstream.io/video/docs/esp32/guides/example-configuration/).