BlazorChat.Server
1.0.2
dotnet add package BlazorChat.Server --version 1.0.2
NuGet\Install-Package BlazorChat.Server -Version 1.0.2
<PackageReference Include="BlazorChat.Server" Version="1.0.2" />
<PackageVersion Include="BlazorChat.Server" Version="1.0.2" />
<PackageReference Include="BlazorChat.Server" />
paket add BlazorChat.Server --version 1.0.2
#r "nuget: BlazorChat.Server, 1.0.2"
#:package BlazorChat.Server@1.0.2
#addin nuget:?package=BlazorChat.Server&version=1.0.2
#tool nuget:?package=BlazorChat.Server&version=1.0.2
BlazorChat.Server
Commercial persistence and server components for BlazorChat.
β¨ 30-Day Free Trial β Start building immediately, purchase when ready.
BlazorChat community edition (GPLv3) provides in-memory chat only. This package adds production-ready server features with persistent storage abstractions.
Installation
dotnet add package BlazorChat.Server
Getting Started
No license key needed for trial! Simply install and start building. Purchase a license at loneworx.com/blazor-chat/pricing when you're ready to deploy to production.
Quick Start
1. Register Services
Add BlazorChat.Server to your Program.cs:
using BlazorChat.Server.Extensions;
var builder = WebApplication.CreateBuilder(args);
// Add Blazor components
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
// Add BlazorChat server services
builder.Services.AddBlazorChatServer(builder.Configuration);
var app = builder.Build();
app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseAntiforgery();
app.MapRazorComponents<App>() .AddInteractiveServerRenderMode();
// Map the BlazorChat SignalR hub app.MapBlazorChatHub();
app.Run();
2. Configure License Key (After Trial)
Add your license key to appsettings.json:
{
"BlazorChat": {
"LicenseKey": "YOUR_LICENSE_KEY_HERE"
}
}
Or use environment variable:
BLAZORCHAT_LICENSE_KEY=your-license-key-here
Purchase license keys at loneworx.com/blazor-chat/pricing
Licensing & Network Requirements
BlazorChat uses a hybrid licensing system designed for maximum flexibility:
π Development (Localhost)
- β Always free - no license key or network access required
- Automatically detected for
localhost,127.0.0.1, and::1
π Purchased License Keys
- β Works completely offline - JWT validated locally
- β No API calls - cryptographic validation only
- β No firewall requirements - zero network dependencies
- Domain restrictions enforced via JWT claims
π Trial Mode (No License Key)
When deployed without a license key:
| Scenario | Behavior | Network Required? |
|---|---|---|
| First deployment | Contacts License API to register 30-day trial | β Yes (one-time) |
| Subsequent restarts | Loads trial from local disk cache | β No |
| API unreachable | 7-day offline grace period (if previously cached) | β No |
| After 30 days | Must purchase license key | N/A |
Trial registration requires one-time access to:
| Host | Port | Purpose |
|---|---|---|
api.loneworx.com |
443 |
Trial registration (first deployment only) |
Corporate firewall users: If deploying in trial mode, ensure
api.loneworx.com:443is accessible for initial trial registration. After registration, the trial JWT is cached locally and no further network access is needed.
Trial Cache Location
Trial licenses are cached at:
- Windows:
%LocalAppData%\.blazorchat\{domain}.json - Linux/macOS:
~/.local/share/.blazorchat/{domain}.json
Persistent Storage
Default Behavior:
BlazorChat.Server includes an in-memory storage implementation. Data is lost on server restart.
SQL Server (Recommended for Production)
1. Install the SQL Server persistence provider:
dotnet add package BlazorChat.Server.SqlServer
2. Configure in Program.cs:
using BlazorChat.Server.SqlServer.Extensions;
// Replace AddBlazorChatServer with AddBlazorChatSqlServer
builder.Services.AddBlazorChatSqlServer(builder.Configuration);
3. Add connection string to appsettings.json:
{
"ConnectionStrings": {
"BlazorChatDb": "Server=.;Database=BlazorChat;Trusted_Connection=true;"
}
}
This replaces the in-memory repository with SQL Server persistence.
Custom Storage Providers
Implement IChatRepository and IChatPresenceStore for your own database:
using BlazorChat.Server.Storage;
public class MyCustomRepository : IChatRepository
{
// Implement message persistence methods
public Task<Message> CreateMessageAsync(Message message) { /* ... */ }
public Task<IEnumerable<Message>> GetMessagesAsync(string roomId) { / ... */ }
// ... other methods
}
public class MyCustomPresenceStore : IChatPresenceStore
{
// Implement user presence tracking methods
public Task SetUserOnlineAsync(string userId, string connectionId) { /* ... / }
public Task SetUserOfflineAsync(string connectionId) { / ... */ }
// ... other methods
}
Register your implementations:
builder.Services.AddBlazorChatServer<MyCustomRepository, MyCustomPresenceStore>( builder.Configuration);
Features
- β Real-time SignalR chat hub - Instant message delivery
- β User presence tracking - Online/offline/typing status
- β Message persistence abstractions - Pluggable storage providers
- β Room/channel management - Multi-room support
- β Typing indicators - Real-time typing notifications
- β Read receipts - Message delivery confirmation
- β File upload support - Share files in chat
- β Emoji support - Rich emoji picker integration
- β Extensible storage - In-memory, SQL Server, or custom
- β Offline-first licensing - Purchased keys work without internet
- β Developer-friendly - Localhost always free
Configuration Options
Full configuration in appsettings.json:
{
"BlazorChat": {
"LicenseKey": "your-license-key-here",
"LicenseApiUrl": "https://api.loneworx.com",
"PurchaseUrl": "https://loneworx.com/blazor-chat/pricing",
"Product": "BlazorChatServer", "Version": "1.0.0"
}
}
| Option | Description | Default |
|---|---|---|
LicenseKey |
Your purchased license key (JWT) | null (triggers trial) |
LicenseApiUrl |
License API endpoint for trial registration | https://api.loneworx.com |
PurchaseUrl |
Purchase page URL | https://loneworx.com/blazor-chat/pricing |
Product |
Product identifier for license validation | BlazorChatServer |
Version |
Product version | Package version |
License Tiers
BlazorChat offers multiple licensing tiers:
- Trial - 30 days, all features, automatic registration
- SingleTenant - Production license for single-domain deployments
- MultiTenant - Production license for multi-domain/SaaS deployments
See pricing page for details and feature comparison.
Troubleshooting
Trial registration fails on first deployment
Symptoms:
- Server logs:
"BlazorChat: License API unreachable" - Server logs:
"BlazorChat: Trial request denied"
Solutions:
- Verify
api.loneworx.com:443is accessible from your server - Check firewall/proxy settings allow outbound HTTPS
- Review server logs for detailed error messages
- For air-gapped/offline deployments, purchase a license key (works offline)
Server shows "Operating in offline grace period"
Meaning: Trial was cached successfully, but License API is unreachable on this startup. You have 7 days of grace period before license validation fails.
Solutions:
- Restore network access to
api.loneworx.com(preferred) - Purchase a license key to eliminate API dependency
- Monitor remaining grace period in logs
Grace period countdown:
BlazorChat: Operating in offline grace period (6 days, 23 hours remaining).
"No valid license" warning after 30 days
Meaning: Your trial period has ended.
Solution: Purchase a production license at loneworx.com/blazor-chat/pricing
License key shows as "malformed or unreadable"
Causes:
- Incorrect copy/paste (extra spaces, line breaks)
- Using an expired license key
- Using a license key from a different product
Solutions:
- Copy license key exactly as provided (no extra whitespace)
- Verify license key hasn't expired
- Contact support if issue persists: support@loneworx.com
"License is not valid for domain" warning
Meaning: Your license key is restricted to specific domains, and the current domain doesn't match.
Solutions:
- Check JWT claims to see allowed domains
- Verify you're using the correct license key for this deployment
- Contact support to update domain restrictions
Data not persisting between restarts
Issue: Using default in-memory storage.
Solution: Install BlazorChat.Server.SqlServer package or implement custom storage providers.
SignalR hub connection fails
Common causes:
- Missing
app.MapBlazorChatHub();in Program.cs - SignalR not configured in client
- CORS issues (if client on different origin)
Solutions:
// Server: Ensure hub is mapped
app.MapBlazorChatHub();
// Client: Configure SignalR connection
var hubConnection = new HubConnectionBuilder()
.WithUrl(navigationManager.ToAbsoluteUri("/chathub"))
.Build();
API Reference
Extension Methods
AddBlazorChatServer(IConfiguration, Action<BlazorChatOptions>?)
Registers BlazorChat services with in-memory storage.
AddBlazorChatServer<TRepository, TPresenceStore>(IConfiguration, Action<BlazorChatOptions>?)
Registers BlazorChat services with custom storage implementations.
AddBlazorChatSqlServer(IConfiguration)
Registers BlazorChat services with SQL Server persistence.
MapBlazorChatHub()
Maps the BlazorChat SignalR hub to /chathub endpoint.
Interfaces
IChatRepository
Contract for message persistence operations.
Key Methods:
Task<Message> CreateMessageAsync(Message message)Task<IEnumerable<Message>> GetMessagesAsync(string roomId)Task<Message?> GetMessageByIdAsync(Guid messageId)Task DeleteMessageAsync(Guid messageId)
IChatPresenceStore
Contract for user presence tracking.
Key Methods:
Task SetUserOnlineAsync(string userId, string connectionId)Task SetUserOfflineAsync(string connectionId)Task<IEnumerable<string>> GetOnlineUsersAsync(string roomId)Task UpdateTypingStatusAsync(string userId, string roomId, bool isTyping)
ILicenseInfo
Provides license status and trial information.
Properties:
bool IsTrial- Is running on trial/grace periodint? DaysRemaining- Days left in trialstring PurchaseUrl- License purchase URL
Support & Resources
Documentation
π Full Documentation
π§ API Reference
π‘ Custom Storage Guide
π― Migration Guide
Commercial Support
π§ Email: support@loneworx.com
π Website: loneworx.com
π° Pricing: loneworx.com/blazor-chat/pricing
π― Live Demo: loneworx.com/blazor-chat-demo
For technical support or sales inquiries, contact us at support@loneworx.com
Enterprise Support Available:
- Priority response times
- Dedicated Slack/Teams channel
- Architecture consulting
- Custom feature development
Related Packages
- BlazorChat (Community Edition) - GPLv3 in-memory chat components
- BlazorChat.Server (This package) - Commercial server with persistence
- BlazorChat.Server.SqlServer - SQL Server persistence provider
- BlazorChat.Shared - Shared models and contracts
License
Proprietary commercial software. 30-day free trial included.
About LoneWorx
LoneWorx LLC - Crafting exceptional software solutions.
π www.loneworx.com
π§ info@loneworx.com
π United States
Copyright Β© 2024-2026 LoneWorx LLC. All rights reserved.
BlazorChatβ’ is a trademark of LoneWorx LLC.
| 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
- BlazorChat.Shared (>= 1.0.3)
- Microsoft.IdentityModel.Tokens (>= 8.16.0)
- Newtonsoft.Json (>= 13.0.3)
- Stripe.net (>= 50.3.0)
- System.IdentityModel.Tokens.Jwt (>= 8.16.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on BlazorChat.Server:
| Package | Downloads |
|---|---|
|
BlazorChat.Server.SqlServer
SQL Server persistence provider for BlazorChat.Server. Production-ready database storage implementation. Auto-installs BlazorChat.Server dependency. Requires SQL Server 2016+ or Azure SQL Database. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.2 | 39 | 3/9/2026 |
v1.0.2:
- Fixed: Emoji reactions replacing each other when multiple different emojis added to the same message