Integrating with Plaid Wallet Onboard
Plaid Wallet Onboard lets you integrate multiple wallets such as Coinbase Wallet, Metamask, and more into your dApp.
A complete guide on setting up and integrating Wallet Onboard can be found in the docs. To explore a running version of Wallet Onboard, you can try out the demo.
Prerequisites
Wallet Onboard can be used in any JavaScript web dApp, but there is a React library for React applications as well.
You can read about the setup and installation process in the Wallet Onboard docs.
Example integration
Wallet Onboard returns a provider that your dApp can use to request the user’s addresses as well as signatures and transactions.
Here’s a simple example of the code used to integrate Wallet Onboard in a vanilla JavaScript dApp:
<script src="https://cdn.plaid.com/link/v2/stable/link-initialize.js"></script>
<script>
const plaidWeb3 = await Plaid.web3();
const handler = plaidWeb3.createEthereumOnboarding({
// retrieve from Plaid Dashboard
token: 'token-abc',
chain: {
rpcUrl: 'https://cloudflare-eth.com/v1/mainnet',
chainId: '0x1',
},
onSuccess: async (provider) => {
const accounts = await provider.request({ method: 'eth_accounts' });
}
});
handler.open();
</script>
For a complete overview of the configuration options and capabilities of Wallet Onboard, refer to its docs.