The boilerplate provides 4 different checkout methods to suit various use cases, from embedded forms for the best user experience to payment links for simple sharing.
Perfect for: Choosing the optimal checkout experience based on your business needs, user experience requirements, and technical preferences.
The checkout method is controlled by the NEXT_PUBLIC_STRIPE_CHECKOUT_TYPE environment variable:
NEXT_PUBLIC_STRIPE_CHECKOUT_TYPE="EmbededForm"Best for: Optimal user experience with no redirects
Component location: src/components/features/checkout-stripe/embed/
Features:

All checkout methods are rendered through the main checkout page:
// From src/components/features/checkout-stripe/checkout-page.tsx
export default async function CheckoutPage({
priceId,
couponId,
seats = 1,
guest = false,
enableInstallments = false,
}: {
priceId: string
couponId: string
seats: number
guest: boolean
enableInstallments?: boolean
})The checkout method is dynamically determined:
// From src/components/features/checkout-stripe/checkout-page.tsx
const checkoutConfig = getCheckoutConfig({
enableInstallments,
recapInfo,
priceId,
seats,
guest,
isRecurring,
})Implementation:
// From checkout-page.tsx
<CheckoutFormEmbedded
priceId={priceId}
seats={seats}
couponId={couponId}
guest={guest}
/>Features:
When to use:
Implementation:
// From checkout-page.tsx
<CheckoutButtonExternal
priceId={priceId}
seats={seats}
couponId={couponId}
guest={guest}
/>Features:
When to use:
Implementation:
// From checkout-page.tsx
<CheckoutButtonReactStripe
priceId={priceId}
seats={seats}
couponId={couponId}
guest={guest}
/>Features:
When to use:
Implementation:
// From checkout-page.tsx
<CheckoutPaymentLink
priceId={priceId}
seats={seats}
couponId={couponId}
/>Features:
When to use:
Better Auth users: These advanced features are not available with Better Auth's external checkout. Consider using the Custom System if you need these capabilities.
All Custom System checkout methods support guest checkout with automatic user account creation:
// Enable guest checkout
<CheckoutPage
priceId="price_123"
couponId=""
seats={1}
guest={true} // Allow checkout without account creation
/>Guest Checkout Workflow:
handleGuestCheckoutSessionCompleted function processes the eventTechnical Implementation:
// From src/lib/stripe/stripe-events.ts
function detectGuestCheckoutMode(metadata: Record<string, string>): boolean {
const referenceId = metadata.referenceId
const guestCheckoutFlag = metadata.guest_checkout === 'true'
const isGuestByReferenceId = referenceId === 'guest'
const isGuestByFlag = guestCheckoutFlag
const isGuestCheckout = isGuestByReferenceId || isGuestByFlag
return isGuestCheckout
}Benefits:
Enable installments for supported payment methods in the Custom System:
// Enable installments
<CheckoutPage
priceId="price_123"
couponId=""
seats={1}
guest={false}
enableInstallments={true} // Enable installment payments
/>Features:
Support for team/organization subscriptions in the Custom System:
// Multi-seat subscription
<CheckoutPage
priceId="price_123"
couponId=""
seats={5} // Number of seats/users
guest={false}
/>Pricing:
The Custom System checkout page at /checkout/[priceId] supports various URL parameters:
Better Auth users: URL parameters are not available with Better Auth's external checkout system.
// From src/app/[locale]/(public)/checkout/[priceId]/page.tsx
interface CheckoutParams {
priceId: string // Stripe Price ID (required)
couponCode?: string // Coupon/discount code
seats?: number // Number of seats for team subscriptions
guest?: 'true' // Enable guest checkout
split?: 'true' // Enable installment payments
}Example URLs:
# Basic checkout
/checkout/price_1234567890
# Guest checkout with coupon
/checkout/price_1234567890?guest=true&couponCode=SAVE20
# Team subscription with 5 seats
/checkout/price_1234567890?seats=5
# Installment checkout for guest
/checkout/price_1234567890?guest=true&split=true# Choose your checkout method
NEXT_PUBLIC_STRIPE_CHECKOUT_TYPE="EmbededForm" # Recommended
# NEXT_PUBLIC_STRIPE_CHECKOUT_TYPE="ExternalForm" # Quick setup
# NEXT_PUBLIC_STRIPE_CHECKOUT_TYPE="ReactStripeForm" # Advanced
# NEXT_PUBLIC_STRIPE_CHECKOUT_TYPE="PaymentLink" # Simple| Feature | Embedded | External | React Stripe | Payment Link |
|---|---|---|---|---|
| Setup Complexity | Medium | Low | High | Very Low |
| User Experience | Excellent | Good | Excellent | Good |
| Customization | High | Low | Very High | None |
| Mobile Optimization | Excellent | Good | Excellent | Good |
| PCI Compliance | Stripe Elements | Stripe Hosted | Stripe Elements | Stripe Hosted |
| Payment Methods | Most | All | Most | All |
| Development Time | Medium | Low | High | Very Low |
Choose your method in .env.local:
NEXT_PUBLIC_STRIPE_CHECKOUT_TYPE="EmbededForm"Use Stripe test cards for different scenarios:
# Successful payment
4242424242424242
# Declined card
4000000000000002
# Requires authentication
4000002500003155
Method switching: You can change checkout methods anytime by updating the environment variable. Each method uses the same underlying payment processing.
Flexible checkout ready! Choose the checkout method that best fits your business needs and user experience requirements.