I am having the same issues. I was thinking of creating multiple connector instances, but I feel there should be a better way. Perhaps another solution is dynamically changing the config created from wagmi’s createConfig.
@vjgee
My question specifically refers to using web3auth-wagmi-connector with the NoModal SDK to connect to multiple providers dynamically.
Is using these two packages together supported?
Also, for email specifically: the email address is inherently dynamic. How to pass it after initializing the connector such that:
Web3AuthConnector({
web3AuthInstance,
// Cannot pass this directly at initialization, need to pass it later when user entered email address
loginParams: {
loginProvider: LOGIN_PROVIDER.EMAIL_PASSWORDLESS,
extraLoginOptions: {
login_hint: 'address@email.com'
},
},
}),
Yes, it’s entirely possible to use the NoModal SDK in conjunction with the web3auth-wagmi-connector. For an implementation example showcasing this integration, you might want to check out our example here: Wagmi No Modal Example.
Regarding your question about dynamically setting the email address for the email passwordless login option, you can indeed modify the initialization process to accommodate this. Here’s how you can adjust your Web3AuthConnectorInstance function to make the login_hint dynamic based on user input, such as an email address:
// Modify the function to accept userEmail as an argument
export default function Web3AuthConnectorInstance(chains: Chain[], userEmail: string) {
// Rest of the code
return Web3AuthConnector({
web3AuthInstance,
loginParams: {
loginProvider: LOGIN_PROVIDER.EMAIL_PASSWORDLESS,
extraLoginOptions: {
login_hint: userEmail, // Now dynamically set based on user input
},
},
});
}
With this modification, you can pass the user’s email dynamically to the Web3AuthConnectorInstance function as they enter it, allowing for a more tailored and dynamic login process.
I hope this addresses your queries. Should you have any more questions or need further clarification, feel free to reach out!
Thank you, @jonwayhuang, for sharing your solution with the community. We genuinely appreciate users like you who contribute to making our developer community more self-sufficient and collaborative.
Hey @afarley, given the solutions now available (albeit just a couple), are you still encountering the issue? Please don’t hesitate to inform us if you’re facing any further difficulties or if there’s more we can do to assist you.