Skip to content

Better Auth

Better Auth is an open-source authentication framework for TypeScript. It runs inside your own app and keeps users and sessions in your own database.

It supports email and password, OAuth providers like GitHub and Google, and plugins for two-factor sign-in, passkeys and organizations.

New to Better Auth? Start with What is Better Auth?.

An Auth service is a Better Auth configuration:

import { BetterAuth } from "@alchemy.run/better-auth";
const makeAuth = BetterAuth({
basePath: "/api/auth",
emailAndPassword: { enabled: true },
});

Alchemy binds its database, applies its migrations on deploy, and serves its routes from your Worker or Lambda. Pick a sign-in provider and a database to go with it.

Want to build? The tutorial builds an app with browser sign-in, session middleware and GitHub sign-in, in six parts.

Looking for something specific? Every section of these docs is listed below, and every resource is in the generated API reference.