Skip to content

Joining & Creating Calls

This guide explains how to configure and join a call with the Stream Video ESP32 SDK. The SDK handles coordinator connection, join call (REST), SFU WebSocket, and publishing; you pass join parameters and optional callbacks.

Join parameters

When calling stream_video_join_call, you pass stream_video_join_call_params_t. The app must obtain auth data (userId, apiKey, token) from its own backend or Stream's token service and pass it in auth_data. The SDK does not fetch tokens.

Field Type Description
auth_data const stream_video_auth_data_t * Auth data from your token service (required). Must contain valid user_id, api_key, and token.
call_type const char * Call type (e.g. "default").
call_id const char * Call ID; NULL to create a new call.
create bool If true, create the call if it does not exist.
location const char * Optional location hint; NULL for auto.
result_cb stream_video_join_result_cb_t Called with join success or failure (optional).
user_data void * User context for result_cb.
mute_audio bool If true, do not publish audio.
mute_video bool If true, do not publish video.

Publishing starts automatically after the SFU join response.

User and environment (for token service)

When your app calls the token service, you typically pass a user ID and environment (e.g. in the minimal example's STREAM_USER_ID and STREAM_ENVIRONMENT). These are used only for the token request; the SDK only receives the resulting auth_data. See Client auth for the token endpoint and response format.

Call selection

Call type

#define STREAM_CALL_TYPE "default"  // or "livestream", etc.

Call ID

Option 1: Join existing call

#define STREAM_CALL_ID "call123"  // Join this specific call

Option 2: Create new call

#define STREAM_CALL_ID NULL  // Create a new call (use with create=true in join params)

If STREAM_CALL_ID is set, the SDK joins that call. If STREAM_CALL_ID is NULL and create is true in join params, the backend creates a new call.

SDK-managed flow

The app only calls:

  1. stream_video_init()
  2. stream_video_join_call(&params, &client) with the above configuration
  3. stream_video_leave_call(client) when done
  4. stream_video_deinit() to tear down

The app fetches auth data (e.g. via app_request_auth_data) before calling join. The SDK uses that auth data and then: connects to coordinator → joins call via REST → connects to SFU → starts publishing after SFU join response.

WiFi and other options

  • WiFi — SSID and password are set via sdkconfig.defaults or idf.py menuconfig under "Stream Video Example".
  • Runtime configuration — Currently configuration is compile-time (#define). For runtime configuration you could use NVS, serial, or menuconfig.

Next steps