Wednesday, August 13, 2025

📡 "Mastering GitHub Webhooks: From Local Testing to Civic Engagement"

📡 GitHub Webhook Setup & Proxy Guide

📡 GitHub Webhook Setup & Proxy Guide

#Webhooks • #GitHubAPI • #SmeeProxy • #CivicTech • #Automation • #Serverless • #OpenInfra

Introduction

When you create a webhook in GitHub, you're essentially telling GitHub: “Hey, notify me when something important happens.” You specify a URL and subscribe to event types like push, issues, or deployment_status. When one of those events occurs, GitHub sends an HTTP POST request to your URL — packed with JSON data about the event.

“Webhooks are how GitHub talks to your server — if your server is listening, it can respond in real time.”

Setup

To test webhooks locally, you need a way to receive GitHub’s requests on your machine. That’s where smee.io comes in — it acts as a proxy that forwards GitHub webhooks to your local server.

Think of smee.io as a civic translator — it catches GitHub’s webhook and relays it to your local port so you can debug, log, and respond.

Steps to Set Up

Step Action
1. Get Proxy URL Go to smee.io → Start a new channel → Copy the Webhook Proxy URL
2. Install smee-client npm install --global smee-client
3. Forward Webhooks smee --url WEBHOOK_PROXY_URL --path /webhook --port 3000
4. Create GitHub Webhook Use your proxy URL as the webhook target. Set content type to application/json

Write Code to Handle Webhook Deliveries

Once your server is receiving forwarded webhooks, you need to write code that:

  • Listens for POST requests at /webhook
  • Reads headers and body from the request
  • Takes action — log, notify, or trigger other services

Here’s a simple example in Node.js:

 const express = require('express'); const app = express(); app.use(express.json()); app.post('/webhook', (req, res) => { console.log('Webhook received:', req.body); res.status(200).send('OK'); }); app.listen(3000, () => console.log('Listening on port 3000')); 
Once your webhook is live, you can do anything — update dashboards, send Slack alerts, trigger builds, or rotate civic hashtags.

Conclusion

Webhooks are the heartbeat of real-time integrations. With GitHub and smee.io, you can test locally, debug confidently, and build civic tools that respond instantly to public events. Whether you're rotating hashtags or syncing deployments, this setup gives you full control.