Skip to main content
Privy embedded wallets give every user a wallet at signup, with no extensions or seed phrases required. WalletConnect Pay lets merchants generate payment links that any wallet can fulfill. This recipe shows how to combine them so users can pay for anything in-app, with a single tap. Using Privy and WalletConnect Pay together, your app can:
  • Let users paste a WalletConnect Pay link and complete the payment with their Privy wallet
  • Support multiple chains (Ethereum, Base, Polygon, Arbitrum, Optimism, and more)
  • Handle ERC-20 token transfers (like USDC) alongside native ETH payments
WalletConnect Pay offers interchange revenue for wallets and $WCT cashback for users. See the WalletConnect Pay overview for details on earning revenue through your integration.

Setup

1. Install dependencies

2. Get project IDs

Your app needs two project IDs: Add them to your environment:

3. Configure the PrivyProvider

Wrap your app with PrivyProvider and enable automatic embedded wallet creation. This ensures every user gets a wallet on login.
Setting createOnLogin to 'users-without-wallets' means Privy automatically provisions an Ethereum wallet the first time a user logs in. No extra steps needed.

4. Initialize WalletKit

Create a shared module that initializes WalletKit for the payment link flow.

Pay with link

This flow lets users paste a WalletConnect Pay link (like https://pay.walletconnect.com/...) and complete the payment entirely in your app.

1. Get the user’s Privy wallet

Use Privy’s useWallets hook to access the embedded wallet:
Use isPaymentLink from @reown/walletkit to verify the link before making API calls:

3. Fetch payment options

Build the user’s account list from supported chain prefixes and their wallet address, then call getPaymentOptions:
The response contains:
  • paymentId — unique identifier for this payment session
  • options — array of payment methods (different tokens and chains the user can pay with)
  • info — merchant name, requested amount, and expiry (expiresAt)
Check options.info.expiresAt and warn users when time is running low. Payments expire after a set period, and signing after expiry results in a failed payment.

4. Handle data collection (if required)

Some payment options require additional user information (e.g. shipping address). Check the selected option for a collectData object and render the provided URL in an iframe:
The iframe submits collected data directly to WalletConnect. Do not pass collectedData to confirmPayment() when using this flow — it is handled automatically.

5. Get required actions and sign

Once the user selects a payment option, fetch the transaction actions and sign them with the Privy wallet. The API can return multiple actions (e.g. a token approval followed by a Permit2 signature), and different RPC methods require different parameter handling:
The three methods above (eth_sendTransaction, eth_signTypedData_v4, personal_sign) are the most common, but the API can return any wallet RPC method. Add additional cases to the switch statement as needed for your integration.

6. Confirm the payment

Submit all signatures to finalize the payment. The response may indicate the payment is still processing — poll until isFinal is true:
Key types from the WalletConnect Pay API:
For the full API reference, see the WalletConnect Pay SDK documentation.

Supported chains

Configure which chains your app supports. The SUPPORTED_CHAINS array in step 3 determines which payment options WalletConnect Pay returns.
WalletConnect Pay matches available payment options to the chains your app lists. Add more chains to SUPPORTED_CHAINS to offer users additional payment methods.
For testnet development, use the WalletConnect Dashboard POS tool to create test payments on supported testnets.

Testing

1

Create a test payment

Go to the WalletConnect Dashboard and use the POS tool to create a test payment. Copy the payment link.
2

Log in with Privy

Log in to your app with Privy so an embedded wallet is provisioned.
3

Complete the payment flow

Paste the link into your app and complete the payment flow.

Learn more

WalletConnect Pay documentation

Official WalletConnect Pay integration guide for wallets

WalletConnect Dashboard

Create test payments and manage your WCP ID