WalletInitialization Error: Invalid params passed in, openlogin is not a valid adapter

My app was working fine 2-3 days ago. Suddenly this error started coming in, without changing anything.
WalletInitializationError: Invalid params passed in, openlogin is not a valid adapter

My code -

const chainConfig = { chainNamespace: "eip155", chainId: "0x530", rpcTarget: "https://evm-rpc-testnet.sei-apis.com", displayName: "Sei Testnet", blockExplorerUrl: "https://seitrace.com", ticker: "SEI", tickerName: "Sei", logo: "https://res.coinpaper.com/coinpaper/SKL_q1dnei.png", };
const privateKeyProvider = new window.EthereumProvider.EthereumPrivateKeyProvider({ config: { chainConfig } });
web3auth = new window.Modal.Web3Auth({ clientId, privateKeyProvider, sessionTime, web3AuthNetwork: "sapphire_devnet",uiConfig:{mode: 'dark',loginMethodsOrder: ["google", "facebook"],appLogo: "/img/favicon.png",appName: "Quizmatch",loginGridCol: 3, primaryButton: "externalLogin",} });
const openloginAdapter = new window.OpenloginAdapter.OpenloginAdapter({
        adapterSettings: {
            network: "testnet",
            uxMode: "popup"
        }
    });
web3auth.configureAdapter(openloginAdapter);
await web3auth.initModal();

Hi Saurav,

Thanks for providing the details. It seems like the error you’re encountering might be related to the initialization parameters or a compatibility issue with the OpenloginAdapter. Let’s confirm a few things to help troubleshoot:

  1. SDK Version - You mentioned using the “latest” version. Please confirm you’re referencing the correct and most up-to-date version using the correct format:

    <script src="https://cdn.jsdelivr.net/npm/@web3auth/modal@latest"></script>
    
  2. Initialization Code - Your initialization snippet looks almost correct. However, it’s important to ensure field names and configurations match the SDK requirements. Here are some observations:

  • Verify that privateKeyProvider should be provided in web3auth’s Adapter
  • Make sure OpenloginAdapter is imported and initialized correctly.

Kindly update your code to the following and see if the issue resolves:

const chainConfig = { chainNamespace: "eip155", chainId: "0x530", rpcTarget: "https://evm-rpc-testnet.sei-apis.com", displayName: "Sei Testnet", blockExplorerUrl: "https://seitrace.com", ticker: "SEI", tickerName: "Sei", logo: "https://res.coinpaper.com/coinpaper/SKL_q1dnei.png" };

web3auth = new window.Web3Auth.Web3Auth({ 
    clientId,
    chainConfig, // Adding chainConfig directly here
    sessionTime,
    web3AuthNetwork: "sapphire_devnet",
    uiConfig: {
        mode: 'dark',
        loginMethodsOrder: ["google", "facebook"],
        appLogo: "/img/favicon.png",
        appName: "Quizmatch",
        loginGridCol: 3,
        primaryButton: "externalLogin",
    }
});

const openloginAdapter = new window.Web3Auth.OpenloginAdapter({
    adapterSettings: {
        network: "testnet",
        uxMode: "popup"
    }
});

web3auth.configureAdapter(openloginAdapter);
await web3auth.initModal();

If the issue persists, please provide additional details such as:

  • Verifier Name: If you are using a custom authentication provider
  • Any modifications you might have made recently (if applicable)

Your screenshot will also be helpful for the team to get more context.

This response was generated by the Web3Auth Bot. A person from the Web3Auth team will also review and provide a precise answer to your query.

It seems like you changed the adapter name from openlogin to auth. :smirk:
Reverting back to v8 fixed the issue.

Hey @sau with the v9, the Openlogin adapter has been changed to Auth adapter to have better naming convention. Please install this package auth-adapter instead of openlogin-adapter. You can change the OpenloginAdapter to AuthAdapter. We’ll be soon updating docs and release a migration guide. Sorry for inconvenience.