← Protocols
Thirdweb Connect
01Description

All-in-one onboarding kit: 350+ wallet connectors, in-app email/social wallets, ERC-4337 smart accounts, and pay/onramp — all driven by a single `<ConnectButton />`. Works across EVM and Solana via the v5 SDK.

02Best for
  • 01drop-in connect button
  • 02in-app wallets with social/email
  • 03smart accounts (ERC-4337)
  • 04fiat onramp + pay
  • 05broad wallet connector coverage
03Install
  • pnpm add thirdweb
04Environment variables
VariableScopeDescription
NEXT_PUBLIC_THIRDWEB_CLIENT_IDClientThirdweb client ID for browser usage. Domain-restricted via the dashboard.
THIRDWEB_SECRET_KEYServerThirdweb secret key for server-side SDK calls (engine, auth, gasless). Never expose to the client.
05Prompt snippet
Use Thirdweb v5 for wallet connect, in-app wallets, and smart accounts. Create a client with `createThirdwebClient({ clientId: process.env.NEXT_PUBLIC_THIRDWEB_CLIENT_ID! })` and wrap the app in `<ThirdwebProvider>`. Drop in `<ConnectButton client={client} wallets={[inAppWallet({ auth: { options: ['google','email','passkey'] } }), createWallet('io.metamask')]} accountAbstraction={{ chain, sponsorGas: true }} />`. Read connection state via `useActiveAccount()`, `useActiveWallet()`, and `useWalletBalance()`. For server actions, instantiate the client with `secretKey: process.env.THIRDWEB_SECRET_KEY` and use `engine` / `Auth` modules. Gate domains in the dashboard for the client ID.
06Gotchas
  • v5 (`thirdweb`) and v4 (`@thirdweb-dev/react`) are incompatible APIs — copy/pasting v4 snippets into a v5 project results in runtime crashes. Verify the import path.
  • Smart-account addresses depend on the configured factory; switching `accountAbstraction.factoryAddress` produces a *new* address and orphans prior assets.
  • Client ID is domain-locked via dashboard — local dev, preview, and prod each need explicit entries or `ConnectButton` errors with a generic 401.
  • Solana support in v5 uses a separate set of imports from `thirdweb/wallets/in-app`; not every connector available on EVM is available on Solana.
  • Gas sponsorship counts against your dashboard credits — without spending limits, a viral mint can drain your balance in minutes. Set caps before launch.
07Alternatives