Zero dependencies, Node 18+
Install noticeapi from npm. It ships no dependencies and calls Node's built-in fetch, so nothing extra lands in your lockfile.
You want email in a Node service without hand-rolling fetch, retries, and error parsing. Install noticeapi, authenticate with a scoped ntc_ key, and call notice.emails.send() — a typed client that throws on non-2xx responses and lets you look any send back up by id. The same client runs in Express, Fastify, workers, queues, and one-off scripts.
import express from "express";
import { NoticeAPI, NoticeAPIError } from "noticeapi";
const app = express();
const notice = new NoticeAPI(process.env.NOTICEAPI_API_KEY!);
app.use(express.json());
app.post("/send-receipt", async (req, res) => {
try {
const { email, orderId } = req.body;
const result = await notice.emails.send(
{
from: "Acme Billing <[email protected]>",
to: email,
subject: `Receipt #${orderId}`,
html: "<p>Your receipt is ready.</p>",
},
{ idempotencyKey: `receipt-${orderId}` },
);
res.json({ id: result.id });
} catch (error) {
if (error instanceof NoticeAPIError) {
res.status(error.status).json({ code: error.code, message: error.message });
return;
}
throw error;
}
});Run npm install noticeapi in any Node 18+ project; it pulls in no other packages.
Mint an ntc_ key with the sending preset and read it from a server-only env var, never the client bundle.
Call new NoticeAPI(key) and notice.emails.send(); a non-2xx response throws NoticeAPIError with the HTTP status and a stable code.
Look the returned id back up for the recipient timeline, or verify signed x-noticeapi- webhooks to update your app.
Install noticeapi from npm. It ships no dependencies and calls Node's built-in fetch, so nothing extra lands in your lockfile.
The same notice client runs in Express, Fastify, background workers, queues, and CLI scripts.
Reuse the order or job id so a repeated request returns the first send. Attach files as base64 objects on paid plans.
Every send returns an id. Fetch it for the recipient timeline — delivered, bounced, or complained — from the same typed client.
The SDK mirrors the HTTP API one-to-one, so anything in the REST docs is a single typed method away. Non-2xx responses throw NoticeAPIError carrying the HTTP status and a stable, documented error code.
Node 18 and newer. The SDK relies on the built-in fetch API, which arrived in Node 18.
Yes, on a paid plan. Pass attachment objects with a filename and base64 content to notice.emails.send().
Yes. One client covers send, batch, email lookup, templates, contacts, audiences, broadcasts, and suppressions.
Simulator outcomes are free. Move to a verified domain when the path is ready.