Introducing Notifications
Notifications is our multi-channel delivery service. Send emails, SMS, push notifications, and webhooks through a single unified API.
What is Notifications?
Stop integrating with multiple providers. Notifications gives you one API to reach users on any channel.
Supported Channels
Send transactional and marketing emails with templates and tracking.
import { Notifications } from '@fourbyfour/sdk';
const notifications = new Notifications({ apiKey: 'your-key' });
await notifications.send({
channel: 'email',
to: 'user@example.com',
template: 'welcome',
data: {
name: 'John',
activationLink: 'https://...'
}
});SMS
Send text messages globally with automatic carrier routing.
Push Notifications
Reach users on iOS, Android, and web with a single API call.
Webhooks
Notify external services when events happen in your application.
Smart Routing
Notifications automatically chooses the best provider based on:
- Delivery rates
- Cost
- Geographic location
- Channel availability
Delivery Tracking
Know exactly what happened to every notification:
- Sent
- Delivered
- Opened
- Clicked
- Bounced
- Failed
const status = await notifications.getStatus(notificationId);
console.log(status.delivered); // true
console.log(status.openedAt); // timestampTemplates
Create templates once, use them across channels:
await notifications.createTemplate({
id: 'order-confirmation',
channels: ['email', 'sms', 'push'],
content: {
email: {
subject: 'Order Confirmed',
body: 'Your order {{orderId}} is confirmed.'
},
sms: 'Order {{orderId}} confirmed. Track: {{trackingUrl}}',
push: {
title: 'Order Confirmed',
body: 'Your order is on its way!'
}
}
});Getting Started
npm install @fourbyfour/sdkCheck out the documentation to get started with Notifications.