Skip to main content

Installation

Add @lupinum/nuxt-email to a supported Nuxt application and optionally configure syntax highlighting.

Nuxt Email installs into an existing, supported Nuxt 4 application. Its email discovery and rendering conventions require no configuration.

1. Add the Nuxt module

bash
npx nuxt module add @lupinum/nuxt-email

This installs the package and adds the scoped module name to nuxt.config.ts.

Use the scoped name
The unscoped nuxt-email package on npm is unrelated to this project. Always install and import @lupinum/nuxt-email.

For a manual installation, install the package and use the same string registration:

bash
pnpm add @lupinum/nuxt-email
nuxt.config.ts
export default defineNuxtConfig({
  modules: ['@lupinum/nuxt-email'],
})

2. Confirm the TypeScript entry point

If your app does not already have one, add the ordinary Nuxt tsconfig.json:

tsconfig.json
{
  "extends": "./.nuxt/tsconfig.json"
}

Optional code blocks

Syntax highlighting is opt-in. Configure exactly the languages your templates use and one Shiki theme:

ts
export default defineNuxtConfig({
  modules: ['@lupinum/nuxt-email'],
  nuxtEmail: {
    codeBlock: {
      languages: ['typescript'],
      theme: 'github-dark',
    },
  },
})

Without codeBlock, ECodeBlock is not registered and Shiki is not loaded during module setup or included in the production server bundle. The Shiki packages remain installation-time dependencies of @lupinum/nuxt-email; the option controls runtime/build cost, not package-manager download cost. Discovery directories, the preview route, and the render API remain fixed. See the module behavior reference for the full contract.

What the module registers

  • Server-only auto-imports for eighteen built-in E* components, plus ECodeBlock when configured.
  • A Nitro-only renderEmail(name, props) auto-import, typed from app/emails/.
  • The explicit @lupinum/nuxt-email/define-email entry point for declaring a subject inside a template.
  • A development-only preview application at /__email (never present in production output).

Next, author your first email.