setNetworkTopology()

setNetworkTopology({ topology: 'sfu' | 'peer' })

Compatibility:
Prebuilt
Custom

Once a call has been joined, set the call's network connection type, no matter the number of participants on a call.

Returns a Promise that resolves to an object including a workerID key paired with the identifier for the SFU instance you're connected to, or undefined if a peer connection.

Heads up!

This method is recommended for testing only. For example, if you're building a feature that appears only during either an SFU or a P2P connection, but not both, you could use setNetworkTopology() to develop in the feature-related connection type.

We don't recommend using this method in production.

setNetworkTopology() overrides Daily's default connection switching. As participants join and leave a call, Daily automatically switches between P2P and SFU connections to optimize call quality. We've analyzed lots of data from lots of video calls to determine when that switch happens. If our defaults aren't working for your use case (and that's why you're looking into this method), please reach out to us at help@daily.co. We'll have some better ideas!