More info on the network switching page.

const { walletConnector } = useDynamicContext();

if (walletConnector.supportsNetworkSwitching()) {
  await walletConnector.switchNetwork({ networkChainId: 137 });
  console.log("Success! Network switched");
}

1440