DEV Community

Alex Spinov
Alex Spinov

Posted on

Novu Has a Free Notification API That Handles Email, SMS, Push, and Chat

Novu is an open-source notification infrastructure with a single API for email, SMS, push, in-app, and chat notifications. Write once, deliver anywhere.

Setup

npm install @novu/node
Enter fullscreen mode Exit fullscreen mode

Send Multi-Channel Notification

import { Novu } from '@novu/node';

const novu = new Novu('your-api-key');

await novu.trigger('welcome-flow', {
  to: {
    subscriberId: 'user-123',
    email: 'alice@example.com',
    phone: '+1234567890'
  },
  payload: {
    name: 'Alice',
    planName: 'Pro'
  }
});
// This single call sends email + SMS + push + in-app based on your workflow
Enter fullscreen mode Exit fullscreen mode

Define Workflows

// In Novu dashboard or via API
// welcome-flow:
// Step 1: In-App notification (instant)
// Step 2: Email (if not read in 1 hour)
// Step 3: SMS (if not read in 24 hours)
// Step 4: Push notification (final attempt)
Enter fullscreen mode Exit fullscreen mode

In-App Notification Center

import { NovuProvider, PopoverNotificationCenter } from '@novu/notification-center';

function App() {
  return (
    <NovuProvider subscriberId="user-123" applicationIdentifier="your-app-id">
      <PopoverNotificationCenter>
        {({ unseenCount }) => (
          <button>Notifications ({unseenCount})</button>
        )}
      </PopoverNotificationCenter>
    </NovuProvider>
  );
}
Enter fullscreen mode Exit fullscreen mode

Subscriber Management

// Create subscriber
await novu.subscribers.identify('user-123', {
  email: 'alice@example.com',
  firstName: 'Alice',
  phone: '+1234567890'
});

// Update preferences
await novu.subscribers.updatePreference('user-123', 'weekly-digest', {
  channel: { email: true, sms: false }
});
Enter fullscreen mode Exit fullscreen mode

REST API

# Trigger notification
curl -X POST https://api.novu.co/v1/events/trigger \
  -H "Authorization: ApiKey your-key" \
  -d '{"name":"welcome","to":{"subscriberId":"user-123"},"payload":{"name":"Alice"}}'
Enter fullscreen mode Exit fullscreen mode

Why This Matters

  • One API, all channels: Email, SMS, push, in-app, chat
  • Smart routing: Fallback channels if primary unread
  • Preference management: Users control their notifications
  • Open source: Self-host or use cloud

Need custom notification systems or multi-channel messaging? I build developer tools. Check out my web scraping actors on Apify or reach out at spinov001@gmail.com for custom solutions.

Top comments (0)