DOCS

localWallet

A wallet configurator for Local wallet which allows integrating a "Guest Login" experience to app.

It returns a WalletConfig object which can be used to connect the wallet to app via ConnectWallet component or useConnect hook.

Example

Usage with ConnectWallet

To allow users to connect to this wallet using the ConnectWallet component, you can add it to ThirdwebProvider 's supportedWallets prop.

<ThirdwebProvider supportedWallets={[localeWallet()]}>
  <App />
</ThirdwebProvider>;

Usage with useConnect

you can use the useConnect hook to programmatically connect to the wallet without using the ConnectWallet component.

The wallet also needs to be added in ThirdwebProvider 's supportedWallets if you want the wallet to auto-connect on next page load.

const localeWalletConfig = localeWallet();

function App() {
  const connect = useConnect();

  async function handleConnect() {
    const wallet = await connect(localeWalletConfig, options);
    console.log("connected to", wallet);
  }

  return <button onClick={handleConnect}> Connect </button>;
}

Parameters

Returns