Skip to main content

useCoinbaseWallet() function

Hook for connecting to a Coinbase wallet.

import { useCoinbaseWallet } from "@thirdweb-dev/react";

Example

We can allow users to connect with Coinbase Wallet as follows:

import { useCoinbaseWallet } from "@thirdweb-dev/react";

const App = () => {
const connectWithCoinbaseWallet = useCoinbaseWallet();

return (
<button onClick={connectWithCoinbaseWallet}>Connect Coinbase Wallet</button>
);
};

Upon clicking this button, users will be prompted with a popup asking them scan a QR code with their Coinbase Wallet. Once they scan the QR code, their wallet will then be connected to the page as expected.

Signature:

export declare function useCoinbaseWallet(): () => Promise<{
data?: import("wagmi").ConnectorData<any> | undefined;
error?: Error | undefined;
}>;

Returns:

() => Promise<{ data?: import("wagmi").ConnectorData<any> | undefined; error?: Error | undefined; }>