# Nuxt Better Auth ## Documentation Sets - [Nuxt Better Auth](https://better-auth.nuxt.dev/llms-full.txt) ## Docs Every page below is available as raw markdown. - [Auto‑Imports and Aliases](https://better-auth.nuxt.dev/raw/core-concepts/auto-imports-aliases.md): What the module registers for you. - [Route Protection](https://better-auth.nuxt.dev/raw/core-concepts/route-protection.md): Learn how to protect your pages and API routes using a layered approach. - [Security & Caveats](https://better-auth.nuxt.dev/raw/core-concepts/security-caveats.md): What is enforced where, and what you should not assume. - [serverAuth()](https://better-auth.nuxt.dev/raw/core-concepts/server-auth.md): When to reach for the full Better Auth server instance. - [Sessions](https://better-auth.nuxt.dev/raw/core-concepts/sessions.md): Access reactive session state with SSR support using `useUserSession()`. - [Error reference](https://better-auth.nuxt.dev/raw/errors.md): Find the cause and fix for Nuxt Better Auth module setup and schema generation errors. - [NUXT_AUTH_CLI_MISSING: Better Auth CLI is not installed](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-cli-missing.md): Install the auth package so the module can generate the NuxtHub schema. - [NUXT_AUTH_CLI_VERSION_MISMATCH: Better Auth CLI version does not match better-auth](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-cli-version-mismatch.md): Align auth and better-auth so the app resolves one copy of Better Auth. - [NUXT_AUTH_CONFIG_LOAD_FAILED: Auth configuration failed to load](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-config-load-failed.md): Resolve missing imports or environment variables that prevent the server auth config from loading. - [NUXT_AUTH_EMPTY_SCHEMA: Schema generator returned no code](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-empty-schema.md): Check Better Auth database options and plugins when schema generation returns an empty result. - [NUXT_AUTH_INVALID_CONFIG_EXPORT: Invalid server auth config export](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-invalid-config-export.md): Export defineServerAuth(...) as the default export of your server auth config. - [NUXT_AUTH_INVALID_PLUGIN_SOURCE: Auth plugin path must be absolute](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-invalid-plugin-source.md): Resolve plugin file paths before registering them with better-auth:plugins:extend. - [NUXT_AUTH_MISSING_CONFIG: Missing auth configuration](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-missing-config.md): Create the server or client auth config file that Nuxt Better Auth could not find. - [NUXT_AUTH_MISSING_HUB_DB: NuxtHub database alias is missing](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-missing-hub-db.md): Configure NuxtHub before Nuxt Better Auth so the hub:db alias is available. - [NUXT_AUTH_NO_DATABASE_PROVIDER: No database provider is enabled](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-no-database-provider.md): Restore an enabled module database provider after changing the provider registry. - [NUXT_AUTH_SCHEMA_GENERATION_FAILED: Auth schema generation failed](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-schema-generation-failed.md): Resolve an underlying plugin, filesystem, or schema-generation error during Nuxt setup. - [NUXT_AUTH_SCHEMA_STORAGE_REQUIRED: Custom session storage is missing](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-schema-storage-required.md): Provide secondaryStorage or retain the session table when generating the auth schema. - [NUXT_AUTH_STORAGE_CLIENT_ONLY: Secondary storage in client-only mode](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-storage-client-only.md): Remove server secondary-storage configuration from an app that only connects to an external auth server. - [NUXT_AUTH_UNSUPPORTED_DIALECT: Unsupported database dialect](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-unsupported-dialect.md): Select sqlite, postgresql, or mysql for NuxtHub auth schema generation. - [Introduction](https://better-auth.nuxt.dev/raw/getting-started.md): Nuxt Better Auth integrates Better Auth with Nuxt for route protection, session management, and schema generation. - [Client Setup](https://better-auth.nuxt.dev/raw/getting-started/client-setup.md): Configure the client-side authentication client. - [Configuration](https://better-auth.nuxt.dev/raw/getting-started/configuration.md): Configure the module options and your Better Auth server instance. - [How It Works](https://better-auth.nuxt.dev/raw/getting-started/how-it-works.md): Understand the architecture after completing setup. - [Installation](https://better-auth.nuxt.dev/raw/getting-started/installation.md): Learn how to add Nuxt Better Auth to your Nuxt project. - [Schema Generation](https://better-auth.nuxt.dev/raw/getting-started/schema-generation.md): Auto-generate Drizzle ORM schemas for Better Auth tables when using NuxtHub. - [Type Augmentation](https://better-auth.nuxt.dev/raw/getting-started/type-augmentation.md): Learn how the module automatically infers types from your configuration. - [Custom Database](https://better-auth.nuxt.dev/raw/guides/custom-database.md): Use your own database with Drizzle, Prisma, or Kysely adapters. - [Database-less Mode](https://better-auth.nuxt.dev/raw/guides/database-less-mode.md): Run Better Auth without a database for edge and serverless deployments. - [Setup diagnostics](https://better-auth.nuxt.dev/raw/guides/diagnostics.md): Resolve module setup and schema generation failures using their diagnostic codes. - [External Auth Backend](https://better-auth.nuxt.dev/raw/guides/external-auth-backend.md): Use nuxt-better-auth with a separate Better Auth server. - [Migrating from nuxt-auth-utils](https://better-auth.nuxt.dev/raw/guides/migrate-from-nuxt-auth-utils.md): Step-by-step guide to migrate from nuxt-auth-utils to Nuxt Better Auth. - [OAuth Providers](https://better-auth.nuxt.dev/raw/guides/oauth-providers.md): Configure OAuth providers and sign in with `useSignIn('social')`. - [Production Deployment](https://better-auth.nuxt.dev/raw/guides/production-deployment.md): Checklist and best practices for deploying Nuxt Better Auth in production. - [Role‑Based Access](https://better-auth.nuxt.dev/raw/guides/role-based-access.md): Protect routes using generic field matching on AuthUser. - [Testing](https://better-auth.nuxt.dev/raw/guides/testing.md): Mock reactive sessions in Nuxt component tests and create real sessions for end-to-end tests. - [Two-Factor Authentication (TOTP + Backup Codes)](https://better-auth.nuxt.dev/raw/guides/two-factor-auth.md): Enable two-factor auth using the Better Auth two-factor plugin. - [Convex](https://better-auth.nuxt.dev/raw/integrations/convex.md): Current status of Convex integration in this module. - [DevTools](https://better-auth.nuxt.dev/raw/integrations/devtools.md): Inspect auth configuration and manage users/sessions during development. - [i18n](https://better-auth.nuxt.dev/raw/integrations/i18n.md): Translate authentication errors with @nuxtjs/i18n. - [NuxtHub](https://better-auth.nuxt.dev/raw/integrations/nuxthub.md): Automatic database setup with schema generation and Drizzle ORM integration. ## Landing Every page below is available as raw markdown. - [Nuxt Better Auth](https://better-auth.nuxt.dev/raw/index.md): Seamless Better Auth integration for Nuxt with automatic route protection, session management, and role-based access control. ## Content Every page below is available as raw markdown. - [Nuxt Better Auth](https://better-auth.nuxt.dev/raw/index.md): Seamless Better Auth integration for Nuxt with automatic route protection, session management, and role-based access control. - [Auto‑Imports and Aliases](https://better-auth.nuxt.dev/raw/core-concepts/auto-imports-aliases.md): What the module registers for you. - [Route Protection](https://better-auth.nuxt.dev/raw/core-concepts/route-protection.md): Learn how to protect your pages and API routes using a layered approach. - [Security & Caveats](https://better-auth.nuxt.dev/raw/core-concepts/security-caveats.md): What is enforced where, and what you should not assume. - [serverAuth()](https://better-auth.nuxt.dev/raw/core-concepts/server-auth.md): When to reach for the full Better Auth server instance. - [Sessions](https://better-auth.nuxt.dev/raw/core-concepts/sessions.md): Access reactive session state with SSR support using `useUserSession()`. - [Error reference](https://better-auth.nuxt.dev/raw/errors.md): Find the cause and fix for Nuxt Better Auth module setup and schema generation errors. - [NUXT_AUTH_CLI_MISSING: Better Auth CLI is not installed](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-cli-missing.md): Install the auth package so the module can generate the NuxtHub schema. - [NUXT_AUTH_CLI_VERSION_MISMATCH: Better Auth CLI version does not match better-auth](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-cli-version-mismatch.md): Align auth and better-auth so the app resolves one copy of Better Auth. - [NUXT_AUTH_CONFIG_LOAD_FAILED: Auth configuration failed to load](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-config-load-failed.md): Resolve missing imports or environment variables that prevent the server auth config from loading. - [NUXT_AUTH_EMPTY_SCHEMA: Schema generator returned no code](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-empty-schema.md): Check Better Auth database options and plugins when schema generation returns an empty result. - [NUXT_AUTH_INVALID_CONFIG_EXPORT: Invalid server auth config export](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-invalid-config-export.md): Export defineServerAuth(...) as the default export of your server auth config. - [NUXT_AUTH_INVALID_PLUGIN_SOURCE: Auth plugin path must be absolute](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-invalid-plugin-source.md): Resolve plugin file paths before registering them with better-auth:plugins:extend. - [NUXT_AUTH_MISSING_CONFIG: Missing auth configuration](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-missing-config.md): Create the server or client auth config file that Nuxt Better Auth could not find. - [NUXT_AUTH_MISSING_HUB_DB: NuxtHub database alias is missing](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-missing-hub-db.md): Configure NuxtHub before Nuxt Better Auth so the hub:db alias is available. - [NUXT_AUTH_NO_DATABASE_PROVIDER: No database provider is enabled](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-no-database-provider.md): Restore an enabled module database provider after changing the provider registry. - [NUXT_AUTH_SCHEMA_GENERATION_FAILED: Auth schema generation failed](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-schema-generation-failed.md): Resolve an underlying plugin, filesystem, or schema-generation error during Nuxt setup. - [NUXT_AUTH_SCHEMA_STORAGE_REQUIRED: Custom session storage is missing](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-schema-storage-required.md): Provide secondaryStorage or retain the session table when generating the auth schema. - [NUXT_AUTH_STORAGE_CLIENT_ONLY: Secondary storage in client-only mode](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-storage-client-only.md): Remove server secondary-storage configuration from an app that only connects to an external auth server. - [NUXT_AUTH_UNSUPPORTED_DIALECT: Unsupported database dialect](https://better-auth.nuxt.dev/raw/errors/nuxt-auth-unsupported-dialect.md): Select sqlite, postgresql, or mysql for NuxtHub auth schema generation. - [Introduction](https://better-auth.nuxt.dev/raw/getting-started.md): Nuxt Better Auth integrates Better Auth with Nuxt for route protection, session management, and schema generation. - [Client Setup](https://better-auth.nuxt.dev/raw/getting-started/client-setup.md): Configure the client-side authentication client. - [Configuration](https://better-auth.nuxt.dev/raw/getting-started/configuration.md): Configure the module options and your Better Auth server instance. - [How It Works](https://better-auth.nuxt.dev/raw/getting-started/how-it-works.md): Understand the architecture after completing setup. - [Installation](https://better-auth.nuxt.dev/raw/getting-started/installation.md): Learn how to add Nuxt Better Auth to your Nuxt project. - [Schema Generation](https://better-auth.nuxt.dev/raw/getting-started/schema-generation.md): Auto-generate Drizzle ORM schemas for Better Auth tables when using NuxtHub. - [Type Augmentation](https://better-auth.nuxt.dev/raw/getting-started/type-augmentation.md): Learn how the module automatically infers types from your configuration. - [Custom Database](https://better-auth.nuxt.dev/raw/guides/custom-database.md): Use your own database with Drizzle, Prisma, or Kysely adapters. - [Database-less Mode](https://better-auth.nuxt.dev/raw/guides/database-less-mode.md): Run Better Auth without a database for edge and serverless deployments. - [Setup diagnostics](https://better-auth.nuxt.dev/raw/guides/diagnostics.md): Resolve module setup and schema generation failures using their diagnostic codes. - [External Auth Backend](https://better-auth.nuxt.dev/raw/guides/external-auth-backend.md): Use nuxt-better-auth with a separate Better Auth server. - [Migrating from nuxt-auth-utils](https://better-auth.nuxt.dev/raw/guides/migrate-from-nuxt-auth-utils.md): Step-by-step guide to migrate from nuxt-auth-utils to Nuxt Better Auth. - [OAuth Providers](https://better-auth.nuxt.dev/raw/guides/oauth-providers.md): Configure OAuth providers and sign in with `useSignIn('social')`. - [Production Deployment](https://better-auth.nuxt.dev/raw/guides/production-deployment.md): Checklist and best practices for deploying Nuxt Better Auth in production. - [Role‑Based Access](https://better-auth.nuxt.dev/raw/guides/role-based-access.md): Protect routes using generic field matching on AuthUser. - [Testing](https://better-auth.nuxt.dev/raw/guides/testing.md): Mock reactive sessions in Nuxt component tests and create real sessions for end-to-end tests. - [Two-Factor Authentication (TOTP + Backup Codes)](https://better-auth.nuxt.dev/raw/guides/two-factor-auth.md): Enable two-factor auth using the Better Auth two-factor plugin. - [Convex](https://better-auth.nuxt.dev/raw/integrations/convex.md): Current status of Convex integration in this module. - [DevTools](https://better-auth.nuxt.dev/raw/integrations/devtools.md): Inspect auth configuration and manage users/sessions during development. - [i18n](https://better-auth.nuxt.dev/raw/integrations/i18n.md): Translate authentication errors with @nuxtjs/i18n. - [NuxtHub](https://better-auth.nuxt.dev/raw/integrations/nuxthub.md): Automatic database setup with schema generation and Drizzle ORM integration.