Self-hosted auth with organizations and billing wired in

Better Auth SaaS Starter Kitfor Next.js and TanStack Start

Your users live in your own database, not in a paid auth service.
Teams with custom roles, two-factor, passkeys, and Stripe or Polar billing are already built and tested.
One-time purchase from $349$299, with no per-user auth fees.
Get the Better Auth Kit
Claude CodeCursorGemini

Inside MakerKit

MakerKit team dashboard page in dark mode: the sidebar with the team switcher and navigation, and MRR, revenue, fees and new customer cards above a visitors chart

Products built on MakerKit

See 16 more products from MakerKit customers +
Better AuthSelf-hosted auth in your own Postgres

The Better Auth SaaS starter kit for Next.js, with organizations, roles, and billing wired in

Better Auth runs inside your app and stores users, sessions, and organizations in your database. Organizations, invitations, custom roles, MFA, passkeys, magic links, and OAuth, tied to Stripe or Polar.

Authentication

Sign-in your users already expect

Password, magic link, passkeys, OAuth and multi-factor authentication, with the emails that go with them.

Multi-factor authentication

Users enroll an authenticator app and are challenged for a code at sign-in.

Transactional emails

Templates written in JSX with React Email, sent through Resend or Nodemailer (SMTP).

Every sign-in method

Password, magic link and social sign-in, configured per environment.

Passkeys

Opt-in sign-in with Face ID, Touch ID, Windows Hello or a security key. No password to phish.

Magic links

Passwordless sign-in: users get a one-time link by email instead of typing a password.

Accounts and billing

Everything a multi-tenant B2B SaaS needs

The multi-tenant SaaS boilerplate parts: auth, billing, teams with roles, and a super admin that can impersonate or ban users and teams, plus the screens your customers use to manage them.

Roles and permissions

Roles map to permissions that your code and your database policies both check.

Customer portal

Users change plans, update payment methods and download invoices without a support ticket.

Team accounts

Users belong to several teams and switch between them, or work in their personal account.

Billing webhooks

Flat, per-seat and metered subscriptions through Stripe Checkout, with webhooks that keep plans and seats in sync with your database.

Swappable providers

Billing, email, CMS and monitoring sit behind interfaces, so changing provider is configuration, not a rewrite.

Internationalization

Every UI string comes from translation files, so adding a language is content work.

Built for coding agents

Guardrails your agent works inside

Rules, an MCP server, skills and strict checks keep generated code in the kit’s patterns.

Agent rules

AGENTS.md files at the root and in each package teach coding agents the kit’s conventions.

Strict code standards

Strict TypeScript and linting across the monorepo, so type errors surface before your users find them.

MCP server

Gives Claude Code, Cursor, Codex and Gemini structured access to the kit: database, components, translations, checks and PRDs.

E2E tests with Playwright

Tests for authentication, team accounts and invitations, written with page objects you can extend.

You own the code

The full source lives in your repository. Nothing is hidden behind a package you cannot edit.

Agent skills

Skills in every Better Auth kit: /reviewer reviews the diff, /bug-hunt sweeps the codebase, and /drizzle-expert or /prisma-expert handles schemas and queries.

Also included

Everything else, already wired up

The parts nobody lists until they are missing: content, deployment, documentation, and people to ask when you get stuck.

Interface
  • Shadcn UI and Tailwind CSS v4One theme file restyles the app and the marketing site
  • Dark and light themesEvery component supports both, with a toggle built in
  • Mobile-friendly layoutsResponsive app shell, sidebar and marketing pages
  • Figma UI kitThe same components, for designing screens before you build them
Content
  • Blog and CMSKeystatic, WordPress or Supabase behind one interface
  • Help centerDocumentation pages for your own customers
  • SEO basicsPer-page metadata and a generated sitemap
Platform
  • Serverless or NodeDeploy serverless or to a long-running server, with guides for both
  • PluginsTestimonials, feedback, roadmap and waitlist, added when you need them
  • MonitoringSentry, PostHog or SigNoz behind one interface
  • Realtime notificationsIn-app, over Supabase Realtime on the Supabase kits
Learning and support
  • DocumentationFor every kit, from install to production
  • MakerKit courseBuild and launch a SaaS on the kit, step by step
  • DiscordAsk Giancarlo and other builders directly
From clone to product code in one session

A production-ready Better Auth SaaS Starter Kit

The setup, stack, and tooling are decided, so your first commit is a product feature.

Quick Setup

Clone the repository, install dependencies, and start the dev server: the full SaaS runs locally, not a demo shell.

Modern Tech Stack

Better Auth with Drizzle or Prisma 7 on Postgres, running on Next.js 16 or TanStack Start, with React 19, Zod 4, Shadcn UI, Tailwind CSS 4, and TypeScript 7.

High standards

