/nuxt-skills:nuxt-usersfrom nuxt-skills
Configures and uses the nuxt-users module for Nuxt, covering authentication, user management, roles, password reset, database setup (SQLite/MySQL/PostgreSQL), CLI commands, composables, components, and authorization.
Ships in nuxt-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Install the module and peer dependencies
npm install nuxt-users
npm install db0 better-sqlite3 bcrypt nodemailer
For MySQL or PostgreSQL, install the corresponding driver (mysql2 or pg) instead of or in addition to better-sqlite3 as required.
Register the module in nuxt.config.ts
export default defineNuxtConfig({
modules: ['nuxt-users']
})
Run migrations
From the project root (where nuxt.config.ts lives):
npx nuxt-users migrate
Create at least one user
npx nuxt-users create-user -e [email protected] -n "Admin User" -p password123 -r admin
Flags: -e email, -n name, -p password, -r role (optional).
Configure permissions
export default defineNuxtConfig({
modules: ['nuxt-users'],
nuxtUsers: {
auth: {
permissions: {
admin: ['*'],
user: ['/profile', '/api/nuxt-users/me']
}
}
}
})
Use login in a page
NUsersLoginForm component and handle @success by calling login(user) from useAuthentication().navigateTo('/')).All options live under nuxtUsers in nuxt.config.ts.
| Area | Key | Notes |
|---|---|---|
| Database | connector.name | 'sqlite' | 'mysql' | 'postgresql' |
| Database | connector.options | path (SQLite), or host, port, user, password, database (MySQL/PostgreSQL) |
| API | apiBasePath | Default '/api/nuxt-users' |
| Tables | tables.users, tables.personalAccessTokens, tables.passwordResetTokens, tables.migrations | Custom table names |
| Mailer | mailer | Nodemailer config for password reset emails |
| URLs | siteUrl | Public app URL for links in emails (e.g. 'https://example.com'). Required in production; the Host header is only trusted in development |
| URLs | passwordResetUrl, emailConfirmationUrl | Paths for redirects |
| Auth | auth.whitelist | Public routes (e.g. ['/register']); /login is always public |
| Auth | auth.tokenExpiration | Minutes (default 1440) |
| Auth | auth.rememberMeExpiration | Days (default 30) |
| Auth | auth.permissions | Role → paths (e.g. admin: ['*'], user: ['/profile']). Keys are the predefined roles. |
| Auth | auth.allowCustomRoles | Default false. When true, create/update APIs and NUsersUserForm accept roles not listed in permissions. Empty permissions (bootstrap) already accepts any role. |
| Auth | auth.google | Google OAuth: clientId, clientSecret, callbackUrl, etc. |
| Password | passwordValidation | minLength, requireUppercase, requireLowercase, requireNumbers, requireSpecialChars, preventCommonPasswords |
| Data | hardDelete | true = hard delete, false = soft delete (default) |
| Locale | locale.default, locale.texts, locale.fallbackLocale | Localization |
Runtime config is also supported: use runtimeConfig.nuxtUsers for env-based or server-only settings.
Run from the project root so nuxt.config.ts (and optionally .env) are found.
Migrations
npx nuxt-users migrate
Create user
npx nuxt-users create-user -e <email> -n "<name>" -p <password> [-r <role>]
Role should match a auth.permissions key unless auth.allowCustomRoles is true (or permissions are empty).
Legacy/table creation
npx nuxt-users create-users-table
npx nuxt-users create-personal-access-tokens-table
npx nuxt-users create-password-reset-tokens-table
npx nuxt-users create-migrations-table
Production: The CLI requires
nuxt-users(and peers) installed where Node runs — it is not bundled inside.output/. Full config needs the app root withnuxt.config; build-only or--omit=devdeploys fall back toDB_*env vars. Seedocs/user-guide/configuration.md.
user, isAuthenticated, login(user, rememberMe?), logout(), fetchUser(useSSR?), initializeUser()users, pagination, loading, error, fetchUsers(page?, limit?), updateUser, addUser, removeUser(userId)getPublicPaths(), getAccessiblePaths(), isPublicPath(path), isAccessiblePath(path, method?)validate(password), isValid, errors, strength, score, clearValidation()t(key, params?), currentLocale, fallbackLocaleNUsersLoginForm — Login form; use @success to call login(user) from useAuthentication()NUsersLogoutLink — Logout link/buttonNUsersProfileInfo — Display profileNUsersResetPasswordForm — Password reset formNUsersList — List users (admin)NUsersUserForm — Create/edit user form; role select from auth.permissions keys; set auth.allowCustomRoles: true for a custom free-text role option| Symptom | Fix |
|---|---|
| Redirected to login on protected routes | Set auth.permissions so each role has access to needed routes |
| CLI config not found / wrong tables | Run CLI from the directory containing nuxt.config; see production note above |
| Migrations table missing | Run npx nuxt-users migrate from project root |
| Database driver errors | Install correct peer: SQLite → better-sqlite3, MySQL → mysql2, PostgreSQL → pg |
../../docs/user-guide/getting-started.md, ../../docs/examples/basic-setup.md../../docs/user-guide/authorization.md../../docs/user-guide/configuration.mdKeep nuxtUsers config and permissions in sync with the app’s roles and routes; use guard clauses and early returns when implementing custom auth logic.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Nuxt, Vue, PostgreSQL, MySQL, SQLite
nuxt-users, authentication, user-management, roles, authorization
30 skills in this plugin
/arkenvAnswer questions about ArkEnv and help implement environment variable validation. Use when developers: (1) Ask about environment variable validation or typesafety, (2) Want to setup ArkEnv in a project, (3) Need to define or update schemas using ArkType or Standard Schema, (4) Are integrating with Next.js, Nuxt, Vite, Bun, or Node.js runtimes. Triggers on: 'ArkEnv', 'env validation', 'typesafe env', 'createEnv', 'env.ts', 'arkenv'./comarkComark (Components in Markdown) parser: syntax, AST, Vue/React/Svelte/Angular renderers, plugins, and LLM streaming with auto-close./eveBuild durable backend AI agents with the eve framework. Use when creating, editing, or debugging an eve project — agent instructions, skills, tools, connections, channels, sandboxes, subagents, schedules, or evals./nanimeBuild animations in a Nuxt app with nanime, the Nuxt module wrapping Anime.js v4.
Use when animating elements, text, SVG or scroll in Nuxt: useAnimate, useWaapiAnimate,
useAnimatable, useAnimeTimeline, useDraggable, useSplitText, useScrambleText,
useAnimeScroll, useAnimeLayout, <AnimeTransition>, <AnimeTransitionGroup>,
<AnimeLayoutGroup>, transition styles, component defaults, provideAnimeDefaults and
the #nanime/* aliases. Also use when an effect seems to need raw animejs, GSAP or CSS
transition classes. Most mistakes here do not throw; they animate the wrong thing.
/nitroNitro is the framework-agnostic server toolkit (powering Nuxt) for building and deploying web servers anywhere. Use when working with nitro.config, server routes/event handlers, route rules, caching, storage, tasks, websockets, or deploying to Node/Bun/Deno/Cloudflare/Vercel./nuxtNuxt full-stack Vue framework with SSR, auto-imports, and file-based routing. Use when working with Nuxt apps, server routes, useFetch, middleware, or hybrid rendering.npx claudepluginhub onmax/nuxt-skills --plugin nuxt-skillsOther plugins' skills for the same job