Skip to content

Repository files navigation

Hook

A disposable webhook receiver built on Next.js + Cloudflare Workers.

Use Now

  • Open the page → you get a random URL like https://<host>/h/<id>
  • Send any HTTP request to that URL → it streams into the browser live (SSE)
  • The endpoint stays alive for 60 minutes after the last received request, then 410s
  • Webhook payloads are never persisted — they're broadcast through a Durable Object and stored only in the receiving browser's sessionStorage
  • Empty state shows a curl snippet you can paste; once requests arrive, pick one from the sidebar to inspect headers, query, and a pretty-printed body

Preview

Architecture

PieceWhere
Page UIsrc/app/page.tsxsrc/components/webhook-tool.tsx
Worker entry (wraps OpenNext)worker.ts
Durable Object (per-session broker)src/lib/webhook-session.ts
DO binding + migrationwrangler.jsonc

The custom worker intercepts /h/{id}[/...] (webhook receiver, any method) and /s/{id} (SSE stream) and forwards both to a WebhookSession Durable Object keyed by id. Everything else falls through to the OpenNext-built Next.js handler.

Commands

CommandAction
npm run devNext.js dev server (UI only — DO routes don't run here)
npm run previewBuild with OpenNext, run the full worker locally via wrangler (recommended for end-to-end testing)
npm run buildBuild production bundle
npm run deployBuild + deploy to Cloudflare
npm run cf-typegenRegenerate env.d.ts after editing wrangler.jsonc

next dev proxies bindings via miniflare but cannot run the Durable Object class our wrapper exports — for hitting the live endpoint locally, use npm run preview.

About

A disposable webhook receiver built on Next.js + Cloudflare Workers.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages