saas-starter
better-auth: Easy SaaS Auth
Get comprehensive authentication with better-auth. For SaaS founders.
29,504 stars2,784 forksTypeScriptHealth Score 8/10Updated 8/9/2026100% free · open source
What it does
Better-auth provides a comprehensive authentication system for SaaS applications, handling user registration, login, and authorization in a secure and scalable manner.
Install / run
npm install @better-auth/coreWhen to use it
- •When building a SaaS application that requires secure user authentication and authorization
- •When needing to integrate multiple authentication providers, such as Google, Facebook, or GitHub
- •When requiring a customizable and extensible authentication system to fit specific business needs
Quick start
- 1Create a new instance of the BetterAuth class, passing in your application's configuration: `const betterAuth = new BetterAuth({ clientId: 'your_client_id', clientSecret: 'your_client_secret' })`
- 2Configure the authentication providers using the `betterAuth.providers` object, for example: `betterAuth.providers.google = { clientId: 'your_google_client_id', clientSecret: 'your_google_client_secret' }`
- 3Implement the authentication flow using the `betterAuth.authenticate()` method, which returns a promise that resolves to an authentication result object
- 4Use the `betterAuth.authorize()` method to check if a user has permission to access a specific resource or perform a specific action
- 5Refer to the example configuration file `config.example.ts` in the BetterAuth repository for a complete example of how to configure the library
Ready-to-paste prompt
To authenticate a user with Google, use the following code: `betterAuth.authenticate('google').then((result) => console.log(result))`Heads up: Make sure to handle errors properly when using the `betterAuth.authenticate()` and `betterAuth.authorize()` methods, as they can throw exceptions if the authentication or authorization process fails, for example: `betterAuth.authenticate('google').catch((error) => console.error(error))`
Saves to your device
Topics
authentication
iam
oauth
oauth2
oidc
sso
stripe
typescript
How better-auth: Easy SaaS Auth works
Codeflow
Free to inspect
Better-auth: Easy SaaS Auth is a very large TypeScript project (~301k lines across 1397 code files, plus 168 test files). Setup is light: installs like a normal app. Reading the code is optional. Last commit this month, MIT license, has a test suite.
Size
Very large codebase
~301k lines · 1397 code files · days to read — use, don't read
Setup
One-command install
Installs like a normal app. Reading the code is optional.
Runs on
Node.js · Docker
No API keys detected
TypeScript 100%
Where to start reading
- 1README.mdStart here — what it does and how to install it
- 2AGENTS.mdThe instructions the AI actually follows
- 3package.jsonDependencies and the commands it exposes
- 4demo/electron/.gitignoreA worked example — copy this to get going
What's in each folder
READMEHas testsDocumentedCI checksDocker readyExamples includedMIT licenseUpdated this month
Details
Creator
better-auth
Language
TypeScript
Category
saas-starter
Published
5/19/2024
Are you the creator of this tool? Claim your listing → and earn 85% of every sale.
Related skills
More saas-starter tools founders pair with this one.
saas-starter★ 43,346
Hyperswitch: Reduce Payment Costs
Get a composable payments platform with Hyperswitch, for founders in fintech. With 43k+ GitHub stars, simplify payment ops and uplift authorization.
saas-starter★ 23,669
react-starter-kit: Fast Web Apps
Build fast web apps with react-starter-kit, a production-ready monorepo for startup founders, backed by 24k+ GitHub stars.
saas-starter★ 15,556
Jumpstart SaaS with open-saas
Get a free, full-featured JS SaaS boilerplate for startup founders, with 15k+ GitHub stars.
saas-starter★ 8,943
PraisonAI: Autonomous AI Agents
Ship self-improving agents with PraisonAI. For founders needing AI workforce solutions.
saas-starter★ 4,913
saas-starter-kit: Fast SaaS Setup
Get a Next.js SaaS boilerplate for quick enterprise app development, ideal for startup founders, with 4.8k+ GitHub stars
saas-starter★ 4,491
SaaS Boilerplate
Get a head start with SaaS boilerplate, a productive stack for founders. 4.5k+ GitHub stars