Preview: the PushFleet API isn't live yet. Join the waitlist
Rust
The Rust SDK calls the API from your server with your secret key. Async on Tokio. PushFleet::from_env() reads PUSHFLEET_SECRET_KEY.
Install
Section titled “Install”cargo add pushfleetlet fleet = PushFleet::from_env()?;
fleet
.send()
.to("user_8f3k")
.title("Your order shipped")
.body("Arriving Thursday")
.await?;Send with a template
Section titled “Send with a template”fleet
.send()
.to("user_8f3k")
.template("order_shipped")
.vars(json!({ "eta": "Thu" }))
.await?;Sign user tokens
Section titled “Sign user tokens”In live mode your app registers devices with a user token your server signs. The SDK signs it locally, without a request. See identity verification.
let user_token = fleet.users().token("user_8f3k")?;Errors and retries
Section titled “Errors and retries”Failed requests return a pushfleet::Error with the API’s code, status and doc link. The SDK retries 429 and 5xx responses with backoff, and sends an idempotency key with every retry so nothing goes out twice.
Every endpoint in the API reference has a Rust sample.