APIAlerts 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package APIAlerts --version 1.0.0
                    
NuGet\Install-Package APIAlerts -Version 1.0.0
                    
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="APIAlerts" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="APIAlerts" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="APIAlerts" />
                    
Project file
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 APIAlerts --version 1.0.0
                    
#r "nuget: APIAlerts, 1.0.0"
                    
#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 APIAlerts@1.0.0
                    
#: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=APIAlerts&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=APIAlerts&version=1.0.0
                    
Install as a Cake Tool

API Alerts • C# / .NET / Unity / Godot Client

NuGet License: MIT

NuGetGitHubAPI Alerts

Effortless project notifications. Send once, deliver everywhere.

Targets netstandard2.0 and net10.0. Works in:

  • .NET 10 / .NET 8 (ASP.NET Core, Blazor, Azure Functions, console apps)
  • .NET Framework 4.6.1+ and Mono
  • Unity (2018+, both Mono and IL2CPP backends)
  • Godot C# projects

Installation

.NET

dotnet add package apialerts

Unity

NuGet packages don't import into Unity natively. Two options:

  1. NuGetForUnity (recommended) - install the tool, search for apialerts, click install.
  2. Direct DLL drop - download the latest .nupkg from NuGet, rename to .zip, extract the netstandard2.0/APIAlerts.dll, and drop it into Assets/Plugins/ in your Unity project.

Godot (C#)

dotnet add package apialerts

Standard .NET tooling works in Godot C# projects.

Quick Start

using APIAlerts;

ApiAlerts.Configure("your-api-key");
await ApiAlerts.SendAsync(new Event { Message = "Deploy complete" });

Usage

Global singleton

Call Configure once at startup, then use Send / SendAsync anywhere.

using APIAlerts;

ApiAlerts.Configure("your-api-key");

// Fire-and-forget. Never throws, drops errors silently unless debug is on.
ApiAlerts.Send(new Event { Message = "Deploy complete" });

// Awaitable. Never throws, check result.Success.
var result = await ApiAlerts.SendAsync(new Event { Message = "Deploy complete" });
if (result.Success)
    Console.WriteLine($"Sent to {result.Workspace} ({result.Channel})");
else
    Console.Error.WriteLine($"Error: {result.Error}");

Dependency injection

Register IApiAlertsClient and inject it:

using Microsoft.Extensions.DependencyInjection;

builder.Services.AddApiAlerts("your-api-key");
public class DeployNotifier(IApiAlertsClient alerts)
{
    public Task Notify() => alerts.SendAsync(new Event { Message = "Deploy complete" });
}

Or construct one directly, no container:

IApiAlertsClient alerts = new ApiAlertsClient("your-api-key");

AddApiAlerts routes SDK logs through the app's ILoggerFactory. Use the instance client for DI, mocking, or multiple keys; the ApiAlerts singleton stays for quick one-off use.

Enable debug logging

ApiAlerts.Configure("your-api-key", debug: true);

The SDK uses Microsoft.Extensions.Logging.ILogger. By default it logs to NullLogger.Instance (silent). Inject your application's logger to surface SDK output:

ApiAlerts.Configure(
    "your-api-key",
    debug: true,
    logger: serviceProvider.GetRequiredService<ILogger<Program>>()
);

Critical errors (missing API key, not configured) always log regardless of the debug flag.

Custom HttpClient

Inject your own HttpClient to share connection pools, plug in handlers (Polly, retry, proxy), or route through IHttpClientFactory:

ApiAlerts.Configure(
    "your-api-key",
    httpClient: httpClientFactory.CreateClient("apialerts")
);

If you don't provide one, the SDK creates an HttpClient with a 30-second timeout.

Event fields

Only Message is required. All other fields are optional and omitted from the JSON payload when null.

var evt = new Event
{
    Message  = "Deploy complete",
    Channel  = "releases",
    EventKey = "ci.deploy.success",
    Title    = "Deployed",
    Tags     = new[] { "CI/CD", "C#" },
    Link     = "https://github.com/apialerts/apialerts-csharp/actions",
    Data     = new { version = "1.0.0" },
};

await ApiAlerts.SendAsync(evt);
Field Type Required Description
Message string Yes Human-readable notification text. This is what appears on the push notification lock screen.
Channel string No Workspace channel the push notification fires on. Defaults to the workspace default channel when omitted.
EventKey string No Identifies what kind of thing happened. Optional but recommended. Use dotted notation (e.g. ci.deploy.success, payment.failed, user.signup) so routing rules can match glob patterns like ci.* or *.failed. Serialised as event over the wire.
Title string No Short headline some destinations render separately from the message body.
Tags string[] No Categorisation tags for filtering and search.
Link string No URL associated with the event. Available as a deeplink for push notifications and as a call-to-action for routed destinations.
Data object No Arbitrary key-value metadata. Available to non-push destinations for templating (Slack message bodies, email templates, webhook payloads).

Send to multiple workspaces

Pass an apiKey as the optional last argument to override the configured key for a single call.

ApiAlerts.Send(new Event { Message = "Deploy complete" }, apiKey: "other-workspace-api-key");

var result = await ApiAlerts.SendAsync(
    new Event { Message = "Deploy complete" },
    apiKey: "other-workspace-api-key"
);

API

Method Description
ApiAlerts.Configure(apiKey, debug, logger, httpClient) Initialise the singleton. First call wins; subsequent calls are no-ops.
ApiAlerts.Send(evt, apiKey) Fire-and-forget. Never throws, drops errors silently unless debug is on.
ApiAlerts.SendAsync(evt, apiKey) Awaitable, returns SendResult. Never throws.
new ApiAlertsClient(apiKey, debug, logger, httpClient) Construct an instance (implements IApiAlertsClient) for DI, mocking, or multiple keys.
services.AddApiAlerts(apiKey, debug) Register IApiAlertsClient as a singleton in a DI container.

SendResult fields

Field Type Description
Success bool true if delivered
Workspace string? Workspace name (present on success)
Channel string? Channel name (present on success)
Warnings IReadOnlyList<string> Non-fatal server warnings
Error string? Error message (present on failure)

Game dev use cases

  • Unity build pipelines: ping Slack/Discord/your phone when a Unity Cloud Build finishes
  • Godot CI: notifications when GitHub Actions builds your .pck or exports finish
  • Live ops: server-side alerts when a player triggers a webhook, crash report hooks
  • In-editor scripts: long-running asset import notifications
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 93 6/8/2026
1.0.0 111 6/7/2026
1.0.0-alpha3 162 1/22/2025
1.0.0-alpha2 147 1/22/2025
1.0.0-alpha1 131 1/22/2025