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

@bitbabit/devtools-ssr-bridge

v0.2.1

Published

SSR bridge utilities for Magento Developer Tools with Next.js and React SSR support.

Readme

@bitbabit/devtools-ssr-bridge

SSR debugging helpers for Magento Developer Tools + Next.js: patches fetch and axios, middleware SSR correlation, and Chrome extension / env-based config.

Full setup (step-by-step, i18n recipe, troubleshooting): docs/SETUP.md

How It Works

  Chrome Extension (browser)              Next.js Server
  ────────────────────────────            ────────────────────────────
  ┌────────────────────────┐
  │ Extension enabled +    │
  │ API key configured     │
  └───────────┬────────────┘
              │
              ▼
  ┌────────────────────────┐   __devtools_config   ┌────────────────────────┐
  │ Content script auto-   │      cookie           │ instrumentation.js     │
  │ writes settings to     │ ─────────────────────►│ patches fetch + axios  │
  │ cookie on every page   │                       │                        │
  └────────────────────────┘                       │ Middleware sets        │
                                                   │ X-SSR-ID + request id  │
                                                   │ Layout binds id for    │
                                                   │ parallel RSC calls     │──► Magento
                                                   └────────────────────────┘    (SSR logs)

Install

npm i @bitbabit/devtools-ssr-bridge
npx devtools-ssr-bridge-setup

Then complete manual steps in docs/SETUP.md (middleware + root layout). The CLI does not patch middleware (app-specific).

Minimal checklist

| Step | Action | |------|--------| | 1 | npm i @bitbabit/devtools-ssr-bridge | | 2 | npx devtools-ssr-bridge-setup (or follow SETUP.md by hand) | | 3 | next.configexport default withDevtoolsSsrBridge(nextConfig) | | 4 | src/instrumentation.jsregister() + axios patch (see SETUP) | | 5 | src/app/api/devtools/config/route.js → re-export next-app-route | | 6 | MiddlewareprepareDevtoolsSsrRequest before i18n/router; setSsrIdOnMiddlewareResponse before return | | 7 | Root layoutawait bindDevtoolsSsrCorrelation() as first line | | 8 | axios moduleattachAxiosSsrDevtools(axios, …instances) on server | | 9 | Enable Chrome extension + save API key; restart next dev |

Verify

  • HTML response: one X-SSR-ID per page load.
  • Magento logs: same x-ssr-id on all SSR axios calls for that load.
  • Extension profiler loads SSR logs for that id.

What the setup CLI automates

| File | Created/updated by CLI | |------|-------------------------| | src/instrumentation.{js,ts} | Yes (recommended axios template) | | next.config.{mjs,js,ts} | Yes (withDevtoolsSsrBridge) when export pattern is recognized | | src/app/api/devtools/config/route.{js,ts} | Yes (App Router) | | middleware.js | No — copy snippet from SETUP.md | | Root layout.jsx | NobindDevtoolsSsrCorrelation() |

i18n apps (next-i18n-router)

Use this order in middleware:

const devtoolsSsrId = prepareDevtoolsSsrRequest(request, { pathname });
const I18nRes = i18nRouter(request, i18nConfig);
// ...your logic...
setSsrIdOnMiddlewareResponse(I18nRes, devtoolsSsrId);
return I18nRes;

Do not return forwardDevtoolsSsrRequestToServer in place of the i18n response if that breaks locale rewrite. Details: docs/SETUP.md#recipe-with-i18n-middleware-next-i18n-router.

Configuration reference

Environment variables (Node)

| Variable | Value | Purpose | |---|---|---| | DEVTOOLS_SSR_BRIDGE_DEBUG | 1 | Logs [devtools-ssr-bridge] diagnostics | | MAGENTO_DEVTOOLS_ENABLED | true | Env fallback when __devtools_config is absent | | MAGENTO_DEVTOOLS_API_KEY | string | API key for env fallback |

Cookies & headers

| Name | Role | |---|---| | __devtools_config | Debug config (API key, allowed paths, custom headers) | | X-SSR-ID | Response header — extension reads from document | | x-devtools-ssr-id | Request header — middleware → server axios/fetch |

Config API route

// src/app/api/devtools/config/route.js
export { POST, DELETE } from '@bitbabit/devtools-ssr-bridge/next-app-route';

withDevtoolsSsrBridge(nextConfig)

Marks axios and this package as server externals so instrumentation patches one Node axios copy.

Subpath imports

import { register } from '@bitbabit/devtools-ssr-bridge/instrument';
import { attachAxiosSsrDevtools } from '@bitbabit/devtools-ssr-bridge/attach-axios';
import { bindDevtoolsSsrCorrelation } from '@bitbabit/devtools-ssr-bridge/ssr-correlation';
import { prepareDevtoolsSsrRequest, setSsrIdOnMiddlewareResponse, withDevtoolsSsrBridge } from '@bitbabit/devtools-ssr-bridge/next';

API overview

| Export | Package | Purpose | |---|---|---| | register() | instrument | Patch global fetch | | attachAxiosSsrDevtools | attach-axios | Patch axios instance(s) | | patchAxiosCreate | instrument | Patch axios.create() | | prepareDevtoolsSsrRequest | next | Middleware: set request SSR id | | setSsrIdOnMiddlewareResponse | next | Middleware: set X-SSR-ID on HTML | | bindDevtoolsSsrCorrelation | ssr-correlation | Root layout: one id for parallel calls | | withDevtoolsSsrBridge | next | Wrap next.config |

Full API tables and cookie reference remain in older sections of this package source; prefer SETUP.md for integration.

Publish

Maintainers: docs/NPM_PUBLISH.md. Changelog: CHANGELOG.md.

License

MIT