A donation page powered by x402 for accepting crypto payments via USDC.
-
Reown Project ID (required for wallet connection)
- Go to Reown Cloud and create a project
- Copy your Project ID
-
Facilitator URL (required for payment settlement)
- Default:
https://x402.org/facilitator
- Default:
Create a .env file in the project root:
# Required: Reown Project ID for wallet connection
VITE_REOWN_PROJECT_ID=your_project_id_here
# Facilitator URL for payment verification and settlement (has default)
FACILITATOR_URL=https://x402.org/facilitator
# Optional: App creator wallet for "Support the creator" links
# Supports ENS names (e.g., yourname.eth) or raw addresses (0x...)
VITE_CREATOR_ADDRESS=bun install
bun run devbun run build- Visit the home page and enter an Ethereum address or ENS name
- Share the generated donation link with supporters
- Supporters can donate USDC on any supported network
- User selects amount and network, clicks donate
- App returns HTTP 402 with payment requirements
- User signs a
TransferWithAuthorization(ERC-3009) in their wallet - Signature is sent to the facilitator for verification
- Facilitator settles the payment on-chain
- User sees success with transaction hash
Set VITE_CREATOR_ADDRESS to show "Support the app creator" links throughout the app. This provides a non-intrusive way to monetize the app by encouraging donations.
- TanStack Start - Full-stack React framework
- x402 - HTTP 402 payment protocol
- Reown AppKit - Wallet connection
- wagmi - React hooks for Ethereum
- Tailwind CSS - Styling
This project uses Biome:
bun run lint
bun run format
bun run checkbun run test