# vercel/nextjs-subscription-payments

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/vercel-nextjs-subscription-payments).**

7,718 stars · 1,746 forks · TypeScript · MIT · archived

## Links

- GitHub: https://github.com/vercel/nextjs-subscription-payments
- Homepage: https://subscription-payments.vercel.app/
- awesome-repositories: https://awesome-repositories.com/repository/vercel-nextjs-subscription-payments.md

## Description

This project is a Next.js SaaS starter kit and billing boilerplate designed for building subscription-based software services. It provides a pre-configured foundation that integrates a PostgreSQL database schema with Stripe to manage recurring billing, tiered pricing models, and customer payment portals.

The implementation features a synchronization system that uses webhooks to mirror external product data and subscription states into a local relational database. It includes an authentication layer that links external identity providers to user accounts and manages secure session tracking.

The capability surface covers user identity management, automated user provisioning, and the processing of checkout flows. It employs row-level security to restrict data access, ensuring users can only view or modify their own profiles and billing information.

## Tags

### Business & Productivity Software

- [Billing and Subscription Management](https://awesome-repositories.com/f/business-productivity-software/billing-and-subscription-management.md) — Provides a comprehensive system for managing recurring billing, commercial subscriptions, and payment cycles. ([source](https://github.com/vercel/nextjs-subscription-payments/blob/main/.env.example))
- [Subscription Billing](https://awesome-repositories.com/f/business-productivity-software/billing-systems/subscription-billing.md) — Implements a complete system for recurring payments and tiered pricing plans for a software service.
- [Tiered Pricing Configurations](https://awesome-repositories.com/f/business-productivity-software/billing-and-subscription-management/tiered-pricing-configurations.md) — Stores tiered pricing models including one-time charges and recurring monthly or yearly billing intervals. ([source](https://github.com/vercel/nextjs-subscription-payments/blob/main/schema.sql))
- [Customer Identity Linking](https://awesome-repositories.com/f/business-productivity-software/payment-checkout-customization/customer-identity-linking.md) — Maintains an internal mapping between authenticated user identities and external payment provider customer IDs. ([source](https://github.com/vercel/nextjs-subscription-payments/blob/main/supabase/migrations/20230530034630_init.sql))
- [Payment Provider Synchronization](https://awesome-repositories.com/f/business-productivity-software/price-list-management/payment-provider-synchronization.md) — Automatically mirrors pricing and product changes from external payment gateways to the local database. ([source](https://github.com/vercel/nextjs-subscription-payments/blob/main/schema.sql))
- [Subscription Management Portals](https://awesome-repositories.com/f/business-productivity-software/subscription-management-portals.md) — Provides self-service portals for users to manage their billing methods and subscription plans.

### Part of an Awesome List

- [SaaS Starter Kits](https://awesome-repositories.com/f/awesome-lists/devtools/saas-starter-kits.md) — Provides a production-ready template for building multi-tenant subscription-based software applications.
- [Next.js and React Boilerplates](https://awesome-repositories.com/f/awesome-lists/devtools/next-js-and-react-boilerplates.md) — Official Vercel starter for handling subscription payments in Next.js.

### Data & Databases

- [Relational Data Stores](https://awesome-repositories.com/f/data-databases/relational-data-stores.md) — Utilizes a relational database to store and manage persistent application state and user data. ([source](https://github.com/vercel/nextjs-subscription-payments#readme))
- [External State Mirroring](https://awesome-repositories.com/f/data-databases/external-state-mirroring.md) — Syncs external product data and user profiles into a local relational database for consistent application state.
- [Resource Mirrors](https://awesome-repositories.com/f/data-databases/local-state-caches/resource-mirrors.md) — Caches external pricing and product metadata in a local store to ensure fast public access.
- [Product Data Synchronization](https://awesome-repositories.com/f/data-databases/product-information-management/product-data-synchronization.md) — Synchronizes product and pricing metadata from an external payment provider into a local database. ([source](https://github.com/vercel/nextjs-subscription-payments/blob/main/supabase/migrations/20230530034630_init.sql))
- [State Synchronization Webhooks](https://awesome-repositories.com/f/data-databases/product-information-management/product-data-synchronization/event-driven-webhooks/state-synchronization-webhooks.md) — Updates local database records by listening to asynchronous events sent from an external payment processor.
- [Relational Data Models](https://awesome-repositories.com/f/data-databases/relational-data-models.md) — Ships a predefined relational data model for tracking user profiles, pricing, and subscription states.
- [Relational Mappings](https://awesome-repositories.com/f/data-databases/relational-mappings.md) — Implements a private mapping table to connect internal user identities with external payment provider customer IDs.

### Networking & Communication

- [Payment Webhooks](https://awesome-repositories.com/f/networking-communication/api-integration-frameworks/webhook-management/payment-webhooks.md) — Processes asynchronous payment webhooks to update subscription statuses and trigger account changes. ([source](https://github.com/vercel/nextjs-subscription-payments/blob/main/package.json))

### Security & Cryptography

- [Row Level Security](https://awesome-repositories.com/f/security-cryptography/identity-access-management/access-control/data-resource-permissions/row-level-security.md) — Enforces database security policies that restrict data access to specific rows based on the authenticated user. ([source](https://github.com/vercel/nextjs-subscription-payments/blob/main/schema.sql))
- [OAuth and Identity Providers](https://awesome-repositories.com/f/security-cryptography/identity-access-management/authentication-strategies/user-facing-login-methods/oauth-identity-providers.md) — Delegates user authentication to external OAuth identity providers while managing secure sessions.
- [User Profile Management](https://awesome-repositories.com/f/security-cryptography/identity-access-management/identity-management/user-management/user-profile-management.md) — Implements functionality for storing and managing user account attributes and billing metadata. ([source](https://github.com/vercel/nextjs-subscription-payments/blob/main/supabase/migrations/20230530034630_init.sql))
- [Row-Level Security](https://awesome-repositories.com/f/security-cryptography/row-level-security.md) — Employs row-level security at the database engine level to ensure users only access their own data.
- [Authentication Integrations](https://awesome-repositories.com/f/security-cryptography/user-account-management/account-security-policies/authentication-integrations.md) — Integrates with external identity providers to handle secure user sign-in and account authorization.
- [User Authentication Systems](https://awesome-repositories.com/f/security-cryptography/user-authentication-systems.md) — Provides secure user sign-in and identity management to control access to protected features. ([source](https://github.com/vercel/nextjs-subscription-payments/blob/main/README.md))
- [User Identity Management](https://awesome-repositories.com/f/security-cryptography/user-identity-management.md) — Handles secure account management and user profile lifecycle using a backend identity provider. ([source](https://github.com/vercel/nextjs-subscription-payments#readme))
- [Session Authentication](https://awesome-repositories.com/f/security-cryptography/session-authentication.md) — Manages secure session state across requests to ensure continuous user authentication. ([source](https://github.com/vercel/nextjs-subscription-payments/blob/main/middleware.ts))
- [External User Provisioning](https://awesome-repositories.com/f/security-cryptography/user-identity-management/external-user-provisioning.md) — Automatically provisions detailed local user profiles based on data from the external identity provider. ([source](https://github.com/vercel/nextjs-subscription-payments/blob/main/supabase/migrations/20230530034630_init.sql))

### Software Engineering & Architecture

- [SaaS Boilerplates](https://awesome-repositories.com/f/software-engineering-architecture/saas-boilerplates.md) — Offers a foundational application architecture with pre-integrated billing and subscription features.

### User Interface & Experience

- [Payment Checkout Widgets](https://awesome-repositories.com/f/user-interface-experience/payment-checkout-widgets.md) — Provides checkout flows and customer portals to handle recurring billing and payment method updates. ([source](https://github.com/vercel/nextjs-subscription-payments#readme))

### Web Development

- [Identity Provider Integration](https://awesome-repositories.com/f/web-development/third-party-integrations/third-party-platform-authorizations/identity-provider-integration.md) — Integrates external identity providers to handle user authentication and session management for the application.

### Development Tools & Productivity

- [Type-Safe Schema Migrations](https://awesome-repositories.com/f/development-tools-productivity/git-workflows/database-schema-synchronization/type-safe-schema-migrations.md) — Manages database schema migrations and automatically generates TypeScript definitions for the backend data store. ([source](https://github.com/vercel/nextjs-subscription-payments/blob/main/package.json))
