useAddFunds hook in @privy-io/react-auth that opens the onramp modal, a single flow covering every configured funding method.
Your app can use this hook to let authenticated users fund a destination wallet with fiat, crypto, or both. When both methods are configured, Privy shows a method picker before starting the selected flow. When only one method is configured, Privy starts that flow directly.
useAddFunds is currently only available on React. For React Native apps, use useFundWallet or
useFundSolanaWallet from @privy-io/expo/ui for card-based fiat
onramp flows. For crypto deposits, use the crypto
deposits API.Prerequisites
Enable card and bank funding methods on the Account Funding page in the Privy Dashboard. See the configuration guide for details.Access the hook
Import and initializeuseAddFunds:
Start an onramp modal flow
CalladdFunds with a destination wallet and at least one funding method config.
destination.chain accepts a CAIP-2 identifier (for example, eip155:8453 for Base or
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp for Solana mainnet). destination.asset is the token
address on that destination chain.Parameters
addFunds accepts an object with the following fields:
At least one of
fiat or crypto must be provided. Provide both to show the method picker.
Return value
addFunds returns a Promise with one of the following results:
Error handling
addFunds rejects on invalid configuration or incomplete flows. Common error cases include:
destination.address,destination.chain, ordestination.assetis missing- neither
fiatnorcryptois provided fiat.source.assetsis empty- the user is not authenticated
- another add funds flow is already in progress
- the user cancels the flow
- provider session, quote, or deposit address requests fail
try/catch and show clear UI feedback.
Complete example
Related
Fiat-to-crypto onramps
Fund wallets with fiat via card, Apple Pay, or Google Pay.
Crypto deposits
Fund wallets by letting users transfer crypto from another wallet.

