> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/better-auth/better-auth/llms.txt
> Use this file to discover all available pages before exploring further.

# Better Auth

> The most comprehensive authentication framework for TypeScript. Framework-agnostic, extensible, and production-ready.

Better Auth is a framework-agnostic authentication and authorization library for TypeScript. It provides a comprehensive set of features out of the box — email/password, social OAuth, passkeys, two-factor auth, multi-tenancy — and includes a rich plugin ecosystem that lets you add advanced functionality with minimal code.

<CardGroup cols={2}>
  <Card title="Installation" icon="download" href="/installation">
    Install Better Auth and connect it to your project in minutes.
  </Card>

  <Card title="Basic Usage" icon="play" href="/basic-usage">
    Learn how to sign users in, manage sessions, and use the client SDK.
  </Card>

  <Card title="Plugins" icon="puzzle-piece" href="/plugins/overview">
    Extend Better Auth with 2FA, organizations, SSO, passkeys, and more.
  </Card>

  <Card title="API Reference" icon="code" href="/reference/options">
    Explore all configuration options and the full public API surface.
  </Card>
</CardGroup>

## Why Better Auth?

Authentication in the TypeScript ecosystem is a half-solved problem. Most libraries require significant custom code for anything beyond basic sign-in. Better Auth aims to be the last auth library you'll ever need.

<CardGroup cols={3}>
  <Card title="Framework agnostic" icon="layer-group">
    Works with Next.js, Nuxt, SvelteKit, Hono, Express, Expo, and any runtime that supports standard Request/Response.
  </Card>

  <Card title="Rich plugin system" icon="plug">
    Add 2FA, organizations, passkeys, OIDC provider, magic links, SSO, and more with a single line of code.
  </Card>

  <Card title="Type-safe by default" icon="shield-check">
    Full TypeScript support with inferred types across your server and client — no type casting needed.
  </Card>

  <Card title="Multiple databases" icon="database">
    Native adapters for Drizzle, Prisma, MongoDB, SQLite, PostgreSQL, and MySQL.
  </Card>

  <Card title="30+ OAuth providers" icon="key">
    Built-in support for Google, GitHub, Apple, Discord, and dozens more social providers.
  </Card>

  <Card title="Enterprise ready" icon="building">
    Multi-tenant organizations, SCIM provisioning, SAML SSO, and OIDC provider support.
  </Card>
</CardGroup>

## Get started in 5 minutes

<Steps>
  <Step title="Install Better Auth">
    ```bash theme={null}
    npm install better-auth
    ```
  </Step>

  <Step title="Create your auth instance">
    ```typescript auth.ts theme={null}
    import { betterAuth } from "better-auth";

    export const auth = betterAuth({
      database: /* your database connection */,
      emailAndPassword: { enabled: true },
    });
    ```
  </Step>

  <Step title="Mount the handler">
    ```typescript app/api/auth/[...all]/route.ts theme={null}
    import { auth } from "@/lib/auth";
    import { toNextJsHandler } from "better-auth/next-js";

    export const { POST, GET } = toNextJsHandler(auth);
    ```
  </Step>

  <Step title="Create a client">
    ```typescript lib/auth-client.ts theme={null}
    import { createAuthClient } from "better-auth/react";

    export const authClient = createAuthClient();
    ```
  </Step>
</Steps>

<Card title="Follow the full installation guide" icon="arrow-right" href="/installation">
  Get step-by-step instructions including database setup, CLI migration, and framework-specific configuration.
</Card>
