基于 Next.js 构建,集成 Convex 数据库、AuthKit 认证与 Stripe 支付
next-b2b-starter-kit — Next.js SaaS模板
作者 workos
WorkOS 开源的 Next.js B2B SaaS 启动器,整合 Stripe 计费、Convex 数据库与 AuthKit 认证,内置营销页、定价页、仪表盘和产品页。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 2
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
包含营销首页、定价页、管理员仪表盘和产品页四个主要页面
内置基于角色的访问控制,管理员可管理用户、配置 SSO 与计费
提供审计日志,默认示例中仅 Enterprise 订阅可访问
通过 Webhook 将数据同步到 Convex,权益同步由 WorkOS 的 Stripe 集成处理
模板详细介绍
这是一个面向 B2B SaaS 场景的 Next.js 启动器,由 WorkOS 维护,采用 MIT 许可。它把营销页、定价页、管理仪表盘和产品页串成一条完整的应用流程:访客先浏览首页与定价页,注册时创建组织并关联 Stripe 客户,之后管理员进入仪表盘管理用户、配置 SSO 与计费、查看审计日志,非管理员则被重定向到产品页。
功能上覆盖基于角色的访问控制、审计日志、计费,以及通过 Webhook 将数据同步到 Convex。权益同步由 WorkOS 的 Stripe 集成处理,应用侧只需在结账后刷新会话,使新权益立即出现在访问令牌中,因此不需要为权益单独编写 Stripe Webhook。
使用前需要自备 Convex、Stripe 和 WorkOS 三个外部服务的账号,并运行仓库提供的 setup 脚本完成初始化。本地或演示环境测试 Stripe 结账时使用 4242 4242 4242 4242 等测试卡号。部署到生产前需替换为 Stripe 与 WorkOS 的生产 API 密钥。
适合你的项目吗?
适用场景
- 快速搭建 B2B SaaS 产品的页面骨架与账户流程
- 演示组织级注册、Stripe 订阅结账与权益刷新
- 为管理员提供用户管理、SSO 配置和审计日志入口
- 作为学习 Next.js、Convex、WorkOS 与 Stripe 集成的示例项目
适合人群
- 需要 B2B SaaS 启动模板的开发者
- 已使用或计划使用 WorkOS AuthKit 的团队
- 希望以 Convex 作为后端数据库的项目
- 需要集成 Stripe 订阅计费的应用
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
需要自行准备 Convex、Stripe 和 WorkOS 三个服务的账号
- 2
克隆仓库后使用 pnpm install 安装依赖,再运行 pnpm run setup 初始化
- 3
使用 pnpm run dev 启动开发服务器
- 4
本地或演示环境测试 Stripe 结账可使用测试卡号 4242 4242 4242 4242
- 5
部署到生产前需替换为 Stripe 与 WorkOS 的生产 API 密钥
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 使用该模板必须自行注册并配置 Convex、Stripe 与 WorkOS 三个第三方服务账号,否则无法完成初始化与运行。
- 部署到生产环境前必须替换为 Stripe 与 WorkOS 的生产 API 密钥,涉及外部付费服务的凭据配置。
- 默认示例中审计日志功能仅在订阅 Enterprise 计划后才可访问,属于与付费订阅绑定的功能限制。
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
You'll need a [Convex](https://www.convex.dev/) account, a [Stripe](https://stripe.com/) account and a [WorkOS](https://workos.com/) account.
README 原文
Remember to use your production API keys for both Stripe and WorkOS before deploying to production.
README 原文
https://github.com/workos/next-b2b-starter-kit/blob/main/LICENSEhttps://github.com/workos/next-b2b-starter-kit/blob/main/README.mdNote that in the default example, audit logs are only accessible when subscribed to the "Enterprise" plan.
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-01。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 92 / 100
- 技术栈
- Next.js · React
- 网站类型
- SaaS · 启动器
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-09-22
- 截图检查日期
- 2026-10-01
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Next.js。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。
查看当时使用的来源资料
SHA-256: 349f9204fb84241d4bb5a224150da46eb4f7901df755aa58ce19aa0dbaf45a37
2026-10-01T00:48:47.945Z
来源文件 / 仓库<p align="center">
<img src="./public/splash_page.jpeg" alt="Screenshot of splash page"/>
<h1 align="center">Next.js B2B Starter Kit</h1>
</p>
<p align="center">
A fully functional B2B SaaS template built with Next.js, Stripe, Convex, and WorkOS.
</p>
<p align="center">
<a href="https://opensource.org/licenses/MIT">
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT"/>
</a>
<a href="https://next-b2b-starter-kit.vercel.app/">
<img src="https://img.shields.io/badge/Demo-Website-blue" alt="Demo: Website"/>
</a>
</p>
<p align="center">
Demo: <a href="https://next-b2b-starter-kit.vercel.app/">https://next-b2b-starter-kit.vercel.app/</a>
</p>
<p align="center">
Read about the <a href="https://workos.com/blog/nextjs-b2b-starter-kit">Next.js B2B Starter Kit</a> on the WorkOS blog.
</p>
## Features
- Marketing splash page (`/`)
- Pricing page (`/pricing`) which allows signed in users to subscribe via Stripe Checkout
- Dashboard page (`/dashboard`) which is only accessible to admin users. Includes CRUD for users, audit logs and configuring SSO and billing
- Product page (`/product`) which is only accessible to signed in users
- Role-based access control
- Audit logs
- Billing
- Webhook syncing to Convex
> Entitlement sync is handled by WorkOS (via the [Stripe integration](https://workos.com/docs/authkit/add-ons/stripe)) — the app's only responsibility is [refreshing the session](https://workos.com/docs/user-management/entitlements) after checkout so new entitlements appear in the access token immediately. No app-side Stripe webhook is required for entitlements.
## Getting started
### Prerequisites
You'll need a [Convex](https://www.convex.dev/) account, a [Stripe](https://stripe.com/) account and a [WorkOS](https://workos.com/) account.
### Clone the repo
```bash
git clone https://github.com/workos/next-b2b-starter-kit.git
```
### Navigate to the project directory
```bash
cd next-b2b-starter-kit
```
### Install dependencies
```bash
pnpm install
```
### Run the setup script
```bash
pnpm run setup
```
### Start the development server
```bash
pnpm run dev
```
## Tech stack
- Framework: Next.js
- Database: Convex
- Authentication: AuthKit by WorkOS
- Payments: Stripe
## App flow
After viewing your marketing splash page (`/`) and pricing page (`/pricing`), users sign up before choosing a plan. This is so we can create an organization and link it to a Stripe customer.
Once signed up, users with the "admin" role can access the dashboard (`/dashboard`) where they can manage users, configure SSO and billing, and view audit logs. Note that in the default example, audit logs are only accessible when subscribed to the "Enterprise" plan.
Users without the "admin" role are instead redirected to the product page (`/product`) where they can interact with your product.
## Testing
When running locally or using the deployed [demo app](https://b2b-starter-kit.vercel.app/), use the following test card numbers for the Stripe Checkout flow:
- Card number: 4242 4242 4242 4242
- CVC: Any 3 digits
- Expiration Date: Any future date
- ZIP: Any 5 digits
## Deploying
Once you're ready to deploy your app, refer to the [Convex documentation](https://docs.convex.dev/production) for instructions on deploying to hosted solutions like Vercel.
Remember to use your production API keys for both Stripe and WorkOS before deploying to production.
## Need to Sync more data?
Learn more about the syncing system that connects [AuthKit](https://www.authkit.com/) and [Convex](https://www.convex.dev/).
We made a short video series that covers the full integration.
Check it out on [YouTube](https://youtu.be/GGwBSu0XmP0?feature=shared).
[](https://youtu.be/GGwBSu0XmP0?feature=shared)
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

ai-website-cloner-template
Clone any website with one command using AI coding agents
Next.js · 启动器

Next.js SaaS Starter
Next.js SaaS Starter 是 Next.js 官方维护的 SaaS 起点模板,定位介于学习资源和可直接部署的脚手架之间。
Next.js · SaaS

Next.js Commerce
Next.js Commerce 是 Vercel 团队维护的电商启动模板,基于 Next.js App Router 构建,采用服务端渲染、React Server Components、Server Actions …
Next.js · 电商

Next-js-Boilerplate
Next-js-Boilerplate 是一个面向 Next.js 16、Tailwind CSS 4 和 TypeScript 的启动器,核心定位是开发者体验优先。
Next.js · 启动器

tailwind-nextjs-starter-blog
tailwind-nextjs-starter-blog 是一个面向个人技术博客的 Next.js 与 Tailwind CSS 启动模板,其 v2 版本基于 App Router 与 React Server Comp…
Next.js · 博客

next-forge
Production-grade Turborepo template for Next.js apps.
Next.js · 启动器
