This crate provides the tools necessary for your application to send Web Push messages in accordance with RFC 8030.
In addition to sending Push messages, this crate also handles:
- the generation of valid Voluntary Application Server Identification (VAPID) tokens, as required, in accordance with RFC 8293 for any messages you send; and,
- the proper encryption of message content you send, using AES128GCM, in accordance with RFC 8291.
The full documentation with examples is available on: https://docs.rs/pushicino.
Quick Example
Creating a Push Server is as simple as:
use ;
let service = new;
Then, send the Push Service's public key to the frontend and collect push subscriptions from your user's browsers. Use the Push Service to send arbitrary data directly to subscriptions using Web Push. For example, you could collect a subscription and send a message using Axum, like so:
use Arc;
use StatusCode;
use State;
use Json;
use Serialize;
use ;
async
// Don't forget to register the `subscribe` handler with your Axum router!
A more comprehensive explanation and example can be found in the documentation.
Contributions
If you find this crate useful, we'd appreciate hearing feedback from you on how it can be improved. Additionally, feel free to open pull requests or issues on GitHub.
AI disclosure: All code and documentation in this crate have been meticulously hand-crafted without using generative AI agents.