Privy provides a The crypto-only call opens the crypto deposit flow. The user picks a source token and network. Privy then creates a deposit account and shows the address with an indicative quote. This example uses the destination wallet’s own address as the deposit address where possible. Omit Pass both At least one of
useDepositFunds hook in @privy-io/react-auth that opens the consumer onramp modal.Your app can use this hook to let authenticated users fund a destination wallet with fiat, crypto, or both. A crypto-only call opens the crypto deposit flow directly. A call that includes fiat shows a method picker first.Prerequisites
For fiat, enable card and bank funding methods on the Account Funding page. See the deposit configuration guide.For crypto, enable app-pays gas sponsorship as described in crypto deposit setup. Crypto deposits require a Privy wallet. The hook builds the create-deposit-account request and signs it with the user’s signer.The Stripe Embedded Components onramp requires@privy-io/react-auth version 3.33.1 or later. Install the @stripe/crypto package as a required dependency:Access the hook
Import and initializeuseDepositFunds:Start a deposit flow
CalldepositFunds with a destination and at least one funding method.depositAddressStrategy to use a separate source wallet.destination.chain and destination.asset accept aliases or raw identifiers. Omit
destination.wallet to use the user’s first embedded wallet on that chain.fiat and crypto to show a method picker:Parameters
depositFunds accepts an object with the following fields:Enables the crypto deposit flow. Required unless
fiat is provided. Pass {source: {mode: 'all'}} to accept every supported source.fiat or crypto must be provided.Return value
depositFunds returns a Promise with one of the following results:Error handling
depositFunds rejects on invalid configuration or incomplete flows. Common error cases include:- the call omits
destination.chainordestination.asset - the call omits both
fiatandcrypto - the call sends an empty
fiat.source.assetslist fiat.source.assetsorfiat.source.defaultAssetcontains an unsupported currency code (rejects with<code> is an unsupported currencyin React SDK 3.51.3 and later)- the user has no authenticated session
destination.walletis not a Privy wallet on a crypto call- another funding flow is already in progress
- the user cancels the flow
- app-pays gas sponsorship is not enabled
- no source tokens match
crypto.source crypto.depositAddressStrategyisrequire_destinationand the destination wallet was exported- provider session, quote, or deposit account requests fail
try/catch and show clear UI feedback.Complete example
Test in sandbox mode
Passfiat.environment: 'sandbox' to depositFunds to run the flow against Stripe’s test environment. No real funds move, and you can complete an end-to-end purchase with the test values below.Set
destination.chain to a mainnet chain. Stripe’s onramp does not support testnets, so testnet chains fail even in sandbox mode.Related
Crypto deposits
Persistent deposit addresses, setup, and headless React or React Native.

