setNetworkTopology({ topology })
Prebuilt
Custom
Must be called after join().
For testing only. Calling setNetworkTopology() permanently overrides Daily’s automatic topology management for the duration of the call — including any sfu_switchover threshold configured on the room or domain. Once called, Daily will no longer auto-switch based on participant count.Use this only to test topology-specific behavior during development. If Daily’s defaults aren’t working for your use case, contact help@daily.co.
Parameters
'sfu' — route media through Daily’s Selective Forwarding Unit
'peer' — use direct peer-to-peer connections
Return value
Returns a Promise that resolves to an object:
Identifier of the SFU instance connected to. undefined for peer connections.
Present if the topology change failed.
Example
const { workerId } = await call.setNetworkTopology({ topology: 'sfu' });
console.log('Connected to SFU worker:', workerId);
See also