Fastify

Set up debugger in a Fastify project.

Last updated March 19, 2026

Fastify

This guide covers adding debugger to a Fastify project. The setup takes one line.

Fastify official docs

Feature Support
Server console Yes
Server errors Yes
HTTP requests Yes
Browser script injection Manual

Install

npm install -D @ephem-sh/debugger

Set up

Register the debugger plugin with your Fastify instance:

import Fastify from 'fastify'
import { debuggerPlugin } from '@ephem-sh/debugger/fastify'

const fastify = Fastify({ logger: true })
await fastify.register(debuggerPlugin, { port: 3000 })

The plugin registers browser routes, adds onRequest/onResponse hooks for HTTP timing, and starts the IPC bridge.

Browser support

Add script tags before </body> in your HTML responses:

<script>window.__DEBUGGER_INGEST_URL__="/_/d";</script>
<script src="/_/d.js" defer></script>

Verify

node server.mjs
npx dbg status
pnpm dlx dbg status
bun x dbg status
yarn dlx dbg status
npx dbg browser console
pnpm dlx dbg browser console
bun x dbg browser console
yarn dlx dbg browser console

Full example

See the complete working example at examples/node/fastify.

Search Documentation

Search for pages and content