# \[Archive\] getUserInfo using Wagmi

**URL:** <https://builder.metamask.io/t/archive-getuserinfo-using-wagmi/1249>\
**Category:** Embedded Wallets (Web3Auth)\
**Created:** [September 2, 2024, 7:12am UTC](https://builder.metamask.io/t/archive-getuserinfo-using-wagmi/1249 "2024-09-02T07:12:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mitevandon94](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@mitevandon94](https://builder.metamask.io/u/mitevandon94)\
**Post date:** [September 2, 2024, 7:12am UTC](https://builder.metamask.io/t/archive-getuserinfo-using-wagmi/1249/1 "2024-09-02T07:12:59Z")

</div>

> **🏛 Archived Content from Web3Auth Community**
> 
> This topic was originally posted by **mitevandon94** on 9/2/2024.  
> This content has been migrated from our previous community forum to preserve valuable discussions.

* * *

I’m usiggin following packages:

“@web3auth/base”: “^8.12.4”,  
“@web3auth/default-evm-adapter”: “^8.12.4”,  
“@web3auth/ethereum-provider”: “^8.12.4”,  
“@web3auth/modal”: “^8.12.7”,  
“@web3auth/modal-react-hooks”: “^8.13.0”,  
“@web3auth/wallet-services-plugin”: “^8.12.5”,  
“@web3auth/wallet-services-plugin-react-hooks”: “^8.12.5”,  
“@web3auth/web3auth-wagmi-connector”: “^6.0.0”,

And this is my web3auth setup

[https://pastebin.com/r5PjU7TF](https://pastebin.com/r5PjU7TF)

My wagmi setup:

 ![](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/1X/193b81753f464f04dbdac2ad15ee19639aa212f3.png)

```
  <a href="https://pastebin.com/NiKXdQUz" target="_blank" rel="noopener nofollow ugc">Pastebin</a>

```

### ['use client';import Web3AuthConnectorInstance from '@/lib/config/web3Auth'; -...](https://pastebin.com/NiKXdQUz)

Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

And they both are wrapping the applicaiton.

Then i’m trying to access:

```auto
const { userInfo } = useWeb3Auth();

```

but it throws error: `WalletInitializationError: undefined, usage of useWeb3Auth not wrapped in `Web3AuthContextProvider`.`

do i need to wrap it when using wagmi, is there any example of doing this?

---

<div class="post-metadata">

**Author:** ![w3abot](https://avatars.discourse-cdn.com/v4/letter/w/4da419/32.png) [@w3abot](https://builder.metamask.io/u/w3abot)\
**Post date:** [September 2, 2024, 7:14am UTC](https://builder.metamask.io/t/archive-getuserinfo-using-wagmi/1249/2 "2024-09-02T07:14:36Z")

</div>

Hi am3136,

Thanks for providing the details. It looks like you’re integrating Web3Auth with Wagmi and encountering an error related to the `useWeb3Auth` hook not being wrapped in the `Web3AuthContextProvider`.

Here’s a quick breakdown of the issue and a possible solution:

### Issue:

You’re seeing the error:

```auto
WalletInitializationError: undefined, usage of useWeb3Auth not wrapped in Web3AuthContextProvider

```

This suggests that `useWeb3Auth` is being called outside of the `Web3AuthContextProvider`.

### Proposed Solution:

Yes, you do need to wrap your components using Web3Auth-related hooks with the `Web3AuthContextProvider`. This ensures that the context required by these hooks is available.

### Example:

Wrap your application with the `Web3AuthContextProvider` in your main component file (e.g., `App.js` or `index.js`).

Here’s an example of how you can structure it:

```jsx
import { Web3AuthContextProvider } from "@web3auth/modal-react-hooks";
// Other imports...
const App = () => (
<Web3AuthContextProvider>
{/* Your wagmi setup goes here */}
<YourComponent />
</Web3AuthContextProvider>
);

```

Make sure that in your component where you use the `useWeb3Auth` hook, it is within the hierarchy of the `Web3AuthContextProvider`.

If you still face issues, please ensure that all your setup and configuration are correct as shown in the links you provided. Double-check that none of the setup steps are skipped and all necessary providers are wrapping your application.

This response was generated by the Web3Auth Bot. A person from the Web3Auth team will review and give a detailed answer to your query shortly.

---

<div class="post-metadata">

**Author:** ![yashovardhan](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/yashovardhan/32/1526_2.png) [@yashovardhan](https://builder.metamask.io/u/yashovardhan)\
**Post date:** [September 2, 2024, 12:16pm UTC](https://builder.metamask.io/t/archive-getuserinfo-using-wagmi/1249/3 "2024-09-02T12:16:59Z")

</div>

The userInfo function is not compatible with Wagmi. Additionally, our hooks package cannot be used with Wagmi. You need to use the wagmi connector in order to use Web3Auth inside the wagmi context: [Wagmi Connector for Web3Auth PnP Web SDKs | Documentation | Web3Auth](https://web3auth.io/docs/sdk/pnp/web/wagmi-connector)

---

<div class="post-metadata">

**Author:** ![mitevandon94](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@mitevandon94](https://builder.metamask.io/u/mitevandon94)\
**Post date:** [September 2, 2024, 2:07pm UTC](https://builder.metamask.io/t/archive-getuserinfo-using-wagmi/1249/4 "2024-09-02T14:07:34Z")

</div>

@yashovardhan I did actually manage to get user info when user sign in with social:

useAsyncEffect(async () =\> {  
if (!account.address) {  
return;  
}

```
const userInfo = await web3AuthInstance.getUserInfo();

```

}, [account.address]);

but i don’t see for example twitter handle to be returned is it possible to get it somehow?

---

<div class="post-metadata">

**Author:** ![yashovardhan](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/yashovardhan/32/1526_2.png) [@yashovardhan](https://builder.metamask.io/u/yashovardhan)\
**Post date:** [September 3, 2024, 8:35am UTC](https://builder.metamask.io/t/archive-getuserinfo-using-wagmi/1249/5 "2024-09-03T08:35:43Z")

</div>

In this case, you are not using wagmi instance as I see. The user info function basically is an extension of the information given to us by the social login, ie. twitter in this case. If you cannot see the handle, it is because twitter is not sending it to us. You can configure your own twitter OAuth using Auth0, Firebase etc. and configure what parameters are given by twitter to facilitate that.
