1. Documentation
  2. Frameworks
  3. Next.js
ReadmeGitHub
  • Introduction
  • Quickstart
  • CLI
  • Configuration
  • Identity
  • Branding
  • Themes
  • Monitors
  • Checks and scheduling
  • Metrics and badges
  • Incidents
  • Maintenance
  • Notifications
  • Subscribers
  • React Router
  • Next.js
  • Astro
  • SQLite
  • Cloudflare D1
  • PostgreSQL
  • Schema and migrations
  • Cloudflare
  • Vercel
  • Self-hosting
  • API overview
  • Status endpoints
  • Incident endpoints
  • Maintenance endpoints
  • Subscriber endpoints
  • Badges, feeds and metrics
  • Admin endpoints
  • The check run
  • Uptime and history
  • Automatic incidents
  • Notification delivery
  • Public subscriptions

Next.js

Create and customise a Next.js status page with create-heyo-status.

Use create-heyo-status to generate the page, API, database setup and scheduler wiring together. Choose a deployment target for production: Vercel uses Cron and PostgreSQL; Cloudflare uses OpenNext, Worker cron triggers and D1. The status page needs server rendering and scheduled checks; installing the package into an app does not set those up.

Create a project

Pass next to select the framework without a prompt. Omit flags to choose the framework, deployment, database and theme interactively.

bun create @heyo-sh/heyo-status my-status-page --template next
cd my-status-page
bun dev

The generated scripts and CLI require Bun 1.4.3+ even if you use another package manager. If you skipped dependency installation, install the project's dependencies first. Replace the example monitors in heyo-status.config.ts. With Vercel/PostgreSQL, bun dev starts the local scheduler and bun run check runs one check; Cloudflare/D1 uses Worker cron triggers in production instead.

Customise the generated Next.js project

  • heyo-status.config.ts defines the database, monitors, schedule and theme.
  • app/api/heyo-status/[...path]/route.ts mounts the status API under the config's basePath (default /api/heyo-status). Keep them in sync if you change that path.
  • app/page.tsx renders a fresh snapshot on every request. Keep its dynamic rendering setting; a static page would show stale status. app/layout.tsx loads the theme stylesheet and bootstrap script.
  • The deployment overlay supplies the production scheduler. Do not remove its cron routes or Worker scheduled handler when changing the app.

For Cloudflare, use HTTP or DNS monitors: Workers cannot run native TCP/TLS checks. For Vercel, TCP/TLS checks need Node.js 20.19+. See the Cloudflare and Vercel guides before deploying.

Next steps

  • Configure monitors
  • Deploy to Vercel
React Router< PreviousAstroNext >

Powered by heyo

On this page

Create a projectCustomise the generated Next.js project