@nutifar/node
v1.0.2
Published
Official Nutifar Node SDK
Downloads
573
Maintainers
Readme
🌐 Nutifar Node SDK
Send transactional and broadcast notifications — Email, Push, SMS, and In-App — from your Node.js backend with a single, consistent API.
Overview
The Nutifar Node SDK is the server-side interface to the Nutifar notification platform. It's built for backends — Express, Nest, Fastify, serverless functions, workers — that need to trigger notifications, not receive them.
It's a thin, typed wrapper around the Nutifar API for sending across all four channels: Email, Push, SMS, and In-App.
Building a frontend or mobile app that needs to receive push notifications or listen for in-app events? Use
@nutifar/web,@nutifar/expoor@nutifar/react-nativeinstead. This package is send-only.
Features
- 📤 Send Email, Push, SMS, and In-App notifications from one client
- 🧩 Single or bulk/batch sends
- 📄 Template-based sends with variable substitution
- 🔑 Multi-tenant API key support
- 📦 TypeScript-first, fully typed requests and responses
- 🔒 Server-only — no browser or device APIs involved
- ⚡ Lightweight — depends only on
@nutifar/core - 🚀 Production-ready
Requirements
- Node.js 18+
- A Nutifar account and server-side API key
Installation
npm
npm install @nutifar/nodepnpm
pnpm add @nutifar/nodeyarn
yarn add @nutifar/nodeQuick Start
import { Nutifar } from "@nutifar/node";
const sdk = Nutifar({
apiKey: process.env.NUTIFAR_API_KEY!,
});Send an email
await sdk.notification.sendEmail({
to: "[email protected]",
subject: "Welcome to Teepas",
html: "<p>Hey Yusuf, glad to have you on board.</p>",
});Send an SMS
await sdk.notification.sendSMS({
to: "+2348012345678",
body: "Your OTP is 123456. Expires in 5 minutes.",
});Send a push notification
await sdk.notification.sendPush({
to: "user_123", // nutifarToken or externalId
title: "Your order shipped",
body: "Track your package in the app.",
});Send an in-app notification
await sdk.notification.sendInApp({
to: "user_123",
title: "New comment",
body: "Someone replied to your post.",
});Templates
Every channel accepts an optional template in place of (or alongside) raw content:
await sdk.notification.sendEmail({
to: "[email protected]",
subject: "Payment received",
template: {
name: "payment-received",
data: { amount: "₦25,000" },
},
});Multiple Recipients
sms, push, and inapp accept a single recipient or an array; email accepts a string, an { email, name } object, or an array of either — with optional cc, bcc, and from too:
await sdk.notification.sendEmail({
to: [{ email: "[email protected]", name: "A" }, "[email protected]"],
cc: "[email protected]",
subject: "Weekly digest",
html: "<p>...</p>",
});
await sdk.notification.sendSMS({
to: ["+2348012345678", "+2348098765432"],
body: "Reminder: rent due tomorrow.",
});Attachments
await sdk.notification.sendEmail({
to: "[email protected]",
subject: "Your invoice",
html: "<p>Attached.</p>",
attachments: [
{ filename: "invoice.pdf", url: "https://cdn.example.com/invoice.pdf" },
],
});Configuration
const sdk = Nutifar({
apiKey: process.env.NUTIFAR_API_KEY!,
});Response Shape
Every sendEmail / sendSMS / sendPush / sendInApp call resolves to the same response shape — the notification is accepted and queued, not delivered synchronously:
type NotificationResponse = {
success: boolean;
message?: string;
data: {
success: boolean;
eventId: string;
};
};Use eventId to correlate with delivery status once webhooks/analytics land (see Roadmap).
TypeScript
The SDK is written entirely in TypeScript with complete type definitions for every channel's input and response — no additional @types package needed.
import type {
SendEmailInput,
SendSMSInput,
SendPushInput,
SendInAppInput,
NotificationResponse,
} from "@nutifar/node";Roadmap
Available
- ✅ Email sending (with templates, attachments, cc/bcc, multi-recipient)
- ✅ SMS sending (single or bulk)
- ✅ Push sending
- ✅ In-app sending
Coming Soon
- Delivery status webhooks helper
- Notification analytics
- Batch/bulk send endpoint
- Scheduled sends
Contributing
Contributions are welcome!
- Fork the repository.
- Create a feature branch.
- Commit your changes.
- Open a Pull Request.
License
Released under the MIT License.
Made with ❤️ by BigYusuf.
