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.

FieldTypeDescription
auth_dataconst stream_video_auth_data_t *Auth data from your token service (required). Must contain valid user_id, api_key, and token.
call_typeconst char *Call type (e.g. "default").
call_idconst char *Call ID; NULL to create a new call.
createboolIf true, create the call if it does not exist.
locationconst char *Optional location hint; NULL for auto.
result_cbstream_video_join_result_cb_tCalled with join success or failure (optional).
user_datavoid *User context for result_cb.
mute_audioboolIf true, do not publish audio.
mute_videoboolIf 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