Lumarin.Notify.Core
0.8.0-preview.78
See the version list below for details.
dotnet add package Lumarin.Notify.Core --version 0.8.0-preview.78
NuGet\Install-Package Lumarin.Notify.Core -Version 0.8.0-preview.78
<PackageReference Include="Lumarin.Notify.Core" Version="0.8.0-preview.78" />
<PackageVersion Include="Lumarin.Notify.Core" Version="0.8.0-preview.78" />
<PackageReference Include="Lumarin.Notify.Core" />
paket add Lumarin.Notify.Core --version 0.8.0-preview.78
#r "nuget: Lumarin.Notify.Core, 0.8.0-preview.78"
#:package Lumarin.Notify.Core@0.8.0-preview.78
#addin nuget:?package=Lumarin.Notify.Core&version=0.8.0-preview.78&prerelease
#tool nuget:?package=Lumarin.Notify.Core&version=0.8.0-preview.78&prerelease
Lumarin.Notify
Multi-channel notification infrastructure for .NET. Reliable delivery across in-app feeds, realtime SignalR push, email, SMS, and mobile push — from a single unified API, with durable delivery tracking, templating, retry, rate limiting, and user preference enforcement built in.
var result = await hub.SendAsync(new NotificationRequest(
ScopeType: "user",
ScopeId: "user-123",
Category: "order.shipped",
Content: new NotificationContent("Order shipped", "Your order #456 is on the way!"),
Recipients: new NotificationRecipients(
Identities: ["user-123"],
Channels: [NotificationChannel.InApp, NotificationChannel.Email]),
Options: new NotificationOptions(
IdempotencyKey: "order-456-shipped",
Priority: NotificationPriority.High)));
Choose your packages
| What you need | Packages to add |
|---|---|
| Send notifications, in-app feed, delivery tracking | Core + EntityFrameworkCore |
| HTTP endpoints for feed, preferences, devices | + AspNetCore |
Template rendering (SendFromTemplateAsync) |
+ Templates |
| Realtime WebSocket push | + Channels.SignalR |
| Email delivery | + Channels.Email |
| Push notifications (FCM / OneSignal) | + Channels.Push |
| SMS (Twilio) | + Channels.Sms |
Installation
# Always required
dotnet add package Lumarin.Notify.Core
dotnet add package Lumarin.Notify.EntityFrameworkCore
# HTTP endpoints for feed, preferences, devices, and template admin
dotnet add package Lumarin.Notify.AspNetCore
# Template engine — required only for SendFromTemplateAsync
dotnet add package Lumarin.Notify.Templates
# Add the channels you need — each requires provider credentials (see below)
dotnet add package Lumarin.Notify.Channels.SignalR
dotnet add package Lumarin.Notify.Channels.Email
dotnet add package Lumarin.Notify.Channels.Push
dotnet add package Lumarin.Notify.Channels.Sms
Provider credential requirements
| Channel package | Required credentials |
|---|---|
Channels.Email |
SMTP host/port/credentials, or SendGrid API key |
Channels.Push |
Firebase service account (FCM) or OneSignal App ID + API key |
Channels.Sms |
Twilio Account SID, Auth Token, and sender number |
Channels.SignalR |
None — runs in-process; Redis or Azure SignalR Service for multi-node |
Channel registration fails fast at startup if required credentials are missing.
Prerequisites
- .NET 8, 9, or 10 SDK
- PostgreSQL or SQL Server for production; EF Core InMemory for dev/tests
Minimal setup
// Program.cs
using Lumarin.Notify.Core.DependencyInjection;
using Lumarin.Notify.EntityFrameworkCore.Extensions;
LumarinNotifyOptions? notifyOptions = null;
builder.Services.AddLumarinNotify(options =>
{
options.UseDatabase(
builder.Configuration.GetConnectionString("LumarinNotify")!,
"postgresql"); // or "sqlserver"
options.Delivery.MaxRetries = 3;
notifyOptions = options;
});
builder.Services.AddLumarinNotifyEntityFrameworkCore(notifyOptions!);
var app = builder.Build();
await app.Services.MigrateLumarinNotifyAsync(); // applies EF migrations
app.Run();
Inject INotificationHub and send:
var result = await hub.SendAsync(new NotificationRequest(
ScopeType: "user",
ScopeId: "user-123",
Category: "order.shipped",
Content: new NotificationContent("Order shipped", "Your order #456 is on the way!"),
Recipients: new NotificationRecipients(
Identities: ["user-123"],
Channels: [NotificationChannel.InApp, NotificationChannel.Email]),
Options: new NotificationOptions(
IdempotencyKey: "order-456-shipped",
Priority: NotificationPriority.High)));
HTTP endpoints (AspNetCore adapter)
Lumarin.Notify.AspNetCore adds ready-made minimal API endpoints for the notification feed, user preferences, device registration, template admin, and delivery tracking.
// Register the host adapter (after AddLumarinNotify)
builder.Services.AddLumarinNotifyAspNetCore(options =>
{
options.ScopeType = "user";
options.Features.EnableTemplates = true; // template admin endpoints (off by default)
options.Features.EnableTracking = true; // delivery/dead-letter tracking endpoints (off by default)
});
// Optional: resolve the current user identity from HttpContext
// Default: reads ClaimTypes.NameIdentifier
builder.Services.AddSingleton<ILumarinNotifyIdentityResolver, YourIdentityResolver>();
// Map the endpoints
app.MapLumarinNotifyFeedApi();
app.MapLumarinNotifyPreferencesApi();
app.MapLumarinNotifyDevicesApi();
app.MapLumarinNotifyTemplatesApi(); // only active when Features.EnableTemplates = true
app.MapLumarinNotifyTrackingApi(); // only active when Features.EnableTracking = true
Default routes (rebaseable via app.MapGroup(...)):
| Endpoint | Route |
|---|---|
| Feed | GET /api/notify/feed |
| Unread count | GET /api/notify/feed/unread-count |
| Mark read | POST /api/notify/feed/{notificationId}/read |
| Mark all read | POST /api/notify/feed/mark-all-read |
| Delete | DELETE /api/notify/feed/{notificationId} |
| Preferences | GET/PUT /api/notify/preferences |
| Register device | POST /api/notify/devices |
| Delete device | DELETE /api/notify/devices/{deviceId} |
| Templates | GET/PUT /api/notify/templates/{templateKey} |
| Deliveries | GET /api/notify/deliveries/{notificationId} |
| Dead letters | GET /api/notify/dead-letters |
Security:
AddLumarinNotifyAspNetCoreregistersDevelopmentOnlyLumarinNotifyAuthorizationPolicyby default, which grants all callers access to template admin and tracking endpoints. Register a customILumarinNotifyAuthorizationPolicybefore deploying to production.
Template sends
var result = await hub.SendFromTemplateAsync(
scopeType: "user",
scopeId: "user-123",
templateKey: "order-shipped",
data: new { Name = "Alex", OrderId = "456" },
recipients: new NotificationRecipients(["user-123"]),
locale: "en");
Requires Lumarin.Notify.Templates. Template engine is "scriban" (default) or "liquid".
Channel registration
Each channel is registered separately. Examples:
// SignalR (realtime WebSocket push)
builder.Services.AddLumarinNotifySignalR(options =>
{
options.HubPath = "/hubs/notifications";
options.RequireAuthenticatedUser = true;
});
app.MapLumarinNotifySignalR(); // maps the hub
// Email (read from configuration; fails fast if credentials missing)
var emailOptions = builder.Configuration
.GetSection("Lumarin.Notify:Channels:Email")
.Get<EmailChannelOptions>() ?? new EmailChannelOptions();
if (emailOptions.Enabled)
builder.Services.AddEmailChannel(emailOptions);
InMemory database (dev / tests)
builder.Services.AddDbContext<LumarinNotifyDbContext>(opts =>
opts.UseInMemoryDatabase("LumarinNotify_Dev"));
builder.Services.AddScoped<INotificationRepository, NotificationRepository>();
builder.Services.AddScoped<ITemplateRepository, TemplateRepository>();
builder.Services.AddScoped<IDeliveryRepository, DeliveryRepository>();
builder.Services.AddScoped<IDeviceRepository, DeviceRepository>();
builder.Services.AddScoped<IPreferenceRepository, PreferenceRepository>();
No migrations needed. All data resets on restart.
Docker Compose
# API-only
docker compose --profile api up --build
# API + frontend
docker compose --profile frontend up --build
Copy .env.example as the starting point for runtime parameters.
Next Steps
- Getting Started guide — zero to first notification in 10 minutes
- ASP.NET Core Hosting — HTTP endpoints, identity resolution, authorization
- API Reference — full interface and DI reference
- Channel guides — per-channel setup and credential requirements
- SignalR realtime guide — WebSocket client integration
- Docker Compose guide — production container configuration
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.AspNetCore.DataProtection (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Options (>= 10.0.5)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Lumarin.Notify.Core:
| Package | Downloads |
|---|---|
|
Lumarin.Notify.Hosting.Embedded.PostgreSQL
Optional embedded-hosting convenience profile for Lumarin.Notify on PostgreSQL |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.8.0-preview.120 | 174 | 4/21/2026 |
| 0.8.0-preview.115 | 99 | 4/18/2026 |
| 0.8.0-preview.114 | 96 | 4/18/2026 |
| 0.8.0-preview.113 | 106 | 4/17/2026 |
| 0.8.0-preview.112 | 104 | 4/17/2026 |
| 0.8.0-preview.111 | 99 | 4/17/2026 |
| 0.8.0-preview.110 | 108 | 4/16/2026 |
| 0.8.0-preview.91 | 112 | 4/2/2026 |
| 0.8.0-preview.90 | 89 | 4/2/2026 |
| 0.8.0-preview.89 | 104 | 4/1/2026 |
| 0.8.0-preview.87 | 74 | 3/30/2026 |
| 0.8.0-preview.86 | 75 | 3/30/2026 |
| 0.8.0-preview.85 | 81 | 3/30/2026 |
| 0.8.0-preview.84 | 78 | 3/30/2026 |
| 0.8.0-preview.79 | 68 | 3/26/2026 |
| 0.8.0-preview.78 | 71 | 3/26/2026 |
| 0.8.0-preview.77 | 69 | 3/26/2026 |
| 0.8.0-preview.76 | 71 | 3/26/2026 |
| 0.8.0-preview.74 | 69 | 3/25/2026 |
| 0.8.0-preview.73 | 67 | 3/25/2026 |