1---
2title: Better Auth
3description: Build authentication with an Effect service, automatic database bindings, and deploy-time migrations.
4---
5
6Build sign-in and protected APIs with [Better Auth](https://better-auth.com), using ordinary Effect services and layers. Alchemy supplies database bindings, a stable signing secret, and supported schema migrations.
7
8## Start the tutorial
9
10```typescript
11import { BetterAuth } from "@alchemy.run/better-auth";
12
13const makeAuth = BetterAuth({
14 basePath: "/api/auth",
15 emailAndPassword: { enabled: true },
16});
17```
18
19The [six-part tutorial](/better-auth/tutorial/part-1) turns this into a running application with browser sign-in, session middleware, and GitHub authentication.
20
21| Part | Build |
22| --- | --- |
23| [1. Create an Auth service](/better-auth/tutorial/part-1) | Install the module and provide a database layer |
24| [2. Mount the HTTP API](/better-auth/tutorial/part-2) | Serve authentication and application routes |
25| [3. Build sign-in](/better-auth/tutorial/part-3) | Sign up, sign in, read sessions, and sign out |
26| [4. Protect API endpoints](/better-auth/tutorial/part-4) | Provide the current user through Effect middleware |
27| [5. Add GitHub sign-in](/better-auth/tutorial/part-5) | Register an OAuth app and bind its credentials |
28| [6. Deploy and verify](/better-auth/tutorial/part-6) | Configure production callbacks and check persistence |
29
30## Choose a sign-in provider
31
32Use [email/password](/better-auth/sign-in-providers/email-password), [GitHub](/better-auth/sign-in-providers/github), [Google](/better-auth/sign-in-providers/google), [Microsoft](/better-auth/sign-in-providers/microsoft), or [custom OAuth](/better-auth/sign-in-providers/custom-oauth). Each guide covers registration, configuration, and browser sign-in.
33
34## Choose a database
35
36Keep the Auth service and change the database layer. The [database guides](/better-auth/databases) cover D1, Hyperdrive, Neon, Aurora, Postgres, MySQL, Drizzle, SQLite, and memory.
37
38## Extend the application
39
40Use [Config and secrets](/better-auth/guides/configuration) for deployment bindings, [HTTP API middleware](/better-auth/guides/http-api-middleware) for Effect handlers, and [secondary storage](/better-auth/guides/secondary-storage) for custom storage layers.
41
42For Better Auth's authentication features and options, see the [Better Auth documentation](https://better-auth.com/docs).
43
44## Upgrade an existing installation
45
46The [1.6 → 1.7.5 upgrade guide](/better-auth/upgrades/from-1-6-to-1-7) separates package and API changes from manual data preparation. [Migrations](/better-auth/guides/migrations) explains what deployment applies automatically.