Nuxt Better Auth is a Nuxt 4 module that wraps Better Auth with Nuxt-native configuration, route protection, SSR-safe session access, and optional NuxtHub schema generation.

Start here

Use the docs in this order if you are setting up the module for the first time:

  1. Quickstart
  2. Installation
  3. Configuration
  4. Client setup
  5. Route protection

You should finish that path with a working /api/auth/* backend, a client config, and a login flow that can read session state through useUserSession().

Choose the right setup

If you want to...Start here
Get a database-backed setup running quicklyNuxtHub
Plug Better Auth into your own database stackCustom database
Reuse an external Better Auth serverExternal auth backend
Avoid a database and accept stateless session tradeoffsDatabase-less mode
Migrate from nuxt-auth-utilsMigration guide

What the module adds on top of Better Auth

  • server/auth.config.ts and app/auth.config.ts helpers
  • auto-imported client and server auth utilities
  • route protection through routeRules and page meta
  • SSR-aware session hydration
  • typed AuthUser and AuthSession inference from your config
  • optional NuxtHub database and schema integration

Documentation map

Getting started

Core concepts

Guides and integrations

API reference