- Add centered logo and title with product branding - Add links to product website and documentation - Add NuGet badge - Add Other SDKs table with cross-references - Add Support section with dev@ironservices.io email - Update repository links to git.marketally.com 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .gitignore | ||
| Class1.cs | ||
| IronNotify.Client.csproj | ||
| LICENSE | ||
| NotifyClient.cs | ||
| NotifyRealTimeClient.cs | ||
| OfflineQueue.cs | ||
| README.md | ||
| nuget_in.png | ||
README.md
IronNotify SDK for .NET
Event notifications and alerts for .NET applications
Website • Documentation • .NET Guide • Git
IronNotify helps you send event notifications and alerts to your users instantly. Built for developers who want simple, powerful notification infrastructure without the complexity.
Installation
dotnet add package IronNotify.Client
Quick Start
Simple Usage
using IronNotify.Client;
// Create client with API key
var client = new NotifyClient("your-api-key", appSlug: "my-app");
// Send an event
var result = await client.NotifyAsync(
eventType: "order.completed",
title: "New Order Received",
severity: Severity.Info,
message: "Order #12345 has been placed"
);
if (result.Success)
{
Console.WriteLine($"Event sent! ID: {result.EventId}");
}
Fluent Builder
var result = await client
.Event("payment.failed")
.WithSeverity(Severity.High)
.WithTitle("Payment Failed")
.WithMessage("Customer payment was declined")
.WithEntityId("order-12345")
.WithMetadata("amount", 99.99)
.WithMetadata("currency", "USD")
.WithAction("retry", "Retry Payment", webhookUrl: "https://api.example.com/retry")
.SendAsync();
Configuration Options
var client = new NotifyClient(new NotifyClientOptions
{
// Required
ApiKey = "your-api-key",
// Optional
DefaultAppSlug = "my-app",
DefaultSource = "backend-service",
BaseUrl = "https://ironnotify.com",
Timeout = TimeSpan.FromSeconds(30),
// Offline queue (enabled by default)
EnableOfflineQueue = true,
MaxOfflineQueueSize = 500,
OfflineQueueDirectory = null // Uses LocalApplicationData by default
});
Severity Levels
Severity.Info // Informational events
Severity.Warning // Warnings that may need attention
Severity.High // Important events requiring action
Severity.Critical // Critical events requiring immediate attention
Metadata
Add custom key-value pairs to events:
await client.NotifyAsync(new NotifyEventRequest
{
EventType = "user.signup",
Title = "New User Registration",
Severity = Severity.Info,
Metadata = new Dictionary<string, object>
{
["userId"] = "user-123",
["plan"] = "pro",
["referrer"] = "google"
}
});
Actions
Add clickable actions to notifications:
await client
.Event("server.down")
.WithSeverity(Severity.Critical)
.WithTitle("Server Unreachable")
.WithAction("restart", "Restart Server", webhookUrl: "https://api.example.com/restart")
.WithAction("acknowledge", "Acknowledge")
.SendAsync();
Offline Queue
Events are automatically queued when the network is unavailable:
var result = await client.NotifyAsync("event.type", "Title");
if (result.Queued)
{
Console.WriteLine("Event queued for retry when online");
}
// Check queue status
if (client.OfflineQueue != null)
{
Console.WriteLine($"Queued items: {client.OfflineQueue.Count}");
}
The offline queue:
- Persists events to disk
- Automatically retries when connectivity is restored
- Respects
MaxOfflineQueueSizelimit - Works across app restarts
Real-Time Notifications
For receiving real-time notifications, use NotifyRealTimeClient:
using IronNotify.Client;
var realtime = new NotifyRealTimeClient(
hubUrl: "https://ironnotify.com/hubs/events",
apiKey: "your-api-key"
);
// Subscribe to events
realtime.OnEventReceived += (sender, evt) =>
{
Console.WriteLine($"Received: {evt.Title} ({evt.Severity})");
};
// Connect
await realtime.ConnectAsync();
// Join app channel
await realtime.JoinAppAsync("my-app");
// Disconnect when done
await realtime.DisconnectAsync();
Dependency Injection
// Register in DI container
services.AddSingleton<NotifyClient>(sp =>
new NotifyClient(new NotifyClientOptions
{
ApiKey = configuration["IronNotify:ApiKey"],
DefaultAppSlug = configuration["IronNotify:AppSlug"]
}));
Common Event Types
// User events
"user.signup", "user.login", "user.password_reset"
// Order events
"order.created", "order.completed", "order.cancelled"
// Payment events
"payment.succeeded", "payment.failed", "payment.refunded"
// System events
"server.error", "deployment.completed", "backup.finished"
Documentation
For complete documentation, visit ironnotify.com/docs.
Other SDKs
| Platform | Package |
|---|---|
| JavaScript/TypeScript | @ironservices/notify |
| Python | ironnotify |
| Go | ironnotify-go |
| Java | ironnotify-java |
| Rust | ironnotify |
Support
- Documentation: ironnotify.com/docs
- Email: dev@ironservices.io
- Issues: git.marketally.com/ironservices/ironnotify-dotnet/issues
License
MIT License - see LICENSE for details.