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

@observerkit/next

v0.3.0

Published

Next.js plugin for ObserverKit — injects debug IDs and uploads source maps

Downloads

547

Readme

@observerkit/next

Next.js plugin for ObserverKit — injects debug IDs into your build output and uploads source maps after next build. Works with both Turbopack (Next.js 16+ default) and webpack mode.

Requirements

  • Next.js >=15.4.1 (uses compiler.runAfterProductionCompile)
  • Turbopack debug-IDs require Next.js >=16.0.0

Install

pnpm add -D @observerkit/next

Setup

Wrap your next.config.ts (or next.config.js) with withObserverkit:

// next.config.ts
import withObserverkit from "@observerkit/next"
import type { NextConfig } from "next"

const nextConfig: NextConfig = {
  // your existing Next.js config
}

export default withObserverkit(nextConfig, {
  projectKey: process.env["OBSERVERKIT_PROJECT_KEY"] ?? "",
})

What it does

  • Enables productionBrowserSourceMaps: true
  • Enables experimental.serverSourceMaps: true so webpack-mode server bundles emit maps too (Turbopack emits them natively)
  • Enables turbopack.debugIds: true (Next.js 16+) so Turbopack emits standards-compliant debug IDs
  • In webpack mode, injects equivalent debug-ID registration into JS chunks
  • After next build, scans .next/ recursively for .map files and uploads the ones carrying a debugId to ObserverKit via compiler.runAfterProductionCompile
  • By default, deletes all .map files from the build output afterwards — even when the upload fails or is skipped — and blanks sourceMappingURL= references in emitted chunks (webpack and Turbopack output), so source maps never ship and devtools never 404

Options

| Option | Type | Default | Description | | --- | --- | --- | --- | | projectKey | string | required | ObserverKit project key | | endpoint | string | https://ingest.observerkit.com | Ingest API base URL | | deleteAfterUpload | boolean | true | Delete every .map file from .next/ after the upload attempt (even on failure, so maps never ship) and blank sourceMappingURL references in chunks |

Notes

  • The hook never throws. Upload failures are logged to console.error so they don't break the build.
  • If you self-host your Next.js production server and rely on Node's --enable-source-maps for runtime stack traces, set deleteAfterUpload: false so server-side .map files stay on disk.
  • When the user has already set productionBrowserSourceMaps or turbopack.debugIds, the plugin respects the user value.
  • Both client (.next/static/) and server (.next/server/) sourcemaps are uploaded.
  • When projectKey is empty (e.g. OBSERVERKIT_PROJECT_KEY unset in dev or CI), the plugin logs a warning and leaves your config untouched. It never breaks next dev or a keyless build.