npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nuxt-lettermint

v1.0.3

Published

Nuxt module for sending emails with Lettermint

Readme

Nuxt Lettermint

Nuxt Lettermint Module

npm version npm downloads License Nuxt Join our Discord server

A Nuxt module for sending emails using the Lettermint email service. This module provides a seamless integration with Lettermint's Node.js SDK for both server-side and client-side email sending capabilities.

Lettermint is a European transactional email service provider focused on simplicity, reliability, and developer experience. Visit Lettermint.co for more information about our email platform.

Features

  • 🚀 Full TypeScript support
  • 🔒 Secure API key management
  • 📧 Simple composable for client-side usage
  • 🛠️ Direct server-side SDK access
  • ⚙️ Flexible configuration via environment variables or nuxt.config.ts
  • 🎯 Compatible with Nuxt 3 and Nuxt 4

Quick Setup

1. Install the module

Using the Nuxt CLI (recommended):

npx nuxi module add lettermint

Or install manually:

# npm
npm install nuxt-lettermint

# pnpm
pnpm add nuxt-lettermint

# yarn
yarn add nuxt-lettermint

2. Add to your Nuxt config

// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-lettermint']
})

3. Configure your API key

First, get your API key from Lettermint:

  1. Go to https://dash.lettermint.co/projects
  2. Select your project
  3. Find your API token

Then set your API key in one of two ways:

Option A: Create a .env file in your project root (recommended):

NUXT_LETTERMINT_API_KEY=your-lettermint-api-key

Option B: Add it directly to your nuxt.config.ts:

export default defineNuxtConfig({
  modules: ['nuxt-lettermint'],
  lettermint: {
    apiKey: 'your-api-key'
  }
})

Configuration

The module accepts the following configuration options:

export default defineNuxtConfig({
  modules: ['nuxt-lettermint'],
  lettermint: {
    // Your Lettermint API key (see step 3 above for configuration options)
    apiKey: 'your-api-key',
    
    // Enable/disable the auto-generated /api/lettermint/send endpoint (default: true)
    // Set to false if you want to create your own custom endpoints
    autoEndpoint: true
  }
})

Disabling the Auto-Generated Endpoint

By default, the module creates an endpoint at /api/lettermint/send for sending emails. If you prefer to create your own custom endpoints, you can disable this behavior:

// nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxt-lettermint'],
  lettermint: {
    autoEndpoint: false
  }
})

Note: When you disable the auto-generated endpoint:

  • You can still send emails directly from your server code using the sendEmail function
  • The client-side useLettermint() composable will not work unless you create a custom endpoint at /api/lettermint/send
  • Only create a custom endpoint if you need specific routing, additional logic, or client-side email sending:
// server/api/custom-send.post.ts (optional)
import { sendEmail } from '#imports'

export default defineEventHandler(async (event) => {
  const body = await readBody(event)
  // Add your custom logic here
  return await sendEmail(body)
})

Usage

Client-Side

<script setup>
const { send, sending, error } = useLettermint()

await send({
  from: '[email protected]',
  to: '[email protected]',
  subject: 'Hello!',
  html: '<h1>Hello World</h1>'
})
</script>

Server-Side

// server/api/send.post.ts
import { sendEmail } from '#imports'

export default defineEventHandler(async () => {
  return await sendEmail({
    from: '[email protected]',
    to: '[email protected]',
    subject: 'Welcome',
    html: '<h1>Welcome!</h1>',
    tags: ['welcome']
  })
})

Advanced Usage

import { useLettermint } from '#imports'

const lettermint = useLettermint()
await lettermint.email
  .from('[email protected]')
  .to('[email protected]')
  .subject('Hello')
  .html('<h1>Hello</h1>')
  .tag('campaign')
  .send()

Links

License

MIT License © 2025 Lettermint