NotifyHub

One API. Every channel.

Stop writing different code for each notification channel.
NotifyHub gives you a single fluent Java API to send via 16 channels,
with fallback chains, templates, retry, scheduling, and more.

Maven Central CI Java 17+ MIT
Get Started View on GitHub Docker Hub

What is NotifyHub?

NotifyHub is a unified notification library for Java and Spring Boot. Instead of integrating each channel separately (Twilio SDK for SMS, JavaMail for email, webhook calls for Slack...), you use one fluent API for everything.

📦

Library

Add as a Maven/Gradle dependency. Spring Boot auto-configures everything. Just @Autowired NotifyHub and send.

🌐

REST API

Don't use Java? Run our Docker image and call HTTP endpoints from any language. Swagger UI included.

🤖

AI Ready

MCP Server with 26 tools. Let Claude, Cursor, or any AI assistant send notifications on your behalf.

16 Channels. Zero Friction.

Every channel uses the same API. Most use zero external SDKs — just the JDK HttpClient. Add only the channels you need.

Email

SMTP (Gmail, SES, Outlook, any). HTML templates, attachments, TLS.

📱

SMS

Twilio. Send text messages worldwide with delivery status.

💬

WhatsApp

Twilio. Same setup as SMS, different channel.

💬

Slack

Incoming Webhooks. Named channels, no SDK needed.

Telegram

Bot API. Send to any chat ID or named alias.

🎮

Discord

Webhooks. Custom username, avatar, named servers.

💼

Microsoft Teams

Incoming Webhooks. MessageCard format.

🗪

Google Chat

Webhooks. Send to any Google Chat space.

🔔

Firebase Push

FCM. Mobile push notifications with title and body.

🔌

WebSocket

JDK WebSocket with auto-reconnect. Real-time.

🔗

Generic Webhook

Any HTTP endpoint. PagerDuty, Datadog, custom APIs.

𝕏

Twitter / X

API v2. Post tweets with OAuth 1.0a. No SDK needed.

👥

LinkedIn

REST API. Publish posts with OAuth 2.0 Bearer token.

📝

Notion

API. Create pages in any database. Integration Token.

🎮

Twitch

Helix API. Chat messages + polls. No SDK needed.

YouTube

Data API v3. Live chat messages. No SDK needed.

Custom

Implement one interface. Your channel, your rules.

Everything You Need

NotifyHub isn't just a message sender. It's a complete notification infrastructure with retry, tracking, templates, scheduling, and more.

⚙ Fluent API

Builder pattern with chaining. .to().via().fallback().template().send() — readable and type-safe.

🔄 Fallback Chains

If WhatsApp fails, try SMS. If SMS fails, try Email. Automatic failover with no extra code.

📋 Mustache Templates

HTML for email, plain text for chat. Template versioning for A/B tests. i18n with locale fallback.

👥 Batch Send

toAll(recipients) and toAllNotifiable(users). Send to thousands with failure isolation.

⏳ Scheduling

.schedule(Duration.ofHours(24)) — send later. Cancel, check status, view remaining delay.

🔁 Retry & DLQ

Exponential or fixed backoff. Failed after all retries? Goes to Dead Letter Queue for manual reprocessing.

📈 Rate Limiting

Token bucket per channel. Configurable limits. URGENT priority bypasses the limiter.

🔍 Delivery Tracking

Every send returns a DeliveryReceipt with ID, status, timestamp. In-memory or JPA persistence.

🔒 Deduplication

Content-hash or explicit key. Same message won't be sent twice within the TTL window.

⚡ Async

sendAsync() and sendAllAsync() return CompletableFuture. Non-blocking sends.

👤 Named Recipients

Define aliases like "alerts", "devops". Send to a name, resolve to webhook URL or chat ID.

📦 Message Queues

RabbitMQ and Kafka modules. Enqueue notifications for async, distributed processing.

👁 OpenTelemetry

Auto-configured tracing via Micrometer Observation API. Export spans to Jaeger, Tempo, or any OTLP collector.

See It In Action

A few lines of code. That's all it takes.

Send an email with fallback to SMS

Java
notify.to("user@example.com")
    .via(Channel.EMAIL)
    .fallback(Channel.SMS)
    .subject("Order Confirmed")
    .template("order-confirmed")
    .param("orderId", "ORD-2024")
    .send();

Send to multiple channels at once

Java
notify.to(user)
    .via(Channel.EMAIL)
    .via(Channel.SLACK)
    .via(Channel.DISCORD)
    .subject("Security Alert")
    .content("Login from a new device detected")
    .sendAll();

Batch send to thousands

