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.
| 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 statuspnpm dlx dbg statusbun x dbg statusyarn dlx dbg statusnpx dbg browser consolepnpm dlx dbg browser consolebun x dbg browser consoleyarn dlx dbg browser consoleFull example
See the complete working example at examples/node/fastify.



