Webhooks, also known as reverse APIs, enable real-time, event-driven communication between services. Instead of constantly polling for updates, webhooks allow services to push data to your app the moment something happens. This could be when someone pushes a commit, processes a payment, or creates an issue. This makes webhooks essential for building reactive, event-driven architectures.
With Unikraft Cloud, you can deploy webhook receivers that combine instant availability with scale-to-zero economics—paying only when events arrive, while maintaining millisecond-level response times.
Why run webhook receivers on Unikraft Cloud
⚡ Instant wake-up for bursty events
Webhooks are inherently sporadic—events can arrive in bursts or be silent for hours. Traditional servers waste resources running every day, waiting for events. Unikraft Cloud's unikernel architecture provides:
- Single-digit-millisecond cold starts ensure instant response when events arrive.
- No noticeable delay for webhook senders, maintaining reliable integrations.
- Minimal memory footprint allows running many specialized webhook receivers.
🔒 Isolated and secure
Webhook receivers often process sensitive data from external services. Unikraft Cloud provides VM-level isolation for each instance:
- Strong isolation prevents cross-contamination between different webhook handlers.
- Immutable unikernel images reduce the attack surface.
- Built-in HTTPS endpoints with automatic TLS certificate management.
💸 Pay only for events
Why pay for idle servers when webhooks only fire occasionally? With Unikraft Cloud:
- Webhook receivers scale-to-zero when not processing events, costing nothing.
- Instant wake-up ensures the system processes events immediately upon arrival.
- Fine-grained billing means you only pay for actual event processing.
Getting started
This guide shows you how to deploy a GitHub webhook receiver that listens for repository events. The example uses Node.js with Express and the official Octokit webhooks library. To run it, follow these steps:
-
Install the
kraftCLI tool and a container runtime engine (for example, Docker). -
Clone the
examplesrepository andcdinto theexamples/webhook-github-node/directory:
Code
Make sure to log into Unikraft Cloud by setting your token and a metro close to you.
This guide uses fra (Frankfurt, 🇩🇪):
Code
Follow the instructions in the example's README to set it up and grab the server's FQDN. After that, check that the service is up:
Code
Code
To create a webhook in GitHub, follow the official documentation and the indications in the example's README.
The example includes:
- Signature validation using GitHub's webhook secret (via Octokit library).
- Event logging with timestamps for debugging and auditing.
- Health check endpoint for monitoring and load balancer integration.
- Scale-to-zero configuration in the
Kraftfile.
To customize for other webhook sources (Stripe, Slack, GitLab, etc.), it's best to refer to their specific libraries and signature validation methods. Webhooks aren't a standardized protocol, so each service has its own conventions. Also follow Webhooks.fyi for best practices.
Learn more
Use the --help option for detailed information on using Unikraft Cloud:
Code
Or visit the CLI Reference.
For more information, check out these resources:
- Express docunmentation
- GitHub Webhooks Documentation
- Securing GitHub Webhooks
- Webhook Best Practices