Send transactional emails from your Next.js application using Unosend. Works with App Router, API routes, and Server Actions.
Everything you need to send emails from Next.js
Full TypeScript support
Works with App Router and Pages Router
Server Actions integration
Edge runtime compatible
React Email components support
Get up and running in minutes with this code example
// app/api/send/route.ts
import { Unosend } from '@unosend/node';
import { NextResponse } from 'next/server';
const unosend = new Unosend(process.env.UNOSEND_API_KEY!);
export async function POST(request: Request) {
const { to, subject, html } = await request.json();
const { data, error } = await unosend.emails.send({
from: 'hello@yourdomain.com',
to,
subject,
html,
});
if (error) {
return NextResponse.json({ error }, { status: 400 });
}
return NextResponse.json({ data });
}Follow these steps to integrate Unosend with Next.js
Install the SDK: npm install @unosend/node
Add UNOSEND_API_KEY to your .env.local file
Create an API route or Server Action
Import Unosend and initialize with your API key
Call unosend.emails.send() to send emails
Type-safe email sending
Seamless integration with Next.js patterns
Works in serverless environments
Full support for React Email components
More framework integrations you might like
Build beautiful email templates with React components and send them with Unosend. Use JSX to create responsive HTML emails.
Send emails from Node.js with our official SDK. Support for Express, Fastify, NestJS, and any Node.js application.
Send emails from Python with our official SDK. Perfect for Django, Flask, FastAPI, and any Python application.
Start sending emails from Next.js in under 5 minutes. Free tier includes 5,000 emails/month.