Skip to content

nhedger/nuxt-resend

Folders and files

NameName
Last commit message
Last commit date
Nov 21, 2023
Nov 14, 2023
Nov 14, 2023
Nov 14, 2023
Nov 14, 2023
Nov 14, 2023
Nov 14, 2023
Nov 17, 2023
Dec 2, 2024
Nov 14, 2023
Nov 14, 2023
Nov 14, 2023
Nov 14, 2023

Repository files navigation

Nuxt Resend

Nuxt Resend

npm version npm downloads License Nuxt

Resend integration for Nuxt.

Quick Setup

  1. Add nuxt-resend dependency to your project
npx nuxi@latest module add resend
  1. Add nuxt-resend to the modules section of nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    'nuxt-resend'
  ]
})

Add the following configuration to your .env file replacing the value in < > with your Resend API key.

NUXT_RESEND_API_KEY="<your_resend_api_key>"

That's it! You can now use Nuxt Resend in your Server routes:

export default defineEventHandler(async () => {
	const { emails } = useResend();

	const result = await emails.send({
		from: "My Company <[email protected]>",
		to: ["[email protected]"],
		subject: "Hello from Nuxt Resend",
		text: "Hello world!",
	});

	return { email: 'sent' }
});

Development

# Install dependencies
pnpm install

# Generate type stubs
pnpm run dev:prepare

# Develop with the playground
pnpm run dev

# Build the playground
pnpm run dev:build

# Run checks
pnpm run check

# Run Vitest
pnpm run test
pnpm run test:watch

# Release new version
pnpm run release