Strict TypeScript, Oxlint, and oxfmt configured across the monorepo. The Rust-based Oxc toolchain keeps lint and format feedback fast as the codebase grows.

Authentication made easy

Authentication with Better Auth

Email and password, magic links, passkeys, OAuth, and TOTP MFA, configured in one Better Auth file and stored in your own Postgres.

Email/Password

Secure email/password authentication with built-in password reset, email verification, and account recovery flows.

Magic Link

Passwordless sign-in: users click a link in their inbox and skip the password entirely.

Passkey

WebAuthn passkeys: users sign in with Face ID, Touch ID, Windows Hello, or a hardware security key. Phishing-resistant, with nothing to reset.

Social Sign-in

Google, GitHub, Facebook, X, Discord, and many more OAuth providers ready to configure.

Multi-Factor Authentication

TOTP-based MFA to protect your users' accounts, with enrollment and challenge screens included.

Multi-tenant SaaS from day one

Multi-Tenancy with Better Auth Organizations

Better Auth's organization plugin with invitations, plus custom roles each organization defines from the UI.

Organizations and Teams

Full B2B multi-tenancy support. Let customers create workspaces, manage teams, and collaborate securely.

Team Invitations

Email-based invitation system with role assignment. Onboard team members with a single link.

Roles and Permissions

Granular role-based access control (RBAC). Define custom roles and permissions that match your product's needs.

Get Paid

Billing

Stripe or Polar subscriptions per organization, including per-seat billing with seat enforcement and metered usage.

Stripe Checkout

Stripe Checkout handles cards, Apple Pay, Google Pay, and other payment methods.

Stripe Customer Portal

Self-service subscription management. Customers update payment methods, view invoices, and cancel without opening a support ticket.

Flexible Pricing Models

Per-seat, usage-based, flat-rate subscriptions, or one-time purchases. Plans live in one billing schema that checkout and the pricing table both read.

Manage accounts from the Super Admin panel

Admin Panel

Manage your users, organizations, and build your own internal tooling within the app.

Super Admin

See users, organizations, and subscriptions in one dashboard, restricted to super admins.

Account Management

Explore, impersonate users, ban/delete accounts, all without touching the database.

UI you extend, not rebuild

Delightful UI, Built to Extend

Screens for every flow, built from the same Shadcn UI components you will use for your own features.

Landing Page

A landing page template with hero, features, pricing, and call-to-action sections to adapt to your product.

Dashboard/Charts Demo

Dashboard demo components with charts, ready to wire to your own data.

Shadcn UI Components

Every Shadcn UI component pre-installed and themed. Browse, copy, and customize from our built-in dev tools.

Pricing Table

A pricing table generated from your billing config: change a price in one place and the page follows.

Marketing, SEO, and Content

Marketing

Get found by your target audience with blog, documentation, changelog, and more.

Blog

A blog for product updates and SEO content, with per-post metadata and sitemap entries.

Documentation/Help Center

Reduce support load and improve user onboarding with the built-in documentation. Educate users and drive traffic to your product.

Changelog

Keep users engaged with product updates. Announce features, fixes, and improvements in a dedicated changelog.

Debug and Test your SaaS

Monitoring and Testing

Comprehensive monitoring and testing tools to help you keep your SaaS running smoothly.

Playwright E2E Testing

Pre-configured end-to-end tests for critical user flows. Ship with confidence, catch regressions before your users do.

Sentry, Signoz, PostHog, and more

Plug-and-play support for Sentry, PostHog, Signoz, and more. Monitor errors, track analytics, and debug production issues.

Help from the person who wrote the code

Support and Community

Ask me and the MakerKit community on Discord about setup, kit-related issues, and how the codebase fits together.

What customers say

Developers and founders on the kits, the docs and the support. Every quote links to the original post.

just wanna say thanks to @gc_psk for building @makerkit_dev . it is such an overpowered template. like finally we have a really good one with active development, good docs and now even cursorrules/windsurfrules to just sit down and see ai agents do the stuff. truly mindblowing.
CRcris@criscounters
Giancarlo Buomprisco

Built and maintained full-time by Giancarlo, a software engineer with almost 15 years of experience at startups and enterprises. Support questions reach me directly.

