MintPlayer.Spark.WebPush 11.0.0-preview.105

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

MintPlayer.Spark.WebPush

Web Push for .NET on built-in crypto only (docs/seo_analyzer_PRD.md D38):

  • RFC 8291 message encryption with the RFC 8188 aes128gcm content coding (one record, a fresh salt and ephemeral P-256 key per message), on ECDiffieHellman, HKDF and AesGcm;
  • RFC 8292 VAPID: an ES256 JWT (aud = the push service origin, exp 12 h, sub) signed with ECDsa, reused per origin until an hour before it expires;
  • an RFC 8030 sender (TTL, Urgency, Topic) over any HttpClient, which maps every answer to what to do next.

No package dependencies. Verified byte for byte against the RFC 8291 Appendix A test vectors (tests/MintPlayer.Spark.Tests/WebPush/). In a Spark app use it through MintPlayer.Spark.Notifications (spark.AddNotifications()), which stores subscriptions, sends through the SSRF-safe client and deletes expired subscriptions. Guide: docs/guide-notifications.md.

Use

// once: make the key pair and keep the private key in a secret store
var keys = VapidDetails.Generate("mailto:ops@example.com");

using var vapid = new VapidAuthorization(keys);            // validates the pair and the subject
var client = new WebPushClient(httpClient, vapid);          // hand it an SSRF-safe HttpClient

var result = await client.SendAsync(
    new WebPushSubscription(endpoint, p256dh, auth),         // PushSubscription.toJSON() from the browser
    new WebPushMessage
    {
        Payload = Encoding.UTF8.GetBytes(json),             // at most 3 993 bytes (4 096 encrypted)
        TimeToLive = TimeSpan.FromDays(1),
        Urgency = WebPushUrgency.High,
        Topic = "run-42",
    });
result.Outcome Status Do
Delivered 2xx nothing
SubscriptionGone 404, 410 delete the subscription
RetryLater 429, 5xx retry after result.RetryAfter (when sent)
Rejected anything else (400/403 = VAPID or configuration, 413 = too large) log result.Reason; retrying will not help

Only transport failures throw. A malformed subscription (not https, bad keys), a payload over the limit, a negative TTL or a topic outside [A-Za-z0-9_-]{1,32} are ArgumentExceptions before anything is sent.

Platform notes

  • Every current browser (Chrome, Edge, Firefox, Safari) accepts aes128gcm. The legacy aesgcm draft is not implemented.
  • Apple: iOS/iPadOS 16.4+ only for a web app added to the Home Screen; subscribe() from a user gesture; every push must show a notification (no silent pushes); TTL is required.
  • The endpoint comes from a browser: send through an SSRF-safe client.
Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net11.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on MintPlayer.Spark.WebPush:

Package Downloads
MintPlayer.Spark.Notifications

Notifications for MintPlayer.Spark: one ISparkNotifier call reaches a user in-app (live over /spark/live), by email (MailManager) and by Web Push (RFC 8291/8292, hand-rolled), with each user's channels chosen per organization.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.0 95 11/16/2026
11.0.0-preview.107 56 11/12/2026
11.0.0-preview.106 70 10/24/2026
11.0.0-preview.105 65 10/24/2026
11.0.0-preview.104 74 10/11/2026