Back

How to Add Authentication, Billing, and Email to Your SaaS MVP Fast

MT
MVPHub Team
7 min read

How to Add Authentication, Billing, and Email to Your SaaS MVP Fast

Authentication, billing, and email are the three pillars of every SaaS application. Without auth, users can't log in. Without billing, you can't make money. Without email, you can't communicate with users.

Together, these three features typically consume 3-6 weeks of development time when built from scratch. With the right tools and approach, you can have all three working in 3-5 days.

Here's how.


Part 1: Authentication (Day 1)

Choose Your Auth Solution

SolutionSetup TimeCostBest For
NextAuth (Auth.js)2-4 hoursFreeFull control, self-hosted
Clerk30-60 minutesFree (10K MAU)Fastest setup, beautiful UI
Supabase Auth1-2 hoursFree (with Supabase)Already using Supabase for DB
Auth02-3 hoursFree (7.5K MAU)Enterprise features needed
Custom (bcrypt + sessions)3-5 daysFreeMaximum control, most risk

Recommendation for speed: Clerk (30 minutes to fully working auth). Recommendation for flexibility: NextAuth (free, self-hosted, no vendor lock-in).

What to Implement

Must have:

  • Sign up with email and password
  • Sign in
  • Sign out (clear session + local storage)
  • Password reset via email
  • Protected routes (redirect unauthenticated users to login)
  • Session persistence (stay logged in across page refreshes)

Defer:

  • Social login (Google, GitHub) — add later, it's a config change
  • Two-factor authentication — enterprise feature
  • Magic link login — nice to have, not essential
  • SSO/SAML — enterprise feature

Common Auth Mistakes

  • Storing passwords in plain text — Always hash with bcrypt or argon2
  • Not validating email format — Use Zod or similar on both client and server
  • Forgetting to clear sessions on logout — Clear cookies AND local storage
  • No rate limiting on login — Prevents brute force attacks
  • Exposing user IDs in URLs — Use non-sequential IDs (cuid, uuid)

Part 2: Billing with Stripe (Days 2-3)

Setup Checklist

  1. Create a Stripe account (takes 5 minutes)
  2. Install the Stripe SDK (npm install stripe @stripe/stripe-js)
  3. Add Stripe API keys to environment variables
  4. Create Products and Prices in Stripe Dashboard

Implementation Steps

Step 1: Create a Checkout Session (Backend)

When a user clicks "Subscribe" or "Buy", create a Stripe Checkout Session that redirects them to Stripe's hosted payment page.

Key parameters:

  • customer_email — Pre-fill with the user's email
  • price — The Stripe Price ID for the selected plan
  • success_url — Where to redirect after successful payment
  • cancel_url — Where to redirect if they cancel
  • metadata — Store your user ID for webhook processing

Step 2: Handle Webhooks (Backend)

Create a webhook endpoint that Stripe calls when events happen:

EventAction
checkout.session.completedMark user as subscribed, store Stripe customer ID
customer.subscription.updatedUpdate plan info in your database
customer.subscription.deletedMark user as cancelled
invoice.payment_failedSend failed payment email, start grace period

Critical: Always verify the webhook signature to prevent spoofing.

Step 3: Access Control (Frontend + Backend)

Check subscription status before allowing access to paid features:

  • Active or trialing → Full access
  • Past due → Warning banner + grace period
  • Cancelled or expired → Upgrade prompt

Step 4: Customer Portal

Link to Stripe's hosted Customer Portal for self-service:

  • Update payment method
  • View invoices
  • Cancel subscription
  • Change plans

This saves you from building a billing management UI.

Common Billing Mistakes

  • Not handling webhooks — Relying on redirect URLs alone is unreliable
  • Not verifying webhook signatures — Security vulnerability
  • Hardcoding prices — Use Stripe Price IDs from environment variables
  • Not handling failed payments — Users churn silently without grace periods
  • Building a custom billing UI — Use Stripe Customer Portal instead

Part 3: Transactional Email (Day 4)

Choose Your Email Service

ServiceFree TierSetup TimeBest Feature
Resend3,000/mo20 minutesReact email templates
SendGrid100/day30 minutesEstablished, reliable
Postmark100/mo20 minutesFastest delivery
AWS SES62K/mo (from EC2)1-2 hoursCheapest at scale

Recommendation: Resend. Best developer experience and the free tier covers MVP needs.

Essential Emails to Build

EmailTriggerPriority
WelcomeAfter sign upMust have
Password resetUser requests resetMust have
Payment confirmationAfter successful paymentMust have
Payment failedInvoice payment failsMust have
Trial ending3 days before trial expiresShould have

