autoConnect

Attempts to automatically connect to the last connected wallet. It combines both specified wallets and installed wallet providers that aren't already specified.

Example

import { autoConnect } from "thirdweb/wallets";
const autoConnected = await autoConnect({
client,
onConnect: (wallet) => {
console.log("wallet", wallet);
},
});
function autoConnect(
props: AutoConnectProps & { wallets?: Array<Wallet> },
): Promise<boolean>;

Parameters

The auto-connect configuration properties

Type

let props: AutoConnectProps & { wallets?: Array<Wallet> };

Returns

let returnType: Promise<boolean>;

a promise resolving to true or false depending on whether the auto connect function connected to a wallet or not