Webhooks for Rust, built in Rust
Add the svix crate and send an event with one async call. Svix itself is built in Rust, and it handles retries, signing, delivery logs, and a portal for your customers.
use serde_json::json;
use svix::{api::Svix, models::MessageIn};
let svix = Svix::new("AUTH_TOKEN".into(), None);
let event = MessageIn::new(
"invoice.paid".into(),
json!({
"id": "inv_1042",
"status": "paid",
}),
);
svix.message()
.create("customer_123".into(), event, None)
.await?;Verify webhooks in Rust with one call
The same library verifies webhooks from any platform that sends through Svix. Pass it the raw body and headers, and it checks the signature and timestamp for you.
use axum::body::Bytes;
use axum::http::{HeaderMap, StatusCode};
use svix::webhooks::Webhook;
const SECRET: &str = "WEBHOOK_SECRET";
async fn handle_webhook(
headers: HeaderMap,
body: Bytes,
) -> StatusCode {
let wh = Webhook::new(SECRET).unwrap();
if wh.verify(&body, &headers).is_err() {
return StatusCode::BAD_REQUEST;
}
// Authentic event: handle it
StatusCode::NO_CONTENT
}The hard parts are already done
Sending the POST is the easy part. Svix runs everything that makes webhooks hold up in production, so you don't write it, page on it, or maintain it.
Async and typed
An async client on tokio with typed models for every request and response, and errors you handle with ? like the rest of your code.
Retries
Failed deliveries retry with exponential backoff for more than a day, and endpoints that keep failing are disabled automatically.
Signing
Every message is signed to the Standard Webhooks spec, with a timestamp that blocks replay attacks.
A portal for your customers
Embed a white-labeled portal where customers add endpoints, pick event types, and debug deliveries themselves.
Delivery logs
Every attempt, response, and status code is searchable, so you never have to grep for a lost webhook.
Replay and recovery
Resend a single message or recover everything that failed since an outage, in one click or one API call.
Svix runs on Rust, and it's open source
The Svix server, CLI, and Bridge are written in Rust and MIT-licensed on GitHub. The SDK you install comes from the team that runs that code in production every day.
“Not having to think about webhook management when we have so many other things to focus on is great. Svix's platform is reliable, fast, and makes our lives easier by handling the complexities of webhooks, allowing us to deliver a better experience for our users.”
Startups get $12,000 in free credits
Incorporated in the last three years and raised $7M or less? Get $1,000 a month in Svix credits for a year, plus hands-on onboarding from our team. Companies in the current YC batch get $50,000.
Is Svix written in Rust?
Yes. The Svix server, the Svix CLI, and Svix Bridge are written in Rust, and all three are open source under the MIT license.
Can I self-host Svix?
The open-source Svix server is on GitHub and you can run it yourself. Most teams use Svix Cloud so they don't have to operate it.
Does verification work with my framework?
Webhook::verify takes the raw body as bytes and an http::HeaderMap, so it works with axum, hyper, and anything else built on the http crate.