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:
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:
import { Web3AuthContextProvider } from "@web3auth/modal-react-hooks";
// Other imports...
const App = () => (
<Web3AuthContextProvider>
{/* Your wagmi setup goes here */}
<YourComponent />
</Web3AuthContextProvider>
);
export default App;
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.
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.