Ntfy client library to send notifications from Rust.
toml
ntfy = "0.2"
tokio = { version = "1", features = ["full"] }
```rust,no_run use ntfy::{Dispatcher, Payload, Priority, Auth};
async fn main() { let auth = Auth::new("username", "password"); let dispatcher = Dispatcher::new( "https://ntfy.sh", Some(auth), Some("socks5h://127.0.0.1:9050"), ) .unwrap();
let payload = Payload::new("mytopic", "Hello, World!")
.title("Alert") // Add optional title
.priority(Priority::High); // Edit priority
dispatcher.send(&payload).await.unwrap();
} ```
More examples can be found in the examples directory.
The following crate feature flags are available:
| Feature | Default | Description |
| ------------------- | :-----: | -------------------------------------------------------------------------------------------------------------------------- |
| blocking
| No | Needed if you want to use this library in not async/await context |
```
This project is distributed under the MIT software license - see the LICENSE file for details