Posthook + Next.js Starter
Schedule Delayed Tasks in Next.js Without Cron, Queues, or Workflow Engines
Posthook gives your Next.js app durable per-event timers. Schedule a reminder, expiration, or follow-up with one API call — your route handler runs when the time comes.
Webhook handlers
app/api/webhooks/remind/route.ts
One route per hook type. Each handler verifies the HMAC signature, checks task state, and acts or no-ops.
Task state machine
lib/tasks.ts
Schedule-first ordering, conditional updates, and epoch-based snooze.
Scheduling patterns
PATTERNS.md
Seven copy-pasteable patterns including per-event timers, state verification, epoch snooze, conditional updates, and idempotency keys.
Posthook SDK setup
lib/posthook.ts
Lazy singleton for Next.js build safety. Works with any Postgres instance and any deployment platform.
Starter repo
API routes, webhook handlers, and scheduling patterns. Clone this to get started.
Live demo repo
Source for this app. Adds UI, session isolation, and seeded data on top of the starter.
Built with Next.js, Postgres, Drizzle ORM, OpenAI, and Posthook. No cron to maintain. No workflow engine to learn.