NtfyCator 0.3.0

dotnet add package NtfyCator --version 0.3.0
                    
NuGet\Install-Package NtfyCator -Version 0.3.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="NtfyCator" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NtfyCator" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="NtfyCator" />
                    
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 NtfyCator --version 0.3.0
                    
#r "nuget: NtfyCator, 0.3.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.
#addin nuget:?package=NtfyCator&version=0.3.0
                    
Install NtfyCator as a Cake Addin
#tool nuget:?package=NtfyCator&version=0.3.0
                    
Install NtfyCator as a Cake Tool

NtfyCator

A minimalistic .NET library for publishing messages to ntfy.sh and self-hosted instances.

GitHub License NuGet Version NuGet Downloads GitHub last commit GitHub Actions Workflow Status

Features

✅ Simple and lightweight

✅ Async-friendly API

✅ Easy integration

Installation

You can install NtfyCator via NuGet:

dotnet add package NtfyCator --version 0.3.0

Or using the NuGet Package Manager in Visual Studio:

Install-Package NtfyCator -Version 0.3.0

Getting Started

Register NtfyCator in Program.cs

In an ASP.NET Core or .NET Generic Host application:

using NtfyCator;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddNtfyCator();

var app = builder.Build();

And now you are good to go to publish to ntfy.sh. If you need to target a self-hosted instance, you can simply configure the server URI:

builder.Services.AddNtfyCator(options =>
{
    options.Uri = "https://my.ntfy.server";
});

Inject & Use the Client

public class NotificationService
{
    private readonly INotificator _notificator;
    
    public NotificationService(INotificator notificator)
    {
        _notificator = notificator;
    }
    
    public async Task SendNotification()
    {
        var message = new NtfyMessageBuilder("my-topic")
                      .WithTitle("Test Message")
                      .WithMarkdownBody("This is _just_ a **Test**!")
                      .WithPriority(NtfyPriority.High)
                      .WithTags("tag1", "tag2")
                      .Build();
        
        await notificator.NotifyAsync(message);
    }
}

INotificator also provides an alternative fluent interface that combines message building and sending:

await notificator.NotifyTopic("my-topic")
                 .WithBody("Just another Test!")
                 .WithPriority(NtfyPriority.Low)
                 .SendAsync();

Authorization / Authentication

NtfyCator currently supports access token authorization. To enable it simply call before first usage:

notificator.WithAccessToken("tk_xxxxxxxxxxxxxxxxx");

Every subsequent notification will use the access token as Bearer Token.

As an alternative, NtfyCator also supports user/password authentication:

notificator.WithCredentials("username", "my*password");

If possible you should always prefer token authorization over providing username and password.

Emoji Support

ntfy.sh uses a wide range of custom tags that will be transformed into emojis. NtfyCator supports adding emojis as tags and provides an Emoji enum type so you don't need to use magic strings.

var message = new NtfyMessageBuilder("my-topic")
              .WithTags(Emoji.Wink, Emoji.Rocket) // 😉, 🚀
              .Build();

Configuration Options

NtfyCator allows configuring these options:

Option Type Default Value Description
Uri String https://ntfy.sh Server URI

License

MIT License - see LICENSE for more information.

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 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 was computed.  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
0.3.0 1,199 4/14/2025
0.2.0 163 4/1/2025
0.1.0 175 3/30/2025