Uncaught (in promise) Error: Non-200 status code: '429' - Error 429 (Infura RPC Endpoint)

While setting up Web3Auth getting Uncaught (in promise) Error: Non-200 status code: '429' error.

The error might look something like this:

While setting up Web3Auth, there might be cases you will be getting a JSON-RPC error, which comes from the overloading of our test node server.

In that case, we recommend you to pass on your node server in the rpcTarget value while Instantiating Web3Auth, which can be easily created by using a service like Infura, Quicknode, etc.

For EVM-Based Chains

Other than creating your own node server, for testing purposes, you can use any of the available RPC URLs for any of the EVM Chains you’re using. These RPCs can be found on Chainlist.

const web3auth = new Web3Auth({
  clientId,
  chainConfig: {
    chainNamespace: CHAIN_NAMESPACES.EIP155,
    chainId: "0x1",
    rpcTarget: "https://rpc.ankr.com/eth", // This is the public RPC we have added, please pass on your own endpoint while creating an app
  },
});

For Solana Blockchain

Quicknode can help you create your own node server. Also, Ankr has a public Solana RPC available, which you can use for testing purposes as mentioned below:

const web3auth = new Web3Auth({
  clientId,
  chainConfig: {
    chainNamespace: CHAIN_NAMESPACES.SOLANA,
    chainId: "0x1", // Please use 0x1 for Mainnet, 0x2 for Testnet, 0x3 for Devnet
    rpcTarget: "https://rpc.ankr.com/solana", // This is the public RPC we have added, please pass on your own endpoint while creating an app
  },
});

For Other Blockchains

You don’t need to pass any chainConfig other than chainNamespace. You can easily export the private key from Web3Auth in the user scope and use it for making your custom RPC Calls.

Read more about this on our documentation page.