Connect External Wallets
One of the most interesting capabilities of Web3Auth includes the ability to directly connect to external wallet providers like MetaMask,
WalletConnect, Coinbase and more, enabling seamless onboarding of crypto native alongside the social login aspect for non crypto native users. This
allows your application to be able to support all the required authentication flows with just a simple integration. These capabilities are enabled by
our modular SDK, where each login provider is an adapter
that can be plugged into the SDK.
Please note that these capabilities of connecting to multiple wallets is only available for the Web SDKs, currently these adapters are not available for Mobile and Gaming SDKs.
Currently Web3Auth support the following wallets, please go to their respective SDK References to integrate them into your project:
Understanding Adapters
Adapters are essentially connectors between Web3Auth and the underlying wallet provider. For example, an adapter for connecting with torus wallet is available under web3auth as @web3auth/torus-evm-adapter. Every adapter follows a common interface which is required by Web3Auth to communicate with the wallet.
An adapter emits certain events like CONNECTED
, CONNECTING
and DISCONNECTED
etc during login lifecycle of a user. Each adapter exposes provider
on successful user login which can be used to invoke RPC calls on wallet and on connected blockchain.
Hence, adapters are needed to connect your Web3Auth instance to a wallet provider. Web3Auth by default contains a pre-configured list of login
adapters. It also provides flexibility to add/remove adapters or to use some existing adapter with custom configurations. To configure an adapter
create an instance of the adapter by using its corresponding package and pass the returned adapter instance in the configureAdapter
function.
For example, to configure openlogin adapter,
- Import the
OpenloginAdapter
from the@web3auth/openlogin-adapter
package. - Create an instance of the adapter along with the configuration
- Pass the returned instance to
web3auth.configureAdapter
as shown in the example below.
import { OpenloginAdapter } from "@web3auth/openlogin-adapter";
const openloginAdapter = await OpenloginAdapter({
adapterSettings: {
network: "sapphire_mainnet",
uxMode: "popup",
},
});
web3auth.configureAdapter(openloginAdapter);
Currently Available Wallet Adapters
By default Web3Auth's modal UI supports a set of default adapters depending on the authMode
being used. By default, Web3Auth requires basic
configuration client_id
, and registering a redirect if you are using CustomAuth adapter from the dashboard.
The table below summarizes all the available adapters and their properties
Adapter | AuthMode | ChainNamespace | Default | Package Name |
---|---|---|---|---|
openlogin | WALLET , DAPP | EIP155 ,SOLANA | YES | @web3auth/openlogin-adapter |
torus-evm | DAPP | EIP155 | YES | @web3auth/torus-evm-adapter |
torus-solana | DAPP | SOLANA | YES | @web3auth/torus-solana-adapter |
metamask | DAPP | EIP155 | YES | @web3auth/metamask-adapter |
phantom | DAPP | SOLANA | YES | @web3auth/phantom-adapter |
walletconnect-v1 | DAPP | EIP155 | YES | @web3auth/wallet-connect-v1-adapter |
coinbase | DAPP | EIP155 | YES | @web3auth/coinbase |
slope | DAPP | SOLANA | YES | @web3auth/slope |
solflare | DAPP | SOLANA | YES | @web3auth/solflare |
Types of Wallet Adapters
Currently Web3Auth supports two categories of wallet adapters:
IN_APP
Application WalletsEXTERNAL
External Wallets
Application Wallets
- Application wallets are those wallets which are scoped to dApp. This means that if you are logging in with the same application wallet on different applications, you will get different wallets (private keys).
openlogin
,torus-evm
andtorus-solana
are Application Wallets.
External Wallets
- External wallet are those which are global for all applications. No matter where you are logging in, you will get same wallets if same credentials are being provided.
metamask
,phantom
andwalletconnect-v1
,coinbase
,slope
,solflare
are External Wallets in Web3Auth.
To know more about Adapter, checkout our SDK Reference, where we have specifically mentioned all the available adapters and their properties.