How to add auth and payments to a vibe-coded app
Checked against official pricing pages and docs on Oct 26, 2026. Plans change, so confirm on each official site.
Sign-in and checkout are the two features that turn a demo into a business, and the two that coding agents most often wire up half-way. Pick one auth option and one payment option, connect them through a verified webhook, and test the whole loop before launch.
Step 1: pick auth
Already on Supabase? Use Supabase Auth: 50,000 MAU free and 100,000 included in Pro, with users in the same Postgres your Row Level Security policies use. Want drop-in UI for React or Next.js? Clerk is free for 50,000 monthly retained users per app, then Pro is $25/mo ($20 annual) plus $0.02 per user over 50K. Want users in your own database with no per-user fee? Better Auth is an MIT library that is free to self-host.
Step 2: pick payments
Stripe has the lowest base fee (2.9% + 30¢ per successful US card charge, no monthly fee) and the most control, but you handle sales tax. A merchant of record collects and remits tax for you for a higher cut: Polar Starter is 5% + 50¢ with no monthly fee, Stripe Managed Payments adds 3.5% on top of standard Stripe fees, and Paddle is 5% + 50¢.
Step 3: connect them with a webhook
Use hosted checkout (Stripe Checkout or your provider’s equivalent) and pass your user’s ID when you create the session. When the provider sends a “checkout completed” or “subscription updated” webhook, verify its signature on the server, then store the plan on the user’s row. Your app checks that row, never a URL parameter, to decide who has paid.
Step 4: test the full loop
Use test mode: sign up, pay with a test card, confirm the webhook updates the user, cancel, and confirm access ends. Then do a refund. Agents often skip the cancel and failed-payment paths.
Prompt to give your coding agent
“Add sign-in with [provider] and a $X/mo subscription with [payment provider] hosted checkout. Store the subscription status on the user record only from a verified webhook. Keep all secret keys server-side. Add a test for the webhook handler.” Then review the diff against our security checklist.