Skip to main content

Overview

With Privy, users can link an Ethereum wallet to their account to sign messages, send transactions, and interact with smart contracts in your app. Users may either use an external or an embedded wallet with Privy.

External wallets

External wallets are managed by an third-party client, such as MetaMask or Coinbase Wallet. All browser extension wallets, hardware wallets, and mobile wallets fall into this category.

Users may have multiple external wallets linked to their account. You can prompt a user to link an external wallet by calling the linkWallet method from the usePrivy hook. Alternatively, you can call link on any wallet from the wallets array returned by the useWallets hook.

Embedded wallets

Embedded wallets are wallets provisioned by Privy itself for a wallet experience that is directly embedded in your application. Embedded wallets do not require a separate wallet client, like a browser extension or a mobile app. They are designed for users of your app who may not already have an external wallet, or don't want to connect their external wallet.

Users will have at most one embedded wallet linked to their account. You can prompt a user to create an embedded wallet by calling the createWallet from the usePrivy hook. You can also pregenerate an embedded wallet for a user ahead of login.

Getting a user's linked wallets

All of a user's external and embedded wallets will be returned in the linkedAccounts array of their user object. You can determine if a wallet is embedded or external, depending on whether the walletClient field is 'privy' (embedded) or not (external).

Getting a user's connected wallets

All of a user's connected external and embedded wallets will be returned in the wallets array returned by the useWallets hook. You can determine if a wallet is linked or not by checking the linked property.