NotificationHub
Fire notifications on any event — instantly, after a delay, on a recurring schedule, or with smart cancellations if a different event happens first. One template covers email, SMS, push, and in-app, each toggleable per send.
using Kanject.NotificationHub;
// 1️⃣ Event-based — fires the moment OrderShipped is published
await hub.SendAsync(new {
Template = "order_shipped",
UserId = user.Id,
Channels = Channel.Email | Channel.Push,
Data = new { OrderId = order.Id, Eta = "Tomorrow" },
});
// 2️⃣ Time-based with cancellation — wait 24h then nudge,
// unless the user finishes signup before then.
await hub.ScheduleAsync(new {
Template = "complete_signup_reminder",
UserId = user.Id,
Wait = TimeSpan.FromHours(24),
Channels = Channel.Email,
CancelOn = "user.signup.completed",
CorrelationId = user.Id,
}); Schedule it. Wait. Cancel if needed.
Four ways to decide when a notification fires, all built into the same template you author once. Pick a mode, configure it, and the hub handles the rest — queues, retries, opt-ins, telemetry.
Event-triggered
Fire the moment an event lands on the bus. Zero latency, zero glue code.
Delayed
Wait a defined duration after the trigger event, then send. One-shot.
Delayed + Cancellable
Same delay, but cancel the send if a different event fires first. Perfect for nudges that shouldn't race the user.
Recurring
Send on an interval — daily digests, weekly summaries, anniversary reminders.
Author once. Toggle channels per send.
Your providers. Our engine.
Bring the SES, Twilio, FCM accounts you already ship with — or implement the channel interface and the engine uses your own. Templates, scheduling, smart cancellations, retries, opt-in respect and delivery telemetry stay in our hands. The wire stays in yours.
IEmailProvider, ISmsProvider, IPushProvider for anything else.
// Register the providers you ship with — or roll your own
builder.Services.AddNotificationHub(options =>
{
options.UseEmail<SendGridProvider>(cfg.SendGridApiKey);
options.UseSms <TwilioProvider> (cfg.TwilioSid, cfg.TwilioToken);
options.UsePush <FirebasePushProvider>(cfg.FirebaseSaJson);
// InApp uses the built-in inbox + Kanject UI widget by default.
// Or implement IEmailProvider yourself for anything bespoke:
// options.UseEmail<MyTransactionalRelayProvider>();
});
// The engine still owns: templates, scheduling, smart cancellations,
// retries, throttling, opt-in respect, and delivery telemetry. Send the right thing. At exactly the right moment.
Event or time-based
Fire on any EventHub event, or on a delay — one-shot or recurring. Same template, your choice.
Smart cancellations
Cancel a queued send if a different event happens first. Correlation IDs link the two events automatically.
Four channels in one
Email, SMS, Push, InApp — toggle each per template. The hub respects user opt-ins per channel.
Dispatch priority
Mark high-priority sends to jump the queue. Bulk marketing waits behind transactional alerts.
Visual template lib
Browse, search, and edit templates in the hosted admin dashboard. No redeploy to tweak copy.
Delivery telemetry
Open, click, bounce, complaint webhooks for every channel — streamed back into Insights.
Built in .NET.
Spoken in every language.
Every NotificationHub module ships as both a NuGet package and an official Docker image — runs on ECS, EKS, Fargate, App Runner, or your laptop. Call its HTTP/gRPC API from Python, Go, Node, Java, Rust, or anything else that speaks the wire.
- ✓Multi-arch images:
amd64+arm64from the same tag - ✓OpenAPI + gRPC reflection enabled out of the box
- ✓Same configuration surface — env vars, Parameter Store, file
Kanject.NotificationHub ships into your AWS, registers itself with one line in Program.cs, and exposes a typed C# API the rest of your service can use immediately.
Simplify your cloud
journey today.
Join forward-thinking developers and businesses who trust Kanject to eliminate cloud complexity and accelerate innovation.