Email Implementation Tips

  • Use a template system — Resend supports React components as email templates
  • Always include an unsubscribe link — Required by law (CAN-SPAM, GDPR)
  • Set a proper "from" addresshello@yourdomain.com, not noreply@
  • Test email delivery — Send test emails to Gmail, Outlook, and Yahoo
  • Check spam scores — Use Mail Tester (free) to verify deliverability
  • Configure DNS records — SPF, DKIM, and DMARC prevent emails from landing in spam

Common Email Mistakes

  • Not setting up DNS records — Your emails will go to spam
  • Sending too much too early — Welcome + essential transactional only for MVP
  • HTML emails that break on mobile — Use a responsive email framework
  • No unsubscribe link — Legal requirement, not optional
  • Using personal Gmail as sender — Looks unprofessional, deliverability issues

The 5-Day Implementation Timeline

DayFocusDeliverable
Day 1AuthenticationSign up, sign in, sign out, password reset, protected routes
Day 2Stripe setupProducts created, checkout flow working
Day 3Stripe webhooksWebhooks handling events, access control working
Day 4EmailWelcome, password reset, payment emails sending
Day 5Integration testingFull flow: sign up → subscribe → receive emails → access features

The Fastest Path: Use a Boilerplate

If 5 days still feels like too much for infrastructure, a SaaS boilerplate gives you all three — auth, billing, and email — pre-configured on day one. You skip straight to building your unique features.


Final Thoughts

Auth, billing, and email are infrastructure, not product. Spend the minimum time required to get them working reliably, then move on to what makes your SaaS unique.

Use managed services (Clerk, Stripe, Resend) over custom implementations. Use a boilerplate if available. And remember: every day you spend perfecting your login screen is a day you're not building the feature your customers will pay for.


Want all of this pre-built? Browse SaaS boilerplates on MVPHub.

Building a subscription SaaS? Read How to Build a Subscription SaaS MVP.

Choosing your full stack? See The Ultimate SaaS MVP Tech Stack.


Working products with full source code — live demo, one-time purchase, instant delivery.

Browse the marketplace
GR LIVEecommerce

Groover Multi-Purpose Store

$149

A fully-polished, multi-purpose e-commerce template engineered for brands that need the full feature set on day one — not a minimal starter you outgrow in a month. Groover ships with a live Medusa-backed catalog, category + collection merchandising, search with multi-facet filtering (category, collection, price, sale, stock, sort), product-detail with variant selection + image gallery + stock messaging + related products, Stripe Elements checkout with provider-aware setup panels, account dashboard with guest order lookup and authenticated order history, customer auth with login/register/logout/profile edit, wishlist with guest browser persistence and signed-in customer sync, blog list + detail, store directory, track-order page, branded 404, About/Contact/FAQ/Terms legal shell, GTM-friendly dataLayer wired into PDP/cards/wishlist/cart/checkout/search, locale + RTL foundation with persistent language switcher, PWA installability baseline, theme switching that applies before hydration and persists in both local storage and cookies, header active-route navigation with live mini-cart summary, skip-link / focus accessibility basics, app-level and route-level loading fallbacks, a recoverable error boundary, generated robots.txt and sitemap.xml, shared SEO metadata helpers, and a Playwright / Vitest / Lighthouse test harness. Every copy string lives in a typed content map so rebranding is a find-and-replace pass, not a code rewrite. Deploy it as-is or use it as the most complete starting point you can buy for a serious storefront.

★★★★★0 soldAstro · Medusa
FU LIVEecommerce

Furniture Store

$49

An elegant furniture and home furnishing e-commerce app with a design-forward Next.js storefront for SEO-optimized product pages and server-rendered category browsing. Alternative framework and mobile ports are available on demand. The visual design emphasizes large product imagery, room-based browsing, and material/color variant selection. Built with Radix UI, shadcn/ui, Tailwind CSS, and Framer Motion for a premium feel. Connects to any headless commerce backend — Medusa JS SDK integration is included. Form handling via React Hook Form with Zod validation ensures robust checkout and account flows. Great for furniture brands, interior design shops, or home decor marketplaces.

★★★★★0 soldExpo · Next.js
PE LIVEecommerce

Perfume Store

$49

A luxury-styled perfume and fragrance e-commerce app built for premium brand presentation. The ready-to-buy Next.js storefront features rich product pages with scent profiles, bottle size variants, gift set options, and server-rendered collections. Mobile, backend, and alternative framework ports are available on demand. The design uses shadcn/ui and Tailwind CSS with an elegant, minimalist aesthetic suited for luxury goods. Easy to customize — swap product data, update branding, and deploy. Perfect for perfume brands, fragrance boutiques, or niche scent marketplaces.

★★★★★0 soldMedusa · Expo

Keep reading — popular SaaS guides on MVPHub.

All SaaS articles

Explore other MVP verticals

MVPHub publishes templates and guides for ecommerce, SaaS, marketplaces, AI apps, booking platforms, subscription stores, directory sites, and more. Here are fresh picks from other verticals.