Accept multiple chain configs

Is it possible to initialize the SDK with two chain configs? For example, my app works with Ethereum Sepolia and Arbitrum Sepolia, however, if my wallet is connected to Arbitrum Sepolia and I open the app, it will request to switch to the Ethereum Sepolia network. And vice-versa.

Hi Felipe! Thank you for reaching out with your question.

It looks like you’re exploring the possibility of having the Web3Auth SDK accept multiple chain configurations for your app, which is a great use case. Currently, the SDK may not support initializing with multiple chains directly in the way you described.

However, you can manage network switching in your application by checking the connected chain and prompting the user to switch if necessary. This could be implemented in your logic based on the connected wallet’s network.

If you have any specific code snippets or configurations that you’re currently using and you’d like me to take a look at, please share them. This way, I can assist you better!

If this is a feature request, I recommend posting this on our feature request forum too for broader visibility. Feel free to let me know if you need any help with that!

Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.

Hey @felipe1
As of now, we do not support initialisation with multiple chain configs. But what you can do is keep on adding chain configs as per your wish and later on switch among them using their chainID. Please let me know if this was helpful to you.

I’m already doing this, but I would like to avoid requesting a chain change right after opening the page, as I’m using a supported chain.

Hey @felipe1
If you wish to avoid chain change then you can initialise the SDK with that chain itself.
As for initializing with multiple chain configs, that feature isn’t currently available, but it can certainly be registered as a feature request for future updates.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.