Framework Integration

Next.js + Unosend

Send transactional emails from your Next.js application using Unosend. Works with App Router, API routes, and Server Actions.

Features

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

Quick Start

Get up and running in minutes with this code example

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 });
}

Setup Guide

Follow these steps to integrate Unosend with Next.js

1

Install the SDK: npm install @unosend/node

2

Add UNOSEND_API_KEY to your .env.local file

3

Create an API route or Server Action

4

Import Unosend and initialize with your API key

5

Call unosend.emails.send() to send emails

Why Use Unosend with Next.js?

Type-safe email sending

Seamless integration with Next.js patterns

Works in serverless environments

Full support for React Email components

Ready to integrate?

Start sending emails from Next.js in under 5 minutes. Free tier includes 5,000 emails/month.