Migrating to 2.0
This guide will help you migrate your Privy React SDK from v1.x.x to v2.0.0.
To install the latest version, install the package from the latest
tag:
New features and improvements 🎉
- Removed ethers v5 dependency, allowing developers to more easily use ethers v6
- Added support for submitting transactions without waiting for confirmation
- Added UIs for Ethereum signTransaction
For the full set of changes check out our changelog.
Breaking changes
Authentication
-
Guaranteed that
user.wallet
is the first linked wallet on the user object. To maintain state of the latest connected wallet, interact with the wallets array directly. -
Removed the
forkSession
method. This feature was experimental and has been removed. -
Removed the
PrivyProvider
’s deprecatedonSuccess
prop - use theonSuccess
callback registered via theuseLogin
hook instead.
Embedded wallets
-
Apps using custom auth providers must now explicitly configure wallet UIs in the dashboard, or use the updated
showWalletUIs
option. -
Removed the
PrivyProvider
’s deprecatedcreatePrivyWalletOnLogin
prop. Useconfig.embeddedWallets.createOnLogin
instead.
- Removed the deprecated
additionalChains
andrpcConfig
props fromPrivyProvider
config, please configure these via thesupportedChains
- Removed the deprecated
noPromptOnSignature
configuration option. Configure wallet UIs in the dashboard, or use the updatedshowWalletUIs
option.
EVM
- Removed the deprecated
getEthersProvider
andgetWeb3jsProvider
from theConnectedWallet
class. UsegetEthereumProvider
instead.
- Ethereum
sendTransaction
method now returns aPromise<{hash: string}>
instead of aPromise<TransactionReceipt>
. To get the full details of the submitted transaction, use a library like viem.
- Removed the experimental
waitForTransactionConfirmation
config option as it is the default behavior.
- Updated
signMessage
,signTypedData
,sendTransaction
, andsignTransaction
methods:
Smart Wallets
- Updated
signMessage
,signTypedData
, andsendTransaction
methods of the smart wallet client:
Solana
- Migrated
useSendSolanaTransaction
from@privy-io/react-auth
touseSendTransaction
from@privy-io/react-auth/solana
(Solana-specific export path)
- Removed
sendSolanaTransaction
fromusePrivy
in favor of exportingsendTransaction
fromuseSendTransaction
from@privy-io/react-auth/solana
- Removed
delegateWalletAction
fromuseSolanaWallets
. UsedelegateWallet
fromuseDelegatedActions
instead.
- Removed rpcUrl from
fundWallet
fromuseSolanaWallets
. Set rpcUrl inconfig.solanaClusters
prop of thePrivyProvider
instead
Connectors
- Removed the
setActiveWallet
method - use thewallets
array directly to interact with wallets.
Callbacks
- Updated all non-error callbacks to use named arguments instead of positional arguments.
Was this page helpful?