All tutorials
Nuxt v4.xIntermediateReleased July 21, 2026• ~36 min

Building a Nuxt Module: Going Further

Based on the official Nuxt release notes

Picking up from The Basics, where nuxt-presence got a component, a composable and a client plugin — a wall that works until you refresh.

Three steps to make it a module you'd let someone else install. Server routes that don't exist unless they're asked for. Options that are typed, deep-merged, and split by who's allowed to read them. Tests at the cheapest tier that can actually prove each thing.

This series continues the same package. If you haven't done The Basics, start there — every step here builds on that code.

What we cover here#

  1. Server Persistence & TTLaddServerHandler, Nitro routes, and a store that forgets.
  2. A Real Options SurfaceModuleOptions, deep-merged defaults, declaration merging, and the public/private runtime config decision.
  3. Testing the Module@nuxt/test-utils, and a rule for which tier a behaviour belongs in.

Three of the four bugs this module actually shipped and had to fix live in these steps. They're boxed as warnings where you'd otherwise write the broken version yourself.

Where it goes next#

How this series works#

Each step follows the same path: What it is → Why you'd care → Before → After → Do it yourself → Gotchas → Recap.