# Documentation - [Introduction](/docs): payload-auth replaces Payload CMS's built-in authentication with Better Auth, so your admin panel and your app share a single auth system. - Getting started - [Installation](/docs/getting-started/installation): Install payload-auth and wire it into a Payload CMS + Next.js project. - [Create your first admin](/docs/getting-started/first-admin): How payload-auth bootstraps the first admin user and what happens on a fresh database. - [Client setup](/docs/getting-started/client-setup): Create a typed Better Auth client for your frontend. - Concepts - [How it works](/docs/concepts/how-it-works): The architecture behind payload-auth — a database adapter, a config transformer, and a Payload auth strategy. - [Collections](/docs/concepts/collections): Which Payload collections payload-auth generates, and how to rename, hide or extend them. - [Admin panel integration](/docs/concepts/admin-panel): How payload-auth replaces Payload's auth views and what it changes in the admin UI. - [Roles and access control](/docs/concepts/roles-and-access): How roles are defined, who can reach the admin panel, and what access control the generated collections use. - [Sessions and cookies](/docs/concepts/sessions): How Better Auth sessions work through Payload, including the cookie cache and saveToJWT. - Guides - [Email and password](/docs/guides/email-password): Enable email/password sign-in, email verification and password resets. - [Social providers](/docs/guides/social-providers): Add Google, GitHub, Apple and other OAuth providers to both your app and the Payload admin panel. - [Passkeys and two-factor](/docs/guides/passkeys-and-2fa): Add WebAuthn passkeys and TOTP two-factor authentication, including the admin panel views. - [Organizations and teams](/docs/guides/organizations): Multi-tenancy with the Better Auth organization plugin, backed by Payload collections. - [Admin invitations](/docs/guides/admin-invitations): Invite new admins, and optionally require an invitation for every sign-up. - [Server-side usage](/docs/guides/server-side): Reading sessions, calling the Better Auth API, and using the Payload Local API from server components and route handlers. - [Database and migrations](/docs/guides/database-migrations): Creating the auth tables, keeping migrations in sync, and generating a standalone schema. - Reference - [Plugin options](/docs/reference/plugin-options): Every option accepted by betterAuthPlugin(). - [Exports](/docs/reference/exports): Every entry point the payload-auth package exposes, and what lives behind it. - [Adapter](/docs/reference/adapter): The Better Auth database adapter that talks to Payload's Local API. - [Better Auth plugin support](/docs/reference/better-auth-plugins): Which Better Auth plugins are configured automatically, which pass through, and what each one adds. - [Troubleshooting](/docs/troubleshooting): Common problems and what causes them. - [Using with AI agents](/docs/ai-agents): Feed these docs to Cursor, Claude Code, Copilot or any other coding agent.