Error: Unsupported chain namespace

I am using “@web3auth/modal”: “^10.3.0”,
This is my code

import {
  AUTH_CONNECTION,
  CHAIN_NAMESPACES,
  CommonPrivateKeyProvider,
  IProvider,
  WALLET_CONNECTORS,
  WEB3AUTH_NETWORK,
  Web3Auth,
} from "@web3auth/modal";
import { useEffect, useState } from "react";

const clientId = "BNPm6P51gixcR2YhGlFPAh2YQ_G5tZ6oXTF1NXqfrvXuiPsfpPTML-zn1Ah66q6x55gmF_grh9qtsbD3byMPh-4";


const sentinelChainDetails = {
  blockExplorerUrl: "https://explorer.chainroot.io/sentinel",
  chainId: "sentinelhub-2",
  chainNamespace: CHAIN_NAMESPACES.OTHER,
  displayName: "Sentinel",
  logo: "https://raw.githubusercontent.com/cosmos/chain-registry/master/sentinel/images/dvpn.svg",
  rpcTarget: "https://rpc.sentinel.co:443",
  ticker: "dVPN",
  tickerName: "Sentinel",
};

const privateKeyProvider = new CommonPrivateKeyProvider({
  config: {
    chain: sentinelChainDetails,
    chains: [sentinelChainDetails],
  },
});


const web3auth = new Web3Auth({
  clientId,
  mfaLevel: "none",
  privateKeyProvider,
  web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_DEVNET,
});

await web3auth.init();

function MyApp() {
  const [provider, setProvider] = useState<IProvider | null>(null);

  const loginGoogle = async () => {
    const status = await web3auth.connectTo(WALLET_CONNECTORS.AUTH, {
      authConnection: AUTH_CONNECTION.GOOGLE,
    });
    setProvider(status);
  };

  const loginEmail = async () => {
    const status = await web3auth.connectTo(WALLET_CONNECTORS.AUTH, {
      authConnection: AUTH_CONNECTION.EMAIL_PASSWORDLESS,
      loginHint: "srinath@exidio.co",
    });
    setProvider(status);
  };

  useEffect(() => {
    console.log(web3auth, provider);
  }, [provider]);

  return (
    <div>
      <button onClick={loginGoogle}>Login with Google</button>
      <button onClick={loginEmail}>Login via Email</button>
      <button onClick={() => web3auth.logout()}>Logout</button>
    </div>
  );
}

export default function AppWrapper() {

  return (
    <MyApp />
  );
}

After login with EMAIL_PASSWORDLESS, I am getting Error: Unsupported chain namespace…
And when I login with Google: I am getting the below screen even after mfaLevel: "none",

Also, let me know how to implement this
const handleWeb3AuthConnected = useCallback(
async (event) => {
try {
console.log(“::CONNECTED::”, event);
const idToken = await window.web3auth.authenticateUser();

    const user = await window.web3auth.getUserInfo();

    const privateKey = await event.provider.request({ method: "private_key" });

    if (privateKey) {
      const appPubKey = getPublicCompressed(window.Buffer.from(privateKey.padStart(64, "0"), "hex")).toString("hex");

      const accessToken = await accountServices.fetchPublicKey({ appPubKey, idToken: idToken.idToken });
      
      const details = await accountServices.fetchUserDetailsWithPublicKey({ publicKey: `${accessToken}` });

      dispatch(
        UPDATE_AUTH_DETAILS({
          accessToken,
          address: details.sentinelAddress,
          authProvider: user.typeOfLogin,
          creditCoins: 0,
          expiredAt: details.expiredAt,
          profileImage: user.profileImage,
        })
      );
    }
  } catch (error) {
    console.log("error", error);
  }
},
[dispatch]

);

Thank you for providing detailed information and your code snippet. Here’s a summary of your issue and some guidance:


Issue Summary

Platform & SDK Details:

  • Platform: Web (React)
  • SDK: @web3auth/modal
  • SDK Version: ^10.3.0

Problem 1:
When logging in with EMAIL_PASSWORDLESS, you receive the error:

Error: Unsupported chain namespace

Problem 2:
When logging in with Google, you see an MFA (Multi-Factor Authentication) screen, even though you set mfaLevel: "none".

Custom Chain Configuration:

  • You are using a custom Cosmos chain (Sentinel) with chainNamespace: CHAIN_NAMESPACES.OTHER.

Code Provided:
You have shared your Web3Auth initialization and login methods.

Screenshot:
You included a screenshot showing the unexpected MFA prompt (not visible here, but referenced).


Analysis & Next Steps

1. Unsupported Chain Namespace Error

  • The Web3Auth Modal SDK currently supports EVM (CHAIN_NAMESPACES.EIP155) and Solana (CHAIN_NAMESPACES.SOLANA) out of the box.

  • Using CHAIN_NAMESPACES.OTHER for Cosmos-based chains (like Sentinel) is not fully supported in Plug and Play (PnP) mode. This is why you see the “Unsupported chain namespace” error.

    References:

    Solution:

    • If you need Cosmos support, you may have to use the Web3Auth Core Kit and implement a custom authentication flow.
    • For PnP Modal SDK, stick to EVM or Solana chains for now.

2. MFA Screen Appearing Despite mfaLevel: "none"

  • The mfaLevel parameter can sometimes be overridden by project-level settings on the Web3Auth Dashboard.

  • Ensure that MFA is not enforced at the dashboard/project configuration level.

  • Also, make sure you are using the correct enum value:

    import { MFA_LEVELS } from "@web3auth/modal";
    mfaLevel: MFA_LEVELS.NONE
    

    Instead of the string "none", use the enum constant.

    Reference:

    Solution:

    • Update your code to use mfaLevel: MFA_LEVELS.NONE.
    • Double-check your project settings on the Web3Auth Dashboard.

Action Items for You

  1. For Cosmos Chain Support:

    • If you need to use Sentinel (Cosmos), consider switching to Web3Auth Core Kit or check for any recent updates on Cosmos support in Modal SDK.
  2. For MFA Issue:

    • Update your mfaLevel parameter as shown above.
    • Check your project settings on the Web3Auth Dashboard to ensure MFA is not enforced.

Additional Questions (if needed):

  • Are you planning to use only Cosmos chains, or do you also need EVM/Solana support?
  • Have you checked the browser console for any additional error messages? If so, please share screenshots or logs.

Let me know if you need more detailed guidance on migrating to Core Kit or have any other questions!

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.

Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours

Please look into this.