Add Stripe subscriptions and a billing page

By VibeCoderHQ|Published on 5/31/2026
PromptingSaasNext.js

Turns your app into a real SaaS with recurring revenue. Works in Cursor and Claude Code, and the plan-first structure also works well pasted into Lovable. The key instruction is that plan state only ever changes from a signature-verified webhook, which is the mistake most AI-generated Stripe code makes.

Prompt Text

Add Stripe subscription billing to my [FRAMEWORK] app so users can pay for a paid plan.

Plans:
- Free: [WHAT THEY GET]
- Pro at [PRICE] per month: [WHAT THEY GET]

Build all of this:
1. A pricing section with a subscribe button that opens Stripe Checkout in subscription mode.
2. A webhook endpoint that listens for checkout.session.completed, customer.subscription.updated, and customer.subscription.deleted, and updates the user's plan and status in my database.
3. A billing page where a logged-in user can see their current plan and open the Stripe Customer Portal to update or cancel.
4. A single helper I can call anywhere to check if the current user is on the Pro plan, so I can gate features.

Rules:
- Never trust the client for payment state. The database is only ever updated from a verified webhook, and you must verify the Stripe webhook signature.
- Use test-mode keys. Tell me every environment variable I need and where to find it in the Stripe dashboard.
- Store the stripe_customer_id and subscription status on my user record.

Before coding, list the files you will create or change and the exact Stripe products and prices I must create first. Then implement it, and finish with steps to test the full flow with a Stripe test card.

Join the vibe coder community

Weekly prompts, tools, and success stories to help you build and monetize with AI.

Unsubscribe any time.

Reviews

No reviews yet. Be the first to review!

Leave a Review

Add Stripe subscriptions and a billing page | VibeCoderHQ Prompt