> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daily.co/llms.txt
> Use this file to discover all available pages before exploring further.

# setNetworkTopology()

> Forces the network topology for the current call.

`setNetworkTopology({ topology })`

<Badge color="green">{"✓"} Prebuilt</Badge> <Badge color="green">{"✓"} Custom</Badge>

Must be called after `join()`.

<Warning>
  **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](mailto:help@daily.co).
</Warning>

## Parameters

<ParamField body="topology" type="'sfu' | 'peer'" required>
  * `'sfu'` — route media through Daily's Selective Forwarding Unit
  * `'peer'` — use direct peer-to-peer connections
</ParamField>

## Return value

Returns a `Promise` that resolves to an object:

<ResponseField name="workerId" type="string">
  Identifier of the SFU instance connected to. `undefined` for peer connections.
</ResponseField>

<ResponseField name="error" type="string">
  Present if the topology change failed.
</ResponseField>

## Example

```javascript theme={null}
const { workerId } = await call.setNetworkTopology({ topology: 'sfu' });
console.log('Connected to SFU worker:', workerId);
```

## See also

<CardGroup>
  <Card title="Methods" icon="code" iconType="solid">
    * [getNetworkTopology()](/reference/daily-js/instance-methods/get-network-topology)
  </Card>

  <Card title="Guides" icon="book-open" iconType="solid">
    * [Network quality](/docs/daily-js/guides/network-quality)
  </Card>

  <Card title="REST API" icon="server" iconType="solid">
    * [domain config: sfu\_switchover](/reference/rest-api/domain/set-domain-config#body-properties-sfu-switchover)
    * [room config: sfu\_switchover](/reference/rest-api/rooms/create-room#body-properties-sfu-switchover)
  </Card>
</CardGroup>
