integrations
Discord Notification Bot
This example receives Freshbatch webhook payloads, verifies the HMAC signature, and forwards job listings to a Discord channel using webhook embeds.
github
Full source code and Docker setup live in this public repository: Open GitHub Repository
How it works
- - POST requests are received on /webhook.
- - The webhook-signature header is validated with WEBHOOK_SECRET.
- - Incoming jobs are normalized and formatted into Discord embeds.
- - A message is delivered via Discord webhook URL.
Project structure
- - server.ts handles Express routes and webhook endpoint logic.
- - utils.ts contains signature verification and key sorting helpers.
- - discord-webhook.ts builds embeds and posts with discord.js WebhookClient.
- - call-hook.test.ts sends a signed local mock request.
Environment variables
PORT=3232 WEBHOOK_SECRET=your_shared_secret DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/... SERVER_URL=http://localhost:3232
Run locally
bun install bun run server # In a separate terminal (with server running) bun run mock-test
Expected request shape
{
"data": [
{
"title": "...",
"url": "...",
"company_name": "...",
"is_fte": true,
"is_intern": false,
"is_test": true,
"date_posted": 1704067200000,
"source": "freshbatch-test",
"degrees": ["BS Computer Science"],
"sponsorship": "Available",
"locations": ["Remote"],
"category": "Engineering"
}
]
}Keep signature verification aligned with the canonicalization strategy in Freshbatch docs: