useSignUpForCard with SignUpForCardView to onboard the cardholder. Then, render CardSummaryView to display and manage the card.
These APIs are exported from @privy-io/react-auth/cards and must be used within PrivyProvider.
Before continuing, complete the cards setup and configure embedded wallets for your app.
For an approved Earn-backed card program, follow Spend from vault balances. The same hooks and components handle vault-share approval and available balances.
useSignUpForCard works for any authenticated Privy user, including users authenticated with
custom JWT authentication.Install and import the SDK
Card prebuilt components require
@privy-io/react-auth version 3.40.0 or later.usePrivy from the main entrypoint. Import the card hooks and components from the /cards entrypoint.
Get the funding wallet
ThesignUp method takes the Privy wallet ID, not the wallet address. Read it from the authenticated user’s linkedAccounts.
The following helper returns the ID of an embedded EVM wallet:
chainType === 'solana' instead.
Choose the card asset
Each card spends one stablecoin from its funding wallet. Pass the stablecoin’s asset ID asasset when calling signUp. Every supported chain has a default asset, and some chains also accept a second one.
The other sandbox networks, such as Base Sepolia and Solana devnet, accept only
'usdc'. To test OUSD cards in sandbox, use Tempo Moderato.
OUSD cards require
@privy-io/react-auth version 3.49.1 or later.signUp rejects when asset is not available on chainId.
Add the card flow
UseisOpen to mount the container for SignUpForCardView. Connect the container’s close action to close. The view renders the onboarding steps using the options passed to signUp. The promise returns the new card ID after signup completes and rejects if the flow does not complete.
This sandbox example uses Tempo Moderato and OUSD. To issue a PathUSD card instead, set CARD_ASSET to 'pathusd'. The SDK supplies built-in stablecoin and Bridge spend-approval targets for supported sandbox networks.
aside with the modal or side panel that fits the app. Keep SignUpForCardView mounted while isOpen is true. CardSummaryView uses cardId to load the card, balance, activity, and statements. It also handles card-detail reveal, wallet provisioning, freezing, replacement, and cancellation.
Find the user’s existing cards
The signup promise only returns a card ID during the current page session. To support returning users, useuseGetCardsForUser to fetch the authenticated user’s cards.
getCardsForUser returns one page for a single environment, ordered newest first. Results include canceled cards. The default page size is 5 and the maximum is 20; pass each next_cursor back as cursor until it returns null.
CardSummaryView:
Handle card states
The list response can include these card states:active: The card is open and can spend. Pass it toCardSummaryView.inactive: The card is frozen but remains open. Pass it toCardSummaryViewto allow unfreezing.canceled: The card is permanently closed. Keep it for history, but do not select it for management.replaced: A newer card replaced this closed card. Select the neweractiveorinactivecard instead.
active or inactive card that matches the funding wallet, chain, and asset.
Configure production spend approval
Sandbox uses built-in targets for Ethereum Sepolia, OP Sepolia, Polygon Amoy, Base Sepolia, Arbitrum Sepolia, Avalanche Fuji, Tempo Moderato, and Solana devnet. On Tempo Moderato, the built-in target approves OUSD whenasset is 'ousd' and PathUSD otherwise. Production requires the spend-approval target for the mainnet chain behind the app’s Bridge integration.
Pass the target that a Privy account manager provides. Do not guess or hardcode another integration’s spender or merchant ID: the card can be issued but cannot spend if its wallet approves the wrong target.
For an OUSD card, set stablecoinAddress to the OUSD contract on the card’s chain, or to the OUSD mint on Solana:
The Solana OUSD mint uses the Token-2022 program. The SDK derives the token account and builds the approval under Token-2022 automatically, so no extra configuration is needed.
- EVM
- Solana
Pass the stablecoin contract and Bridge spender for the card’s chain:
environment option determines which configured card ledger the flow uses. Sandbox does not accept a caller-supplied spendApproval; production requires one.
API reference
useGetCardsForUser
useGetCardsForUser() returns a getCardsForUser method for the authenticated user:
getCardsForUser(options) returns a page with the user’s cards in data and the next page cursor in next_cursor.
useSignUpForCard
useSignUpForCard() returns the signUp and close methods and the isOpen state:
signUp(options) returns Promise<{id: string}>. Only one card signup can be active at a time; starting another before the first finishes rejects with an error.
isOpen is true while signup is in progress. Use it to control the container that mounts SignUpForCardView. Call close() when the user dismisses that container. Closing before a card exists rejects the pending signUp promise.
DevSpendApprovalTarget is a union of the EVM and Solana target shapes:
spenderAddress identifies the Bridge contract approved to spend the stablecoin. For Solana, programId and merchantId identify the Bridge delegate.
SignUpForCardView
SignUpForCardView takes no props. Mount one instance within PrivyProvider while isOpen is true. The hook controls its options and completion state.
The view handles disclosures, bank and provider terms, KYC, card creation, and the wallet spend approval.

