Introduction
What is this
Skip to getting started
Getting started
Step-by-step guide to setup your first stream
Why
What are Webhooks?
Webhooks are HTTP callbacks triggered by some event. When an event occurs, the source site makes an HTTP request to the URL configured for the webhook.
What are Server Sent Events(SSEs)?
Server-Sent Events (SSE) helps in consuming messages in an event-based way via HTTP. Data is sent one-way over HTTP and when available pushed to the client in realtime. Using SSEs in our case requires only to make an HTTP GET request. More on SSEs
Why is consuming Webhooks easier with Webhook.stream?
Most webhook publishers require that the consumer exposes an https endpoint. Setting up https can be difficult - in addition to setting up a webserver to handle the logic, in most cases you would probably need a reverse proxy to terminate the SSL, messing up with configuration to get a certificate, buying a domain and that's just for the single server use-case.
Planning to handle many messages will require you to set it up all behind a load balancer and manage some form of a queue to manage back-pressure. With Webhook.stream you can consume webhooks via SSEs.
Examples
Without Webhook.stream
- You're interested in consuming Telegram webhook to build a chatbot.
- Build and test an http endpoint using ngrok.
- Deploy the web server behind a reverse proxy.
- Setup let's encrypt certificate for the reverse proxy.
- Add redis to your cluster to pubsub between instances of your webserver.
- Deploy Kafka on your cluster to handle Queues.
- Pray.
With Webhook.stream
- Subscribe to a topic
curl -N https://webhook.stream/sse/my_secret_key123
- Post a message to the topic
curl -d '{"hello":"world"}' -H "Content-Type: application/json" \
https://webhook.stream/post/my_secret_key123
And that's it!
There's no need to worry about setting up a webserver, ngrok, dns, reverse proxies, ssl certificates, queue servers, pub/sub or anything else.