Java
notify.toAll(List.of("user1@test.com", "user2@test.com", "user3@test.com"))
    .via(Channel.EMAIL)
    .subject("System Maintenance")
    .template("maintenance-notice")
    .param("date", "2025-03-01")
    .send();

Schedule for later + track delivery

Java
DeliveryReceipt receipt = notify.to(user)
    .via(Channel.EMAIL)
    .subject("Reminder")
    .content("Don't forget your appointment!")
    .sendTracked();

receipt.getStatus();    // SENT
receipt.getId();        // uuid
receipt.getTimestamp(); // 2025-01-15T10:30:00Z

Quick Start

Add the dependency, configure your channels, and start sending.

1

Add the dependency

pom.xml
<dependency>
    <groupId>io.github.gabrielbbaldez</groupId>
    <artifactId>notify-spring-boot-starter</artifactId>
    <version>0.9.0</version>
</dependency>
<!-- Add the channels you need -->
<dependency>
    <groupId>io.github.gabrielbbaldez</groupId>
    <artifactId>notify-email</artifactId>
    <version>0.9.0</version>
</dependency>
2

Configure in application.yml

application.yml
notify:
  channels:
    email:
      host: smtp.gmail.com
      port: 587
      username: ${GMAIL_USER}
      password: ${GMAIL_PASS}
      from: noreply@myapp.com
      tls: true
    slack:
      webhook-url: ${SLACK_WEBHOOK}
    discord:
      webhook-url: ${DISCORD_WEBHOOK}
  retry:
    max-attempts: 3
    strategy: exponential
  tracking:
    enabled: true
3

Send notifications

Java
@Autowired NotifyHub notify;

notify.to("user@example.com")
    .via(Channel.EMAIL)
    .fallback(Channel.SMS)
    .subject("Welcome!")
    .template("welcome")
    .param("name", "Gabriel")
    .send();

Docker

Don't use Java? No problem. Run NotifyHub as a REST API or MCP Server with Docker. Just set environment variables for the channels you want.

REST API gabrielbbal10/notifyhub-api

Full REST API with Swagger UI on port 8080. Send notifications via HTTP from Python, Node.js, Go, cURL, or any language.

Run it
docker run -d -p 8080:8080 \
  -e NOTIFY_CHANNELS_EMAIL_USERNAME=you@gmail.com \
  -e NOTIFY_CHANNELS_EMAIL_PASSWORD=your-app-password \
  -e NOTIFY_CHANNELS_EMAIL_FROM=you@gmail.com \
  -e NOTIFY_CHANNELS_DISCORD_WEBHOOK_URL="https://discord.com/..." \
  gabrielbbal10/notifyhub-api:latest
Call the API
# Send email
curl -X POST "localhost:8080/send/email?to=user@test.com&subject=Hi&body=Hello!"

# Send Discord
curl -X POST "localhost:8080/send/discord?message=Deploy done!"

# Swagger UI
open http://localhost:8080/swagger-ui.html
MCP Server gabrielbbal10/notifyhub-mcp

Model Context Protocol server with 26 tools for AI assistants. Connect to Claude Desktop, Claude Code, or Cursor.

claude_desktop_config.json
{
  "mcpServers": {
    "notify-hub": {
      "command": "docker",
      "args": ["run", "-i", "--rm",
        "-e", "NOTIFY_CHANNELS_DISCORD_WEBHOOK_URL=...",
        "-e", "NOTIFY_CHANNELS_EMAIL_USERNAME=you@gmail.com",
        "-e", "NOTIFY_CHANNELS_EMAIL_PASSWORD=app-password",
        "-e", "NOTIFY_CHANNELS_EMAIL_FROM=you@gmail.com",
        "gabrielbbal10/notifyhub-mcp"
      ]
    }
  }
}

Environment Variables

Both Docker images use the same NOTIFY_CHANNELS_* variables. Only set the channels you need.

Email (SMTP)
  • NOTIFY_CHANNELS_EMAIL_HOST smtp.gmail.com
  • NOTIFY_CHANNELS_EMAIL_PORT 587
  • NOTIFY_CHANNELS_EMAIL_USERNAME you@gmail.com
  • NOTIFY_CHANNELS_EMAIL_PASSWORD app-password
  • NOTIFY_CHANNELS_EMAIL_FROM you@gmail.com
Discord
  • NOTIFY_CHANNELS_DISCORD_WEBHOOK_URL https://discord.com/...
  • NOTIFY_CHANNELS_DISCORD_USERNAME NotifyHub
Slack
  • NOTIFY_CHANNELS_SLACK_WEBHOOK_URL https://hooks.slack.com/...