My favorite so far is @gc_psk and @makerkit_dev ship cursor rules along with updates to the framework. That's been really useful to pull in new version (via git remote) and things stay in sync.
RYRyan Hayeson X
Just started using MakerKit and it's a total game-changer. 🚀 Wish I had this when I was building Phishr. Instant team management and billing? Insane.
HAHarvey Coplestone@hcoplestone
Second that! Giancarlo provides amazing support!! 😄
ANAndrew Willshire@acwillshire
You need to check @makerkit_dev by @gc_psk — it’s the best I’ve seen so far. It’s feature complete, plenty examples, amazing docs, great Discord community, the dude provides support even days after his weeding (which is crazy!) I’m not affiliated in every way, just a happy cx.
IVIvor@madebyivor
Honestly @makerkit_dev is great. More for B2B products but really clean and well documented.
KIKiara Bickers@kiarabickers
Amazing! @gc_psk has built a masterpiece with this one!
ADAditya TripathiClimactic · @AdityaTripathiD
I just stumbled upon @makerkit_dev (and you!), it's impressive, I thought it was a big team behind how many features I saw (and I've been working in software a long time!) I was just looking for a free boilerplate, but the lifetime licence makes it a no brainer. Thank you!
SÉSéraphin Hochart@nsphin
I would have totally agreed with you until… I found @makerkit_dev last year. This is by far, the best boilerplate I found those past years. The dev is pushing new features and updates almost every week. His documentation (specially migrating to Next 15) is the best I’ve seen.
DADavid Dias@TheDavidDias
Makerkit is a gem for makers, if I was not building a desktop app I would be using it for sure, maybe for my next project
KHKhalil NajjarCohere AI · @knajjars
I landed on MakerKit after getting into boilerplates with ShipFast. Much better.
WIWill Mitchell@StartupBros
1000% recommend buying a good boilerplate (or making your own) I use @makerkit_dev it's so good I had an affiliate link, but I can't find it at the moment
DADan Schoonmaker@DanSchoonmaker
For anyone who wants to build their own SaaS, I recommend trying out @makerkit_dev. Thanks to @gc_psk for creating such a fantastic tool that makes building websites a breeze! #SaaS #buildinpublic
CACarl Chan@CarlChan77
We loved the product since when Giancarlo released the first version, and are building upon it ever since for all of our products. Highly recommended for all indie makers out there.
RARade JoksimovicRumora · on X
Solid and battle tested boilerplate with an amazing community and support.
STStefano CantuWiseOptIn · on X
Build vs buy

Better Auth is a library, not a SaaS

Adding Better Auth to an app is the quick part. Wiring its organizations to roles, invitations, per-seat billing, and an admin panel takes longer. With AI coding tools, that is still 49-81 hours of senior developer time, including fixing the patterns AI got wrong.

Maintained full-time
Since 2022
Kits across 4 frameworks
8
Data layers: Supabase, Drizzle, Prisma
3
Build onceBefore your first feature
Authentication (email, OAuth, MFA)6-10 hours
Stripe subscription billing5-8 hours
Teams, roles & invitations6-10 hours
Super admin dashboard4-6 hours
Transactional emails3-5 hours
Marketing pages2-4 hours
Blog & documentation3-5 hours
Project setup (monorepo, CI, TypeScript)2-3 hours
E2E tests (auth and billing flows)3-5 hours
Maintain foreverAfter launch, for as long as it runs
Refactoring AI-generated patterns15-25 hours
Next.js/React version upgradesEvery major release
Security patches & fixesOngoing, unpredictable
Dependency updatesOngoing

Hours with Claude Code or Cursor · bar shows the range on a 0–25h scale

Building it yourself49-81 hoursWith AI tools, including rework
Developer time saved$7,350-$12,150At $150 an hour
With MakerKitDay 1Every row above ships in the kit, and upgrades keep coming
Get lifetime access

Estimates for a senior developer building from scratch with Claude Code or Cursor at $150/hour, including 15-25 hours refactoring AI-generated patterns. Read the methodology

In short

A Better Auth SaaS boilerplate: self-hosted authentication, with the SaaS already built around it

Better Auth handles identity. MakerKit adds the organizations, roles, billing, and admin that turn it into a product.

What is the MakerKit Better Auth SaaS Starter Kit?

The MakerKit Better Auth SaaS Starter Kit is the Drizzle or Prisma edition of MakerKit, available for Next.js 16 and TanStack Start. Better Auth runs inside your app and stores users, sessions, and organizations in your own Postgres. The kit adds organizations with invitations and custom roles, passkeys, MFA, Stripe or Polar billing, and a super admin with impersonation.

Auth in your database

Users, sessions, and organizations live in your Postgres. No external auth service and no per-user pricing.

Organizations and custom roles

Better Auth's organization plugin with invitations, plus roles each organization defines from the UI.

Every sign-in method

Email and password, magic links, passkeys, OAuth, and TOTP MFA, with rate limiting and captcha plugins.

Stripe or Polar billing

Per-organization subscriptions with per-seat enforcement and metered usage.

Two frameworks, two ORMs

Next.js 16 or TanStack Start, with Drizzle or Prisma 7. Same features in every combination.

Built for AI coding agents

AGENTS.md and CLAUDE.md files at the root and in each package, rules for Claude Code, Cursor, Codex, and Gemini, and an MCP server your agent can call.

