Integración del portal de Stripe y límites de planes en el frontend
Clase 21 de 27 • Curso de lanzamiento y monetización de webs con Lovable
Resumen
Bring subscription management and growth-ready limits to your UI with confidence. This guide shows how to connect the Stripe customer portal, surface user settings in a drawer, and add free vs. paid plan limits with an upsell modal—all focused on clear user experience and minimal custom billing code.
How to integrate Stripe customer portal on the front end?
The key is to avoid rebuilding billing features from scratch. Use Stripe’s built-in customer portal (previously called the “no-code portal”) to let users handle billing without extra backend work.
- Enable the test customer portal link in Stripe. Use a production link when you go live.
- Add a Manage Subscription button that opens the portal in a new tab.
- Let users cancel, change payment methods, update billing info, and view invoices.
Vocabulary and examples: - Customer portal: Stripe’s hosted page to manage a subscription. Example: “click Manage Subscription… it opens up a new tab.” - Test link / production link: environment-specific URLs. Example: “activate the test link… replace with the production link.”
What actions can users take in the portal?
- Cancel a plan with a reason field.
- Change payment methods and billing information.
- View and download invoices.
Why does this save time?
- Stripe handles cancellations, plan changes, and history views.
- You skip building custom billing pages and logic.
How to build user settings with a drawer and subscription status?
Place User Settings in the navbar and open them in a drawer for a smooth flow. Inside, show profile controls and real-time plan details.
- Include password, notification, and privacy settings.
- Display the current subscription status pulled from your backend or Stripe.
- Add a prominent Manage Subscription button linking to the customer portal.
Vocabulary and examples: - Drawer: a side panel that slides in. Example: “Settings… we pull up a nice drawer.” - Badge: a small label showing status. Example: “Unlimited drop zone activated.”
What should be visible at a glance?
- Whether a subscription is active or not.
- A clear call to “Manage Subscription.”
How does this improve UX?
- Users solve billing needs without support.
- Settings and plan info live in one accessible place.
How to enforce plan-based limits and upsell with a modal?
Set simple, fair limits for the free plan, and give paid plan users the features they value most. In the example, free users can upload only two photos at a time; paid users get unlimited.
- Free plan: enforce a 2-photo upload limit.
- Paid plan: show a badge above the drop zone: “Unlimited drop zone activated.”
- When a free user selects more than two photos, open a modal with pricing cards instead of a toast warning.
Vocabulary and examples: - Drop zone: the area where users drag and drop files. Example: “add a nice badge above the photo drop zone.” - Toast warning: a brief message that appears and disappears. Example: “instead of showing a toast warning, let’s show a modal.” - Modal: a pop-up dialog. Example: “That’s a pop-up, for anybody who doesn’t know.”
What does the upsell flow look like?
- Detect when selection > 2 photos for free users.
- Show a modal with pricing options and a “start a plan” prompt.
- Allow dismiss and let them retry with two photos.
What variations can you try?
- Auto-allow only two files from a larger selection so they keep momentum.
- Offer limited free credits for sharing on a social link.
- Tune copy to make paid users feel valued while keeping free users unblocked.
Skills and concepts reinforced: - Front-end UX patterns: drawer, modal, badge, drop zone. - Billing UX design: customer portal integration, test vs. production links. - Product strategy: free vs. paid plan limits, gentle upsell prompts. - Practical validation: sign in with paid and free accounts to confirm behavior.
Have questions or ideas to improve the settings, portal link, or upsell copy? Share your thoughts and the plan rules you’d apply to your own app.