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

@jhoose-commerce/core-nextjs

v1.0.10

Published

Extends the Jhoose Commerce core package with Next.js specific functionality

Readme

Jhoose Commerce Core Javascript API - Next.JS extensions

This library contains several functions that support using the Core Javascript framework with Next.JS

anonymousAuthenticationMiddleware

This middleware manages anonymous user sessions in a Next.js e-commerce application. Let me break down how it works:

High-Level Flow The middleware ensures every visitor has a valid authentication token and customer context, even before they log in. Think of it as giving every visitor a temporary "guest pass" to browse the store.

clearCartAfterCheckoutMiddleware

This middleware handles cart cleanup after a successful checkout by setting a cookie that signals the cart should be removed.

High-Level Purpose When a user completes checkout, they're typically redirected back to your site with a query parameter. This middleware detects that parameter and sets a cookie to trigger cart removal on the client side.

marketMiddleware

This middleware manages market/locale detection and persistence for international e-commerce sites. It ensures users see content in the correct language and currency based on their location or preferences.

High-Level Purpose Think of this as a "location detector" that:

Checks if the user already has a saved market preference (from a cookie) Validates that preference matches the current URL language Updates the market if there's a mismatch or if it's missing

Example middleware


import type { NextRequest } from 'next/server';

import { auth0 } from "./lib/auth0";
import { anonymousAuthenticationMiddleware, clearCartAfterCheckoutMiddleware, marketMiddleware } from '@jhoose-commerce/core-nextjs';

 export async function middleware(request: NextRequest) {
  const authRes = await auth0.middleware(request)

  if (request.nextUrl.pathname.startsWith("/auth")) {
    return authRes
  }

  const anonymouseRes = await anonymousAuthenticationMiddleware(request,authRes);
  const marketRes = await marketMiddleware(request,anonymouseRes);
  const clearCartRes = await clearCartAfterCheckoutMiddleware(request,marketRes);

  return clearCartRes;
}
export const config = {
  matcher: ['/((?!api|_next/static|_next/image|favicon.ico|commerceapi).*)']
}