MintPlayer.Spark.WebPush
11.0.0
dotnet add package MintPlayer.Spark.WebPush --version 11.0.0
NuGet\Install-Package MintPlayer.Spark.WebPush -Version 11.0.0
<PackageReference Include="MintPlayer.Spark.WebPush" Version="11.0.0" />
<PackageVersion Include="MintPlayer.Spark.WebPush" Version="11.0.0" />
<PackageReference Include="MintPlayer.Spark.WebPush" />
paket add MintPlayer.Spark.WebPush --version 11.0.0
#r "nuget: MintPlayer.Spark.WebPush, 11.0.0"
#:package MintPlayer.Spark.WebPush@11.0.0
#addin nuget:?package=MintPlayer.Spark.WebPush&version=11.0.0
#tool nuget:?package=MintPlayer.Spark.WebPush&version=11.0.0
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
aes128gcmcontent coding (one record, a fresh salt and ephemeral P-256 key per message), onECDiffieHellman,HKDFandAesGcm; - RFC 8292 VAPID: an ES256 JWT (
aud= the push service origin,exp12 h,sub) signed withECDsa, reused per origin until an hour before it expires; - an RFC 8030 sender (
TTL,Urgency,Topic) over anyHttpClient, 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 legacyaesgcmdraft 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);TTLis required. - The endpoint comes from a browser: send through an SSRF-safe client.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
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 |