mcpField
N
nuxt-better-auth

nuxt-better-auth

github.com/onmaxDevelopment7232.0k installsUpdated today
Repository

About nuxt-better-auth

A skill for integrating Better Auth with Nuxt. It provides task-specific guidance for client and server auth, route protection, plugins, and databases, with attention to session handling.

Key features

  1. 01Task-specific reference selection
  2. 02Client sessions and auth UI
  3. 03Server-side session handling
  4. 04Page and API route protection
  5. 05Plugin and database configuration

Use cases

  1. 01Integrating the Better Auth module
  2. 02Reading or updating sessions
  3. 03Protecting pages and API routes
  4. 04Connecting to an external Better Auth server

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/onmax/nuxt-skills --skill nuxt-better-auth

After installing, type/nuxt-better-authin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
client-auth.md
client-only.md
database.md
installation.md
plugins.md
route-protection.md
server-auth.md
types.md

Details

From the project README

Nuxt Better Auth

Use the smallest reference that matches the task.

Pick a reference

TaskRead
Install the module, configure environment variables, or create config filesreferences/installation.md
Read client session state, build auth forms, call plugins, or fetch auth-bound datareferences/client-auth.md
Read or enforce sessions in server handlers, create sessions, or refresh cached session datareferences/server-auth.md
Protect pages or API routes and configure redirectsreferences/route-protection.md
Register Better Auth plugins and their client companionsreferences/plugins.md
Configure NuxtHub, generated schema, or secondary storagereferences/database.md
Connect a Nuxt frontend to an external Better Auth serverreferences/client-only.md
Use inferred auth types or add project fieldsreferences/types.md

Rules that apply across tasks

  • Confirm the consumer's installed package version supports each API you use. The published skill may be newer than the consumer's lockfile.
  • Enforce protected API reads and mutations server-side with requireUserSession(event). Route rules and page meta also control navigation.
  • Navigate only to validated local redirect paths.
  • In clientOnly mode, do not use local server helpers or expect SSR session hydration.
  • After server-side changes to session payload fields, call refreshSessionCookieCache(event). Wrap custom client auth endpoints that create or change the current session with runWithSessionRefresh().

Before finishing an implementation, run the consumer's typecheck and the narrowest relevant auth test.

Resources

Comments

Markdown supported