Skip to content

Funding wallets with Apple Pay and Google Pay

Privy makes it easy to allow your users to fund their embedded wallets with convenient payment methods like Apple Pay and Google Pay via @privy-io/expo and on the web through @privy-io/react-auth.

This guide will walk you through setting up Privy's funding flows, allowing your users to fund their wallets quickly and easily in under two minutes.

Card-based-funding

1. Enable debit card funding in the Dashboard

In the Privy Dashboard, enable Pay with card in your funding methods.

With this option enabled, if Apple Pay or Google Pay is available on your user's device, Privy will provide users the option to purchase with those methods.

Choose your desired network across EVM and Solana and set a recommended amount for users to fund. Users can update the amount manually if they choose.

2. Prompt the user to fund

@privy-io/react-auth

Prompt the user to fund by calling fundWallet

ParameterTypeDescription
chainChainOptional. A viem/chains object for the network on which users should fund their accounts. Defaults to the network you configured in the Privy Dashboard.
asset'native-currency' | 'USDC' | {erc20: string}Optional. The asset you'd like the user to fund their accounts with. Set 'native-currency' to fund with the chain's native currency (e.g. ETH), 'USDC' to fund with USDC, or a token address in the erc20 field to fund with an arbitrary ERC20. Defaults to 'native-currency'.
amountstringRequired if asset is set, optional otherwise. The amount of the asset to fund as a decimal string. Defaults to the amount you configured in the Privy Dashboard.
tsx
import {useFundWallet} from '@privy-io/react-auth';
// Replace this with your desired network
import {base} from 'viem/chains'
...
// `fundWallet` from the useFundWallet() hook
fundWallet('your-wallet-address-here', {
  chain: base,
  amount: 0.01 // Since no `asset` is set, defaults to 'native-currency' (ETH)
})

@privy-io/expo

ParameterTypeDescription
addressstringThe destination address to fund.
chainChainOptional. A viem/chains object for the network on which users should fund their accounts. Defaults to the network you configured in the Privy Dashboard.
asset'native-currency' | 'USDC' | {erc20: string}Optional. The asset you'd like the user to fund their accounts with. Set 'native-currency' to fund with the chain's native currency (e.g. ETH), 'USDC' to fund with USDC, or a token address in the erc20 field to fund with an arbitrary ERC20. Defaults to 'native-currency'.
amountstringRequired if asset is set, optional otherwise. The amount of the asset to fund as a decimal string. Defaults to the amount you configured in the Privy Dashboard.
tsx
import {useFundWallet} from '@privy-io/expo';
// Replace this with your desired network
import {base} from 'viem/chains'
...
// `fundWallet` from the useFundWallet() hook
fundWallet({
  address: '0x2F3eb40872143b77D54a6f6e7Cc120464C764c09',
  asset: "USDC",
  chain: base,
  amount: 1
})

All set!

Users can now fund their wallets with Apple Pay and Google Pay natively within the application.