The boilerplate provides TWO DISTINCT PAYMENT SYSTEMS to handle different business needs: Better Auth's external checkout for simplicity, and a comprehensive custom checkout system for advanced scenarios.
Important: These are two separate systems with different capabilities. Choose the one that best fits your business requirements.
External Checkout Only
Best for: Simple SaaS with standard subscription needs
Perfect for: Choose Better Auth for simplicity or Custom System for advanced features like guest checkout, installments, coupons, and multiple checkout methods.
Simple External Flow:
User Login → Better Auth Plugin → Stripe External Checkout → Customer Portal
Features:
Limitations:
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.
Automatic Integration
src/lib/better-auth/auth.ts)User Flow:
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"Select your preferred checkout experience:
EmbededForm - Integrated forms (recommended)ExternalForm - Stripe-hosted pagesReactStripeForm - Custom React integrationPaymentLink - Simple payment linksCreate your subscription plans in the admin panel at /admin/plans
Subscription Plans Interface:

Use Stripe test cards to verify your payment flow
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"External checkout only
Complete checkout suite
Choose Better Auth System if:
Choose Custom Boilerplate System if:
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.
Configure Stripe account, API keys, and webhook endpoints
Stripe plugin configuration with automatic customer management
4 flexible checkout options for different use cases
User subscription interface and plan management
Complete admin tools for plan and subscription management
Automatic webhook processing and event handling
Payment system ready! Your application has enterprise-grade payment processing with flexible checkout options and comprehensive subscription management.