Telegram
  • NOTIFY_CHANNELS_TELEGRAM_BOT_TOKEN 123456:ABC...
  • NOTIFY_CHANNELS_TELEGRAM_CHAT_ID 123456789
Teams
  • NOTIFY_CHANNELS_TEAMS_WEBHOOK_URL https://outlook.office.com/...
SMS (Twilio)
  • NOTIFY_CHANNELS_SMS_ACCOUNT_SID AC...
  • NOTIFY_CHANNELS_SMS_AUTH_TOKEN token
  • NOTIFY_CHANNELS_SMS_FROM_NUMBER +15551234567
Google Chat
  • NOTIFY_CHANNELS_GOOGLE_CHAT_WEBHOOK_URL https://chat.googleapis.com/...

Built for AI

NotifyHub includes an MCP Server (Model Context Protocol) that exposes 26 tools. Connect it to Claude Desktop, Claude Code, Cursor, or any MCP-compatible AI client.

26 MCP Tools

send_email send_sms send_whatsapp send_slack send_telegram send_discord send_teams send_google_chat send_push send_twitter send_linkedin send_notion send_twitch send_youtube send_notification send_multi_channel send_batch send_to_audience create_contact list_contacts create_audience list_audiences list_channels list_delivery_receipts list_dead_letters get_analytics

What you can say to your AI

"Send an email to user@test.com saying the deploy is complete"
"Create a VIP audience with tags 'premium' and 'active', then send them a promo email"
"Send an SMS to +5548999999999 with the verification code"
"Notify the team on Slack and Telegram that the build passed"
"Show me the delivery analytics — how many sent vs failed?"
"List all dead letters and show me what failed"

Message Queues

For high-throughput or distributed systems, enqueue notifications to RabbitMQ or Kafka. A consumer picks them up and sends via NotifyHub automatically.

RabbitMQ

notify-queue-rabbitmq
application.yml
notify.queue.rabbitmq:
  enabled: true
  queue-name: notifyhub-notifications
  exchange-name: notifyhub-exchange
  routing-key: notification

Apache Kafka

notify-queue-kafka
application.yml
notify.queue.kafka:
  enabled: true
  topic: notifyhub-notifications
  consumer:
    group-id: notifyhub-group

Admin Dashboard

Built-in web UI at /notify-admin with 8 pages. Dark/light theme toggle, responsive design, shared CSS architecture.

📈 Dashboard

Metric cards, recent activity feed, system status, channel overview.

📊 Analytics

Chart.js charts: volume, distribution, success rate, hourly heatmap.

🔍 Tracking

Every delivery receipt. Filter by channel, status, recipient.

🗑 Dead Letter Queue

Failed after all retries. Inspect error, remove from queue.

📡 Channels

All registered channels with health indicators and type info.

📝 Audit Log

Complete event history with type filter. Sent, failed, scheduled, cancelled.

👥 Audiences

Manage contacts and segments with tag-based filtering.

🔗 Status Webhook

HTTP callback config, recent deliveries, payload inspection.

24 Modules. Pick What You Need.

NotifyHub is modular. The core has zero Spring dependency. Add only the channels and features you use.

ModuleWhat it does
notify-coreFluent API, templates, retry, DLQ, rate limiting, tracking. Zero Spring dependency.
notify-spring-boot-starterAuto-configures everything for Spring Boot. The main entry point.
notify-emailSMTP email with Jakarta Mail. HTML, attachments, TLS/SSL.
notify-smsSMS + WhatsApp via Twilio.
notify-slackSlack via Incoming Webhooks. No SDK.
notify-telegramTelegram via Bot API. No SDK.
notify-discordDiscord via Webhooks. No SDK.
notify-teamsMicrosoft Teams via Webhooks. No SDK.
notify-google-chatGoogle Chat via Webhooks. No SDK.
notify-push-firebaseFirebase Cloud Messaging push notifications.
notify-webhookGeneric HTTP webhooks. Configurable payload templates.
notify-websocketJDK WebSocket with auto-reconnect.
notify-twitterTwitter/X via API v2 with OAuth 1.0a. No SDK.
notify-linkedinLinkedIn via REST API with OAuth 2.0. No SDK.
notify-notionNotion via API. Create pages in any database.
notify-twitchTwitch via Helix API. Chat messages + polls.
notify-youtubeYouTube via Data API v3. Live chat messages.
notify-tracker-jpaJPA-backed delivery tracking. Persist receipts to any database.
notify-adminWeb dashboard for monitoring and DLQ management.
notify-mcpMCP Server for AI assistants (26 tools).
notify-queue-rabbitmqRabbitMQ producer/consumer for async notifications.
notify-queue-kafkaApache Kafka producer/consumer for async notifications.