Webhook

Set up, configure, and run the Reloop webhook microservice locally.

Outbound event webhooks — subscription management, HMAC signing, delivery, and retries via BullMQ.

Run bun setup once from the monorepo root. Env files come from bun setup / bun env:setup.

Overview

PropertyValue
Directoryapps/backend/webhook
Port8013
Local URLhttps://local.reloop.sh/api/webhook
Swagger UIhttps://local.reloop.sh/api/webhook/openapi
StackElysiaJS · PostgreSQL · Redis · NATS · BullMQ

Quick start

bun be:webhook:dev

Or bun backend:dev / bun dev.

Environment

apps/backend/webhook/.env — from bun setup / bun env:setup.

PG_URL=postgresql://reloop:reloop123@localhost:5432/reloop
REDIS_URL=redis://:reloop123@localhost:6379
WEBHOOK_ENCRYPTION_KEY=your-64-char-hex-key
PORT=8013
BASE_URL="https://local.reloop.sh"
NATS_URL=nats://localhost:4222
NODE_ENV=development

WEBHOOK_ENCRYPTION_KEY encrypts stored webhook signing secrets. If unset, secrets are stored in plaintext (local only).

VariableRequiredDefault
PG_URLYESpostgresql://...
REDIS_URLYESredis://...
WEBHOOK_ENCRYPTION_KEYProd onlyDev key in .env.dev
PORTYES8013
BASE_URLYEShttps://local.reloop.sh
NATS_URLYESnats://localhost:4222

Commands

CommandDescription
bun be:webhook:devStart dev server with hot reloading
bun run --filter=be-webhook buildCompile production bundle
bun run --filter=be-webhook startRun compiled production build
bun run --filter=be-webhook check-typesTypeScript type-check

Architecture

LayerDetail
Control planeThis service — CRUD endpoints, list deliveries, manual replay
Dispatcherbe-workflow NATS queue group webhook-dispatcher (email lifecycle + manual trigger)
DeliveryDedicated BullMQ queue webhook-delivery-queue; signs with Reloop-Signature
RetriesFixed 7-attempt schedule (5s → 5m → 30m → 2h → 5h → 10h)
Helpers@reloop/webhook-delivery (envelope, HMAC, SSRF client)
Schemapackages/db/src/schema/webhook.ts

Next

Was this page helpful?

Edit this page