Next.js
Create a Next.js status page with Heyo Status or integrate the App Router into an existing app.
Creating a new Next.js status page? The starter sets up the page, API, database and local checks for you. Choose the Cloudflare or Vercel overlay if you need cron jobs in production. To add status to an existing App Router app, use the manual steps below; the page must render a fresh snapshot on each request.
Create a project
Pass next to select the template without a prompt. Omit flags to choose the
framework, deployment, database and theme interactively.
If you skipped dependency installation in the creator, install the project's
dependencies before starting it. Replace the example monitors in
heyo-status.config.ts. For SQLite or Vercel/PostgreSQL, bun dev runs the
local scheduler; bun run check runs one check without a global CLI install.
Cloudflare/D1 uses Worker cron triggers instead and has no check script.
For direct shell commands, see the CLI guide.
Add status to an existing app
The steps below add the page and API to an App Router app. You still need persistent storage and a production scheduler; the starter handles those platform-specific pieces for you.
1. Install and configure
Install the package in the app's root directory:
You only need a global CLI install
if you want to type heyo-status … directly in your shell.
Create heyo-status.config.ts at the project root. This SQLite example needs
a persistent filesystem; for Vercel use PostgreSQL, and for Cloudflare use D1
and the generated Worker overlay.
To test a monitor before scheduling it, install the global CLI and run
heyo-status check run from the project root. It reads the config and database
without a running Next.js server (and requires Bun 1.4.3+). For Cloudflare/D1,
use Worker cron triggers instead; a local shell has no D1 binding.
2. Mount the API
Mount the catch-all handler at the default basePath, /api/heyo-status. A
dynamic import keeps embedded SQLite out of Next's build-time static analysis.
3. Render a fresh snapshot
Import the theme stylesheet in app/layout.tsx. Render the head bootstrap
script there as in the generated layout when using light/dark mode.
Pass branding, colors, mode, basePath, metrics and subscriber settings
as well if configured. force-dynamic is essential: without it, Next.js can
serve a snapshot from build time instead of the latest checks.
4. Schedule checks
statusPage.cron exposes runChecks, summarize and cleanup. The manual
integration needs a scheduler to call them; a route alone does not run checks.
For a production deployment, use the generated Vercel cron
routes or Cloudflare Worker
triggers. On your own server,
run one scheduler.