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

@chip-hosting/nextjs

v1.0.1

Published

Next.js integration for the Marver Web SDK — Chip Hosting's first-party analytics (formerly Data Workbench). Client provider/hooks and edge middleware (App + Pages Router); App-Router server-side identity (server components, actions).

Downloads

267

Readme

@chip-hosting/nextjs

Next.js integration for the Marver Web SDK — Chip Hosting's first-party analytics platform (formerly Data Workbench). Provides a client provider and hooks plus edge middleware that work with both the App Router and the Pages Router, and App-Router server-side identity helpers (server components and server actions).

  • ClientAnalyticsProvider + useAnalytics / usePageView hooks (App Router and Pages Router).
  • Edge — a drop-in route handler that proxies events to your Sensor.
  • Server — middleware for visitor identity (router-agnostic), plus getServerIdentity and serverTrack for server components and actions (App Router only — they rely on next/headers).

Router support: the client provider/hooks and the edge middleware run on both the App Router and the Pages Router. The server-side identity helpers (getServerIdentity, serverTrack) are App Router only, since they use next/headers.

Installation

npm install @chip-hosting/nextjs @chip-hosting/analytics

@chip-hosting/analytics (the Marver Web SDK) is a peer dependency — install it alongside.

Client setup (App Router)

Wrap your app in AnalyticsProvider:

// app/layout.tsx
import { AnalyticsProvider } from '@chip-hosting/nextjs';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html>
      <body>
        <AnalyticsProvider
          endpoint={process.env.NEXT_PUBLIC_DWB_ENDPOINT!}
          clientId="my-nextjs-app"
        >
          {children}
        </AnalyticsProvider>
      </body>
    </html>
  );
}

AnalyticsProvider props: endpoint (required), clientId (required), cookieDomain, batchSize, flushInterval, debug, useProxy, proxyEndpoint, autoCollect.

Hooks

'use client';
import { useAnalytics, usePageView } from '@chip-hosting/nextjs';

export function SignupButton() {
  usePageView(); // auto-track page views on route change

  const { track, identify, page, reset } = useAnalytics();

  return (
    <button onClick={() => track('signup_click', { plan: 'pro' })}>
      Sign up
    </button>
  );
}

useAnalytics() returns: track, page, identify, reset, flush, getVisitorId, getSessionId, getUserId.

Edge route handler

Proxy events through an Edge Function (keeps your Sensor endpoint off the client and adds geo enrichment):

// app/api/analytics/route.ts
import { createAnalyticsHandler } from '@chip-hosting/nextjs/edge';

export const runtime = 'edge';
export const POST = createAnalyticsHandler({
  sensorEndpoint: process.env.DWB_SENSOR_ENDPOINT!,
  clientId: 'my-nextjs-app',
});

Then point the client at the proxy with useProxy / proxyEndpoint on the provider.

Server-side (middleware, components, actions)

// middleware.ts
import { createAnalyticsMiddleware } from '@chip-hosting/nextjs/server';

export const middleware = createAnalyticsMiddleware({
  sensorEndpoint: process.env.DWB_SENSOR_ENDPOINT!,
  clientId: 'my-nextjs-app',
});
// in a server component or server action
import { getServerIdentity, serverTrack } from '@chip-hosting/nextjs/server';

const identity = await getServerIdentity();
await serverTrack('order_completed', { orderId, total });

The middleware resolves visitor identity on each matched request (setting the _dwb_id cookie for new visitors) and propagates it to downstream server components, so getServerIdentity() avoids a redundant Sensor call.

License

MIT