nuxt-better-auth

Installation
Summary

Authentication for Nuxt 4+ with composables, server helpers, and route protection.

  • Provides useUserSession() composable for client-side auth flows (login, signup, signout) and requireUserSession() server helper for API route protection
  • Supports route protection via routeRules and definePageMeta with role-based access control
  • Integrates Better Auth plugins including admin, passkey, and 2FA capabilities
  • Includes NuxtHub database setup with Drizzle schema and clientOnly mode for external auth backends
  • Currently in alpha (v0.0.2-alpha.19) and not recommended for production use
SKILL.md

Nuxt Better Auth

Authentication module for Nuxt 4+ built on Better Auth. Provides composables, server utilities, and route protection.

Alpha Status: This module is currently in alpha (v0.0.2-alpha.19) and not recommended for production use. APIs may change.

When to Use

  • Installing/configuring @onmax/nuxt-better-auth
  • Implementing login/signup/signout flows
  • Protecting routes (client and server)
  • Accessing user session in API routes
  • Integrating Better Auth plugins (admin, passkey, 2FA)
  • Setting up database with NuxtHub
  • Using clientOnly mode for external auth backends
  • Adding i18n support with @nuxtjs/i18n

For Nuxt patterns: use nuxt skill For NuxtHub database: use nuxthub skill

Related skills

More from onmax/nuxt-skills

Installs
1.3K
GitHub Stars
658
First Seen
Jan 19, 2026