Skip to content

v1.x.x to v2.0.0 migration guide for react-auth

This guide will help you migrate your Privy React SDK from v1.x.x to v2.0.0.

v2 is currently in beta and scheduled to be released in January 2025. To use the beta version, install the package from the beta tag:

bash
npm i @privy-io/[email protected]

Breaking changes

  • Removed the deprecated getEthersProvider and getWeb3jsProvider from the ConnectedWallet class. Use getEthereumProvider instead.
ts
const provider = await wallet.getEthersProvider(); 
const privyProvider = await wallet.getEthereumProvider(); 
const provider = new ethers.providers.Web3Provider(privyProvider); 

const provider = await wallet.getWeb3jsProvider(); 
const privyProvider = await wallet.getEthereumProvider(); 
const provider = new Web3(privyProvider); 
  • Ethereum sendTransaction method now returns a Promise<{hash: string}> instead of a Promise<TransactionReceipt>. To get the full details of the submitted transaction, use a library like viem.
tsx
const receipt = await sendTransaction({...}); 
const {hash} = await sendTransaction({...}); 
const receipt = await publicClient.waitForTransactionReceipt({hash}); 
  • Removed the experimental waitForTransactionConfirmation config option as it is the default behavior.
tsx
<PrivyProvider
  config={{
    embeddedWallets: {
      waitForTransactionConfirmation: false, 
    },
  }}
>
  ...
</PrivyProvider>