# \[Archive\] When switching networks with Wagmi

**URL:** <https://builder.metamask.io/t/archive-when-switching-networks-with-wagmi/1645>\
**Category:** Embedded Wallets (Web3Auth)\
**Created:** [December 18, 2023, 1:56am UTC](https://builder.metamask.io/t/archive-when-switching-networks-with-wagmi/1645 "2023-12-18T01:56:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jh.koo](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@jh.koo](https://builder.metamask.io/u/jh.koo)\
**Post date:** [December 18, 2023, 1:56am UTC](https://builder.metamask.io/t/archive-when-switching-networks-with-wagmi/1645/1 "2023-12-18T01:56:18Z")

</div>

> **🏛 Archived Content from Web3Auth Community**
> 
> This topic was originally posted by **jh.koo** on 12/18/2023.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

SDK Version:  
“@web3auth/ethereum-provider”: “^7.2.0”,  
“@web3auth/modal”: “^7.2.0”,  
“@web3auth/openlogin-adapter”: “^7.2.0”,  
“@web3auth/wallet-connect-v2-adapter”: “^7.2.0”,  
“@web3auth/web3auth-wagmi-connector”: “^5.0.1”,  
“@web3modal/ethereum”: “2.6.2”,  
“@web3modal/react”: “^2.6.2”,

I downloaded this.  
([https://github.com/Web3Auth/web3auth-pnp-examples/tree/main/web-modal-sdk/wagmi-examples/wagmi-modal-example](https://github.com/Web3Auth/web3auth-pnp-examples/tree/main/web-modal-sdk/wagmi-examples/wagmi-modal-example))

connected to injected with metamask

[![3](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/734ec192ea3bfa1f170ce4c0fd4cfdaba94392b2.png)
31306×876 70.5 KB
](https://web3auth.io/community/uploads/default/original/2X/a/a145da7ffb369ec4069bc5b3694506129f4cbd6f.png "3")

connected to web3auth

[![2](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/be3de865186fbbf8c78025276212732ff33a00e4.png)
21322×898 71.5 KB
](https://web3auth.io/community/uploads/default/original/2X/7/759d679196f57af144af5851948baf03ce43af0e.png "2")

both successfully changed the network.

however, the chain name of web3auth has not been changed.

The same is true when i click Polygon Network.

isSuccess and data were added from useSwitchNetwork() and checked as logs.

---

<div class="post-metadata">

**Author:** ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.io/u/vjgee)\
**Post date:** [December 18, 2023, 4:26am UTC](https://builder.metamask.io/t/archive-when-switching-networks-with-wagmi/1645/2 "2023-12-18T04:26:15Z")

</div>

@jh.koo Your issue has been forwarded to our Dev team and we will get back with an update…

---

<div class="post-metadata">

**Author:** ![vjgee](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@vjgee](https://builder.metamask.io/u/vjgee)\
**Post date:** [December 18, 2023, 4:30am UTC](https://builder.metamask.io/t/archive-when-switching-networks-with-wagmi/1645/3 "2023-12-18T04:30:49Z")

</div>

@jh.koo Did you follow the steps in the previous thread ?

 ![](https://web3auth.io/community/letter_avatar_proxy/v4/letter/j/8e7dd6/48.png)[How to switchChain() using Wagmi connectors?](https://web3auth.io/community/t/how-to-switchchain-using-wagmi-connectors/6488) [Web - Modal SDK](https://builder.metamask.io/community/c/help-pnp/pnp-modal/7)

> SDK Version: “@web3auth/ethereum-provider”: “^7.2.0”, “@web3auth/modal”: “^7.2.0”, “@web3auth/openlogin-adapter”: “^7.2.0”, “@web3auth/wallet-connect-v2-adapter”: “^7.2.0”, “@web3auth/web3auth-wagmi-connector”: “^5.0.1”, “@web3modal/ethereum”: “2.6.2”, “@web3modal/react”: “^2.6.2”, I read docs ([Using PnP Web Modal SDK | Documentation | Web3Auth](https://web3auth.io/docs/sdk/pnp/web/modal/usage#add-chain)) but Nothing is happening to me What is my problem? this my code import { mainnet } from 'wagmi/chains'; import { CHAIN\_NAMESPACES } from '@…

---

<div class="post-metadata">

**Author:** ![jh.koo](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@jh.koo](https://builder.metamask.io/u/jh.koo)\
**Post date:** [December 18, 2023, 5:01am UTC](https://builder.metamask.io/t/archive-when-switching-networks-with-wagmi/1645/4 "2023-12-18T05:01:34Z")

</div>

It was automatically resolved because I checked it late.

However, before using web3auth, I already used Wagmi to change my network.

So now I’ve tried to change the network using web3auth, but it keeps failing.

---

<div class="post-metadata">

**Author:** ![maharshi](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/maharshi/32/1525_2.png) [@maharshi](https://builder.metamask.io/u/maharshi)\
**Post date:** [January 15, 2024, 8:01pm UTC](https://builder.metamask.io/t/archive-when-switching-networks-with-wagmi/1645/5 "2024-01-15T20:01:36Z")

</div>

Hello @jh.koo,

I wanted to follow up on your query. Please have a look at the example provided [here](https://github.com/Web3Auth/web3auth-pnp-examples/tree/main/web-modal-sdk/wagmi-examples/wagmi-modal-example). After testing it locally, I can confirm that the `useSwitchNetwork` function operates seamlessly. It’s efficiently fetching and displaying the correct account addresses and balances for each chain when using injected MetaMask.

If you’re still encountering difficulties, could you please share more details about the issue? I’d be happy to assist further!

---

<div class="post-metadata">

**Author:** ![jh.koo](https://avatars.discourse-cdn.com/v4/letter/j/8e7dd6/32.png) [@jh.koo](https://builder.metamask.io/u/jh.koo)\
**Post date:** [January 17, 2024, 9:15am UTC](https://builder.metamask.io/t/archive-when-switching-networks-with-wagmi/1645/6 "2024-01-17T09:15:49Z")

</div>

Thank you for checking

However, what I inquired about is not a meta mask, but if you log in (Google) with web3auth, there will be a problem.

If i try with a metamask, the network change succeeds.  
If i try with web3auth, the network will not change.
