Connect MetaMask (top right), then try each pricing mode. Payments use test USDC on Base Sepolia.
One price for everyone, set in nuxt.config. Access is kept in a signed cookie for 24 hours.
'GET /api/premium': { price: '$0.001' }The amount comes from an input field. The server only accepts it within the min/max set in nuxt.config.
'POST /api/donate': { price: { min: '$0.001', max: '$10' } }Each article has its own price, looked up on the server. Paying for one article unlocks only that article.
defineX402Handler({ price: event => ({ amount, key: 'article:slug' }) }, handler)The browser only says which order to pay. The server reads the order total, so the amount cannot be changed on the client. Each order is paid once.
defineX402Handler({ price: event => ({ amount: order.total, key: 'order:id' }) }, handler) The /api/hello endpoint is not protected and returns data freely.