Playground

Connect smart accounts

Let users connect to their smart accounts with any wallet and unlock gas sponsorship, batched transactions, session keys and full wallet programmability.

Using prebuilt UI component

Use the prebuilt UI components to connect to smart accounts

Code
import { ConnectButton } from "thirdweb/react";

function App() {
  return (
    <>
      <ConnectButton
        client={client}
        // account abstraction options
        accountAbstraction={{ chain, sponsorGas: true }}
      />
    </>
  );
}
Preview

Build custom UI

Build your own UI to connect to smart accounts

Code
import { useConnect } from "thirdweb/react";
import { createWallet } from "thirdweb/wallets";

function App() {
  const { connect } = useConnect({
    client,
    // account abstraction options
    accountAbstraction: { chain, sponsorGas: true },
  });

  return (
    <>
      <button
        onClick={() =>
          connect(async () => {
            // any wallet connected here will be
            // converted to a smart account
            const adminWallet = inAppWallet();
            await adminWallet.connect({ client, strategy: "google" });
            return adminWallet;
          })
        }
      >
        Connect with Google
      </button>
    </>
  );
}
Preview