Framework Integration

Express.js + Unosend

Send transactional emails from your Express.js API using Unosend. Simple REST API integration with middleware support for authentication and rate limiting.

Features

Everything you need to send emails from Express.js

Simple REST API integration

Express middleware compatible

TypeScript and JavaScript support

Error handling middleware

Rate limiting built-in

Quick Start

Get up and running in minutes with this code example

Code Example
// routes/email.js
const express = require('express');
const router = express.Router();

const UNOSEND_API_KEY = process.env.UNOSEND_API_KEY;

router.post('/send', async (req, res) => {
  try {
    const response = await fetch('https://api.unosend.co/v1/emails', {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${UNOSEND_API_KEY}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        from: 'hello@yourdomain.com',
        to: req.body.to,
        subject: req.body.subject,
        html: req.body.html,
      }),
    });

    const data = await response.json();
    res.json({ success: true, data });
  } catch (error) {
    res.status(500).json({ error: error.message });
  }
});

module.exports = router;

Setup Guide

Follow these steps to integrate Unosend with Express.js

1

Install node-fetch if on older Node.js: npm install node-fetch

2

Add UNOSEND_API_KEY to your .env file

3

Create an email route or utility module

4

Use fetch or axios to call the Unosend API

5

Add error handling and rate limiting middleware

Why Use Unosend with Express.js?

No SDK needed — just REST API calls

Works with any Node.js version

Easy to add to existing Express apps

Full control over email sending logic

Ready to integrate?

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