PrimusSaaS.Notifications.Realtime
1.0.1
dotnet add package PrimusSaaS.Notifications.Realtime --version 1.0.1
NuGet\Install-Package PrimusSaaS.Notifications.Realtime -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PrimusSaaS.Notifications.Realtime" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PrimusSaaS.Notifications.Realtime" Version="1.0.1" />
<PackageReference Include="PrimusSaaS.Notifications.Realtime" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PrimusSaaS.Notifications.Realtime --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PrimusSaaS.Notifications.Realtime, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PrimusSaaS.Notifications.Realtime@1.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PrimusSaaS.Notifications.Realtime&version=1.0.1
#tool nuget:?package=PrimusSaaS.Notifications.Realtime&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
PrimusSaaS.Notifications.Realtime
Real-time notification module for Primus SaaS Framework with SignalR support.
Features
- Real-time push notifications via SignalR
- REST API endpoints (GET/POST/PUT/DELETE)
- In-memory store (pluggable for database backends)
- User-specific notifications
- Unread count tracking
- CORS pre-configured
Installation
dotnet add package PrimusSaaS.Notifications.Realtime
Quick Start
Backend Setup (2 lines)
var builder = WebApplication.CreateBuilder(args);
// Add Primus Real-time Notifications
builder.Services.AddPrimusRealtimeNotifications();
var app = builder.Build();
// Enable CORS and map endpoints
app.UseCors("PrimusNotifications");
app.MapPrimusNotifications();
app.Run();
Frontend Integration
Connect to the SignalR hub:
import { HubConnectionBuilder } from '@microsoft/signalr';
const connection = new HubConnectionBuilder()
.withUrl('http://localhost:5000/hubs/notifications')
.build();
connection.on('NewNotification', (notification) => {
console.log('New notification:', notification);
// Update your UI
});
await connection.start();
Or use the primus-react-ui component:
import { PrimusNotificationCenter } from 'primus-react-ui';
<PrimusNotificationCenter apiUrl="http://localhost:5000" />
API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/notifications |
List all notifications |
| GET | /api/notifications/count |
Get unread count |
| POST | /api/notifications |
Create notification (broadcasts via SignalR) |
| PUT | /api/notifications/{id}/read |
Mark as read |
| DELETE | /api/notifications/{id} |
Delete notification |
Create Notification
POST /api/notifications
Content-Type: application/json
{
"title": "New Order",
"message": "Order #1234 has been placed",
"type": "success"
}
Types: info, success, warning, error
Customization
Use Custom Store
builder.Services.AddSingleton<INotificationStore, MyDatabaseStore>();
builder.Services.AddPrimusRealtimeNotifications();
Configure Options
builder.Services.AddPrimusRealtimeNotifications(options =>
{
options.MaxNotifications = 500;
options.EnableSignalR = true;
});
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- PrimusSaaS.Notifications (>= 2.3.1)
-
net8.0
- PrimusSaaS.Notifications (>= 2.3.1)
-
net9.0
- PrimusSaaS.Notifications (>= 2.3.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.