How-to

Installation

Install nuxt-backend into a Nuxt app you already have with one command, through a coding agent in one prompt, or by hand, with or without nuxt-convex-module.

Add the package to a Nuxt app with one command, then start it once. nuxt-backend is one Nuxt module: it goes in modules, never in extends (Principles). For a new app, create it from the starter instead: the module is installed and the files are written.

Before you start

  • Nuxt 4.7.0 or later, not Nuxt 5 yet: the server code is written against nuxt/server, a 4.6 API, and Nuxt 4.6 no longer builds with Vite 8.4 (Roadmap).
  • Node 24.11 or later, the package's engines floor.
  • No Convex account: the first run can create a local deployment, and Run the dev loop says how to move to a cloud one. The Service map lists the accounts each later step asks for.

Install

Paste this prompt into Claude Code, Cursor, Codex or any agent that can run commands in your project:

Install nuxt-backend, the all-in-one SaaS backend for Nuxt on Convex, in this project:
run `npx -y [email protected] add https://nuxt-backend.dev --skill nuxt-backend -y`,
then follow .agents/skills/nuxt-backend/references/install.md.

Or open it in your agent with the prompt typed in. Nothing runs until you press send.

The agent installs the package's core skill, then follows its install guide. The guide adds the package to an existing app (or creates one from the starter), starts it on a local deployment that needs no account, and checks that the app serves /login. It asks before it logs in to Convex or touches your accounts, and it never prints or replaces AUTH_SECRET. The skill stays in the project for later tasks, and the install adds the task skills of the installed version beside it.

Start it

npm run dev
pnpm dev
yarn dev
bun run dev

The first run sets up a dev deployment when none is configured: log in to Convex when it asks, or pick Start without an account for a local one. npx nuxt-backend dev --anonymous picks the local one without asking, on every OS. It writes CONVEX_DEPLOYMENT to .env.local, gives the deployment its AUTH_SECRET, SITE_URL and BACKEND_ENVIRONMENT, then runs Convex and Nuxt in this terminal. Nothing goes in .env by hand: the backend's URL derives from the deployment's name.

Check it works

Open /login and sign in: with no email provider connected, the code prints in the terminal. npx nuxt-backend doctor checks the project and the deployment and names whatever is missing (Diagnose your setup).

Using strict pnpm

A flat node_modules (npm, Yarn, or pnpm with nodeLinker: hoisted) exposes the bundled Convex components to Convex's bundler. pnpm's default isolated layout hides them, so let them reach the project root from pnpm-workspace.yaml (pnpm 11 and later read their settings there, not from .npmrc):

pnpm-workspace.yaml
publicHoistPattern:
  - '@convex-dev/*'

Without it, the first convex dev push fails to resolve the component definitions. The Nuxt side needs nothing: the module installs nuxt-convex-module and nuxt-security from its own dependencies. Apps made from the templates carry this setting in a .pnpmfile.mjs.

pnpm 11 and later hold back a version published less than a day ago (minimumReleaseAge). An install takes an older version that fits the range, and the new one only when nothing older fits. A project that sets minimumReleaseAge itself fails the install in that case. pnpm also stops an install until each dependency build script is approved or denied (pnpm approve-builds, or pnpm approve on pnpm 12). esbuild comes in through Nuxt and works without its script, so denying it is safe. Both are pnpm's own supply-chain defaults.

pnpm 12 links the agent skills a dependency ships once you approve them, and lists nuxt-backend under "Agent skills awaiting approval" until then. init already installs those skills in .agents/skills and keeps them on the version you have installed, so a second copy would show your agent each skill twice. Under pnpm 12.11 or later, init denies that copy itself: it adds skills: false for nuxt-backend under permissions in pnpm-workspace.yaml, the entry pnpm approve '!nuxt-backend' records, creating the file when the project has none and keeping every other key and comment. A skills entry nuxt-backend has there already stays as it is, an approval included: set it to false yourself to deny the copy. pnpm 11 doesn't read permissions and warns about the key on every install, so under pnpm 11 init leaves the file alone. After a move to pnpm 12, npx nuxt-backend init --agents adds the entry, or pnpm approve '!nuxt-backend' records it.

If it fails

SymptomFix
convex dev can't resolve @convex-dev/…/convex.configHoist the components: Using strict pnpm.
npx convex dev says to add convex to your dependenciesInstall convex in the app itself (Troubleshooting).
/login shows the Nuxt welcome pageRender <NuxtPage /> in app/app.vue (Troubleshooting).
/ answers 404, and the dev log says No match found for location with path "/"The app has no page at /: run npx nuxt-backend init, which writes one unless the app extends a layer, or add app/pages/index.vue yourself (Troubleshooting).
npm run dev stops at "Preparing Convex functions"The dev script is convex dev --start "nuxt dev": run npx nuxt-backend doctor --fix (Troubleshooting).
nuxt module add wrote no backend/ folderThe install step runs only in an interactive terminal. Run npx nuxt-backend init.