npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

next-fetch-devtools

v0.9.0

Published

In-browser network devtools for Next.js apps that capture server-side and client-side fetch & axios requests.

Downloads

156

Readme

next-fetch-devtools

In-browser network devtools for Next.js apps. Captures server-side and client-side fetch and axios requests and shows them in a floating, resizable panel — like Chrome DevTools' Network tab, but for server components too.

Devtools panel

Features

  • Captures all fetch calls (server + client)
  • Captures all axios calls (attach an interceptor to any instance)
  • Floating panel with drag, resize from any edge, minimize, maximize
  • Tabs: Mine (your API) / External / All
  • Filters by method (GET/POST/...) and failed-only
  • JSON tree viewer (expand/collapse arrays and objects)
  • Open in a separate browser tab (full page)
  • Dev-only by default — disabled in production

Install

npm install next-fetch-devtools

Setup (Next.js App Router)

1. Patch fetch and axios on the server

Create lib/devtools-setup.ts:

import { installFetchLogger } from 'next-fetch-devtools/server';

installFetchLogger();

Import it once in your app/layout.tsx:

import 'lib/devtools-setup';

If you use axios, wrap your instance:

import axios from 'axios';
import { attachAxiosLogger } from 'next-fetch-devtools/server';

export const client = attachAxiosLogger(
  axios.create({ baseURL: process.env.NEXT_PUBLIC_API_BASE_URL }),
);

2. Add the API route

Create app/api/__devtools/fetches/route.ts:

import { createDevtoolsRoute } from 'next-fetch-devtools/server';

const handlers = createDevtoolsRoute();
export const GET = handlers.GET;
export const DELETE = handlers.DELETE;
export const dynamic = 'force-dynamic';

3. Render the panel in your root layout

import { DevtoolsPanel } from 'next-fetch-devtools/client';

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        {children}
        {process.env.NODE_ENV === 'development' && (
          <DevtoolsPanel apiBase={process.env.NEXT_PUBLIC_API_BASE_URL} />
        )}
      </body>
    </html>
  );
}

4. (Optional) Standalone full-page route

Create app/__devtools/page.tsx:

import { notFound } from 'next/navigation';
import { DevtoolsStandalone } from 'next-fetch-devtools/client';

export default function Page() {
  if (process.env.NODE_ENV !== 'development') notFound();
  return <DevtoolsStandalone />;
}

API

installFetchLogger(options?)

Monkey-patches globalThis.fetch. Call once on server startup.

installFetchLogger({
  enabled: process.env.NODE_ENV === 'development', // default
  ignoreUrlPatterns: ['/api/__devtools', /metrics/],
});

attachAxiosLogger(instance, options?)

Attaches request/response interceptors to an axios instance.

createDevtoolsRoute(options?)

Returns { GET, DELETE } handlers for the logs API.

<DevtoolsPanel /> props

| prop | default | description | |---|---|---| | apiBase | '' | Base URL of YOUR API — used by the "Mine" tab | | endpoint | /api/__devtools/fetches | API route that returns the logs | | standaloneUrl | /__devtools | URL of the standalone full-page devtools |

Production safety

All loggers and routes are disabled by default when NODE_ENV === 'production'. You can override with the enabled option if you want it elsewhere.

License

MIT