Important: These are two separate systems with different capabilities. Choose the one that best fits your business requirements.
Two Payment Systems Overview
External Checkout Only
- Stripe-hosted checkout pages (external redirect)
- Customer portal for subscription management
- Authenticated users only
- Automatic customer & subscription management
- Zero configuration required
Perfect for: Choose Better Auth for simplicity or Custom System for advanced features like guest checkout, installments, coupons, and multiple checkout methods.
System Architecture Comparison
Simple External Flow:Features:
User Login โ Better Auth Plugin โ Stripe External Checkout โ Customer Portal
- External Stripe checkout only
- Stripe customer portal for management
- Authenticated users required
- Automatic webhook processing
- Zero custom checkout code
- No guest checkout
- No custom checkout UI
- No installment payments
- No coupon integration
System Selection: Better Auth uses external Stripe checkout exclusively, while the Custom System detects checkout type via metadata (
source: 'custom_checkout', guest_checkout: 'true') for intelligent routing.System Components Breakdown
Automatic Integration
- Better Auth Stripe plugin (
src/lib/better-auth/auth.ts) - External Stripe checkout (redirect only)
- Customer portal integration
- Automatic webhook processing
- User must be authenticated
- Redirects to Stripe checkout
- Returns to success page
- Manages subscription via Stripe portal
Quick Setup Guide
1
Configure Stripe Keys
Set up your Stripe environment variables in
.env.local:# Stripe Configuration
STRIPE_SECRET_KEY="sk_test_your_stripe_secret_key"
STRIPE_WEBHOOK_SECRET="whsec_your_webhook_secret"
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_your_publishable_key"
# Checkout Method
NEXT_PUBLIC_STRIPE_CHECKOUT_TYPE="EmbededForm"2
Choose Checkout Method
Select your preferred checkout experience:
EmbededForm- Integrated forms (recommended)ExternalForm- Stripe-hosted pagesReactStripeForm- Custom React integrationPaymentLink- Simple payment links
3
Configure Plans
Create your subscription plans in the admin panel at 
/admin/plansSubscription Plans Interface:
4
Test Payments
Use Stripe test cards to verify your payment flow
Environment Variables
Required Stripe configuration for the payment system:
# Server-side (Required)
STRIPE_SECRET_KEY="sk_test_..." # or sk_live_... for production
STRIPE_WEBHOOK_SECRET="whsec_..." # From Stripe Dashboard
# Client-side (Required)
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..." # or pk_live_...
NEXT_PUBLIC_STRIPE_CHECKOUT_TYPE="EmbededForm" # See checkout methods
# Optional
NEXT_PUBLIC_BILLING_MODE="subscription" # or "oneTime"System Feature Comparison
๐
Better Auth System
External checkout only
โ
Zero configuration setupโ
Automatic customer creationโ
Stripe customer portalโ
Real-time webhook syncโ
Guest checkout supportโ
Custom checkout UIโ
Payment installmentsโ
Coupon integration๐ฏ
Custom Boilerplate System
Complete checkout suite
โ
4 checkout methodsโ
Guest checkout + auto-accountโ
Payment installments (split)โ
Coupon code supportโ
One-time or subscriptionsโ
Multi-seat subscriptionsโ
Custom webhook processingโ
Conversion optimizationWhich System Should You Choose?
Choose Better Auth System if:
- You want zero configuration
- Simple subscription model is sufficient
- Users can create accounts before purchasing
- You prefer Stripe-hosted checkout pages
- You don't need custom checkout flows
- You need guest checkout (no account required)
- You want to optimize conversion rates
- You need payment installments (BNPL)
- You want coupon/discount support
- You need multiple checkout methods
- You require custom checkout UI/UX
Pro Tip: You can start with Better Auth for simplicity and migrate to the Custom System later if you need advanced features like guest checkout or installments.
Stripe & Payments Topics
โ๏ธ
Stripe Setup
Configure Stripe account, API keys, and webhook endpoints๐
Better Auth Integration
Stripe plugin configuration with automatic customer management๐ณ
Checkout Methods
4 flexible checkout options for different use cases๐
Subscription Management
User subscription interface and plan management๐
Admin Dashboard
Complete admin tools for plan and subscription management๐
Webhook Events
Automatic webhook processing and event handlingPayment system ready! Your application has enterprise-grade payment processing with flexible checkout options and comprehensive subscription management.