Best for

  • Teams that want users and sessions in their own database, with no per-user auth pricing
  • B2B SaaS that needs organizations and custom roles per customer
  • Developers who prefer Drizzle or Prisma on any Postgres host over a managed backend

Not for

  • Teams that want a vendor-hosted auth dashboard and prebuilt user management
  • Projects already committed to Supabase Auth and RLS; the Supabase kit fits better
  • Anyone who does not want to own auth security settings in production

With and without MakerKit

Without MakerKit: Hosted auth that bills per active user

With MakerKit: Self-hosted Better Auth with no per-user fees

Without MakerKit: Better Auth installed, organizations still unwired to billing

With MakerKit: Organizations connected to roles, invitations, seats, and admin

Without MakerKit: Your user table held by a vendor

With MakerKit: Your user table in your own Postgres

Without MakerKit: Roles hardcoded for every customer

With MakerKit: Custom roles each organization manages

Choose your Better Auth stack: Drizzle or Prisma

Each license includes the Next.js and TanStack Start kits for that ORM. One-time purchase: lifetime license, continuous updates, unlimited projects of your own.

  • Lifetime access to your stack of choice
  • Build unlimited applications
  • Continuous updates
  • Access to the Discord community
  • The best support in the SaaS Starter kits market, period.
  • Community and Chat support
  • Community-based feature requests and Request for Comments. You have a say in what Makerkit should build next.
  • One-time payment, no subscriptions
  • Includes access to our free Figma UI kit

Choose your Stack

Select the technology stack that best fits your project

Pro
A B2B SaaS Starter Kit for individual developers.

$349$299/lifetime

  • Next.js 16 and Tanstack Start
  • Drizzle and Better Auth
  • Bring your own database
  • Agent rules, MCP server and agent skills
  • Unlimited Projects
  • Continuous updates
  • Lifetime license
  • Access to 1 user (only you)
  • Discord Support
Teams
A B2B SaaS Starter Kit for teams of developers or companies.

$649$599/lifetime

  • Next.js 16 and Tanstack Start
  • Drizzle and Better Auth
  • Bring your own database
  • Agent rules, MCP server and agent skills
  • Unlimited Projects
  • Continuous updates
  • Lifetime license
  • Access to 5 users
  • Discord Support
  • Private Discord Threads

Questions about licensing?

Read the MakerKit license terms and the MakerKit FAQ, or contact me.

Questions before you buy

Better Auth SaaS Starter Kit FAQ

Not covered here? Ask in Discord or contact me.

What is the Better Auth SaaS Starter Kit?

It is MakerKit's Drizzle and Prisma kits, which use Better Auth for authentication. Each is available for Next.js 16 and TanStack Start and ships email and password, magic links, passkeys, OAuth, TOTP MFA, organizations with invitations and roles, a super admin with user impersonation, and Stripe or Polar billing.

Why use Better Auth instead of Clerk or Auth0?

Ownership and cost. Better Auth runs inside your app and stores users, sessions, and organizations in your own Postgres, so there is no per-user auth pricing and no third party holding your user table. The trade-off is that you operate auth yourself: secrets, email verification, and rate limiting are configured by the kit, and keeping them on in production is your job.

How do organizations and roles work with Better Auth?

The kit configures Better Auth's organization plugin for teams, members, and invitations, and adds custom roles that each organization can define from the UI without code changes. Your code checks access through the kit's permissions API and custom authorization policies.

Drizzle or Prisma: which Better Auth kit should I buy?

Drizzle if you like queries that read like SQL and no generated client. Prisma 7 if your team already knows Prisma's schema language and client. Auth, organizations, billing, and admin are the same in both, and each is its own license, so pick the ORM you want to live with.

Can users sign up without creating an organization?

Yes. Account modes let you run personal accounts only (B2C), organizations only (B2B), or both (B2B2C), chosen in configuration.

Which databases and hosts does it support?

PostgreSQL from any provider: Neon, Supabase Postgres, Railway, or your own server. The deployment docs cover Docker and Railway, and because Better Auth runs in-process there is no separate auth service to deploy.

Is MakerKit a one-time purchase or a subscription?

A one-time purchase. You get a lifetime license to the source code, continuous updates for the stack you bought, and unlimited projects for your own business, with no renewal fee. Building products for clients requires a Team license, and each client that receives the code needs their own license.

What support is included?

Discord support from me, Giancarlo, the founder who works on MakerKit full-time, and from the community. I help with setup, kit-related issues, and questions about the codebase. Team licenses add a private Discord channel for your team.

Own your auth. Skip the plumbing around it.

Better Auth, organizations, custom roles, and billing, already connected in your own Postgres. Pick Drizzle or Prisma above and start on the product instead of the auth wiring.

Read the Better Auth kit docs
Claude CodeCursorGemini