From the module, plugin and layer parts of your Nuxt note. The full module-author material is in Module authoring and Nuxt Layers.
defineNuxtModule: meta, defaults, setup, hooks) that edits nuxt.options, hooks into the build and registers runtime pieces with @nuxt/kit (addPlugin, addComponent, addImports, addServerHandler, addTemplate). Options reach runtime only through runtimeConfig or templates..client/.server.pages:extend, modules:done), app hooks on nuxtApp at runtime (app:error, page:finish), Nitro hooks on nitroApp (request, error, afterResponse). A module reaches runtime hooks through a plugin it registers.server/, app.config, nuxt.config. Priority: the app, then layers/ (Z before A), then extends (first wins). Configs merge with defu."Plugin is bundled in the app, executes in browser (unless it has a .server suffix)": a plugin without a suffix runs on the server for every request and in the browser on page load, as the later part of the note says. .client limits it to the browser, .server to the server.
The module example registers app:error in the module's hooks. Module hooks are build-time Nuxt hooks; app:error belongs to the running Nuxt app, so to react to it a module registers a plugin and calls nuxtApp.hook('app:error', …) there.
nuxt.config, and override the sample rate with NUXT_PUBLIC_OBSERVABILITY_SAMPLE_RATE.AppHeader component and an app.config theme colour, extend it from an app, then override the header and the colour from the app."A module is code that runs at build time: it reads options and registers plugins, components, server routes or generated files, so it's the place for behaviour and logic. A layer is a Nuxt app that gets merged into the consumer: it never runs on its own, and the consumer can override any of its files or config. So I'd ship a theme, layouts and replaceable components as a layer, and things like observability or i18n setup as modules, often with the base layer installing the platform's modules."
"One module every app installs, with an option for the provider, Sentry or Grafana. The module registers a plugin that loads only that SDK, hooks into Vue's and Nitro's error hooks, adds release and environment, waits for consent and samples, with the keys in runtime config. Apps only call one small composable, so switching providers is a config change and a fix ships to everyone in one release."
Nothing yet. Notes filed here show up on this page and the section overview.
Config, state and memory
runtimeConfig versus app.config versus module-generated templates, where secrets belong, cross-request state pollution and useState on the server, and the memory leaks Vue does not clean up for you.
Conrad Cloudflare
Cloudflare questions for the Conrad interview, written from your Cloudflare note — Workers, isolates and the workerd runtime, Node compatibility, bindings, Zero Trust, and the storage and background products D1, R2, KV, Durable Objects, Hyperdrive, Queues and Workflows.