Configure Webhook
To configure webhook, go to Dashboard » Webhook
How it works
Our service serves requests asynchronously and notify the result via webhook.
Webhook is a user-defined HTTP callback that triggers when a request processing is finished.
By this way, user can fire a request and forget about it, results will fly to your subscribed webhook later.
Your system needs to return 2xx HTTP Status then our webhook system knows the message delivery is done.
As the result message can’t arrive your server, it will be automatically scheduled to resend, or you can resend manually.
Configure
Adding an endpoint is as simple as providing a URL that you control and selecting the event types that you want to listen to.
If you don’t specify any event types, by default, your endpoint will receive all events, regardless of type.
This can be helpful for getting started and for testing, but we recommend changing this to a subset later on to avoid receiving extraneous messages.
To start configuration, visit Dashboard » Webhook then add an endpoint there.
Webhook security
Webhook signatures let you verify that webhook messages are actually sent by us and not a malicious actor.
import { Webhook } from "svix";
const secret = "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw";
// These were all sent from the server
const headers = {
"svix-id": "msg_p5jXN8AQM9LWM0D4loKWxJek",
"svix-timestamp": "1614265330",
"svix-signature": "v1,g0hM9SsE+OTPJTGt/tmIKtSyZlE3uFJELVlNIOLJ1OE=",
};
const payload = '{"test": 2432232314}';
const wh = new Webhook(secret);
// Throws on error, returns the verified content on success
const payload = wh.verify(payload, headers);Retry failures
Webhook delivery without 2xx response code considered to be a failed delivery.
Webhook delivery response time is over 15s considered to be a failed delivery.
In that case, we will resend the webhook automatically as following plan:
- Immediately
- 5 seconds
- 5 minutes
- 30 minutes
- 2 hours
- 5 hours
- 10 hours
- 10 hours (in addition to the previous)
You also can retry manually any time failed sending via dashboard
Message retention
Webhook message will be deleted after 90 days.