Rask.WebPush 0.23.1-alpha.0.80

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

Rask.WebPush

Web Push from your own server, on your own keys and your own database. The browsers that subscribed are kept in a table on the app's database, and one line reaches them:

await Push.Send(WebPushMessage.Text("Order shipped", "#1042 is on its way", "/orders/1042"));
await Push.Send(WebPushMessage.Text("Your order shipped")).To(userId);   // one person's devices

A subscription the push service says is gone (404/410) is dropped as the send finds it. Messages are signed with VAPID and encrypted with RFC 8291 aes128gcm, using in-box System.Security.Cryptography.

Included in Rask.Server and on by default — app.Configure(c => c.Push.Off()) to do without it.

Subscribe

On the server host a component keeps what the browser API hands back:

var subscription = await push.SubscribeAsync(Push.PublicKey!);   // IWebPush, the browser API
await Push.Subscribe(subscription);                             // the signed-in user's, when there is one

A WebAssembly client or a SPA posts it to the endpoints RaskApp maps: GET /_rask/push/key, POST /_rask/push/subscribe, POST /_rask/push/unsubscribe.

Keys

The key pair and the contact come from Rask:WebPush. A rask new app already has a development pair in its gitignored appsettings.Development.json; deployed, both keys come from the environment (Rask__WebPush__VapidKeys__PublicKey, …__PrivateKey). The table and the subscribe endpoints work without keys; sending names the settings it is missing.

Test

using var push = Push.Fake();

await orders.Ship(order);

push.Sent().To(order.CustomerId).WithTitle("Order shipped").Once();

By hand

builder.Services.AddRaskWebPush<AppDbContext>();   // and modelBuilder.AddRaskWebPush() in OnModelCreating
app.MapRaskPush();                                 // after MapRask

AddRaskWebPush() without a context registers the sender alone — IWebPush.Send(subscription, message) — for an app that keeps its subscriptions somewhere of its own.

Full documentation: https://rask.sh/docs/guides/webpush

Product Compatible and additional computed target framework versions.
.NET 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.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

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

Package Downloads
Rask.Server

The ASP.NET host for Rask, a full-stack .NET web framework, with every battery: database (SQLite, PostgreSQL or SQL Server, picked by Rask:Database:Provider), mediator and query cache, accounts, background jobs, transactional email, cache, file storage, outbox, operator dashboard, durable logs, Web Push, SQLite snapshots and continuous backup. Renders Rask components with live updates over a WebSocket. RaskApp.Create(args).Run<App>() is the whole Program.cs; app.Configure(c => c.Jobs.Off()) is how an app does without one. Depends on Rask, the shared core.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.23.1-alpha.0.84 0 9/25/2026
0.23.1-alpha.0.82 0 9/25/2026
0.23.1-alpha.0.81 0 9/25/2026
0.23.1-alpha.0.80 0 9/25/2026
0.23.1-alpha.0.79 0 9/25/2026
0.23.1-alpha.0.78 0 9/25/2026
0.23.1-alpha.0.76 0 9/25/2026
0.23.1-alpha.0.74 0 9/25/2026
0.23.1-alpha.0.72 0 9/25/2026
0.23.1-alpha.0.70 0 9/25/2026
0.23.1-alpha.0.69 0 9/25/2026
0.23.1-alpha.0.68 0 9/25/2026
0.23.1-alpha.0.67 0 9/25/2026
0.23.1-alpha.0.66 26 9/24/2026
0.23.1-alpha.0.65 24 9/24/2026
0.23.1-alpha.0.64 30 9/24/2026
0.23.1-alpha.0.62 31 9/24/2026
0.23.1-alpha.0.61 29 9/24/2026
0.23.1-alpha.0.50 31 9/24/2026
0.23.0 144 9/18/2026
Loading failed