Skip to main content

Using Web3-React V6


A demo app for web3-react V6 is available here, and source code is available too: Demo Code.


npm install @unipasswallet/web3-react-v6-connector


  • options.connect.chainId -- Default chainId.

  • options.connect.returnEmail -- If true, email will return when connect function been called.

  • options.connect.appSettings -- Config appName, appIcon and theme.

  • options.connect.rpcUrls -- Config mainnet and testnet rpc URLs. In the local development environment, you don't need to fill in, this will use our default test URLs, but in the production environment, you need to fill in with your own rpc node url.


import { providers } from "ethers";
import { Web3ReactProvider } from "@web3-react/core";

function getLibrary(provider: any): providers.Web3Provider {
return new providers.Web3Provider(provider);

export default function Layout() {
return (
<Web3ReactProvider getLibrary={getLibrary}>
<App />

import { useWeb3React } from "@web3-react/core";
import { UniPassConnector } from "@unipasswallet/web3-react-v6-connector";

export const unipassConnector = new UniPassConnector({
chainId: 80001,
returnEmail: false,
appSettings: {
appName: "Web3 React Demo app",
rpcUrls: {
mainnet: "your eth mainnet rpc url",
polygon: "your polygon mainnet rpc url",
bscMainnet: "your bsc mainnet rpc url",
rangersMainnet: "your rangers mainnet rpc url",
arbitrumMainnet: "your arbitrum mainnet rpc url",

polygonMumbai: "your polygon testnet rpc url",
goerli: "your goerli testnet rpc url",
bscTestnet: "your bsc testnet rpc url",
rangersRobin: "your rangers testnet rpc url",
arbitrumTestnet: "your arbitrum testnet rpc url",

const { active, library, activate, account, chainId, deactivate } = useWeb3React();

const connect = async () => {
try {
await activate(unipassConnector, () => {}, true);
} catch (e) {

Verify signature

For how to verify the signature on server, please refer to UniPass Verifying Messages.