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

@shophost/react

v2.0.36

Published

`@shophost/react` is the UI package for ShopHost. It provides:

Readme

@shophost/react

@shophost/react is the UI package for ShopHost. It provides:

  • the admin app shell and route helpers
  • Next.js App Router server entrypoints
  • storefront providers, pages, and reusable components

Installation

pnpm add @shophost/react @shophost/rest-api @prisma/client @prisma/client-runtime-utils

Peer dependencies:

  • next >= 14
  • react >= 18
  • react-dom >= 18

Entry Points

  • @shophost/react Use for admin config, route helpers, and auth helpers.
  • @shophost/react/next/server Use for App Router server-safe exports like RootPage.
  • @shophost/react/storefront Use for storefront providers, checkout/account pages, cart UI, and hooks.

Admin Usage

Create an admin config:

import { defineConfig } from "@shophost/react";

export const adminConfig = defineConfig({
  apiBaseUrl: process.env.NEXT_PUBLIC_API_BASE_URL!,
  basePath: "/admin",
  branding: {
    name: "ShopHost",
  },
});

Mount the admin routes in Next.js App Router:

import { generatePageMetadata, RootPage } from "@shophost/react/next/server";
import type { Metadata } from "next";

import { adminConfig } from "../config";

export function generateMetadata(): Metadata {
  return generatePageMetadata(adminConfig);
}

export default function Page(props: { params: Promise<{ segments?: string[] }> }) {
  return <RootPage {...props} config={adminConfig} />;
}

Create the matching not-found page:

export { NotFoundPage as default } from "@shophost/react/next/server";

Useful root exports:

  • defineConfig
  • createRoutes
  • createAdminAuthClient
  • getAdminAuthClient

Storefront Usage

Wrap your storefront with ShophostProvider:

"use client";

import type { Locale } from "@shophost/client";
import { ModifiersDialog, ShophostProvider } from "@shophost/react/storefront";
import React from "react";

export function AppProvider({ children, locale }: { children: React.ReactNode; locale: Locale }) {
  return (
    <ShophostProvider baseUrl={process.env.NEXT_PUBLIC_APP_DOMAIN!} locale={locale} organizationId={process.env.NEXT_PUBLIC_ORGANIZATION_ID!} modifiersModal={<ModifiersDialog />}>
      {children}
    </ShophostProvider>
  );
}

Mount the built-in checkout and account flows:

"use client";

import { AccountPages, CheckoutPages } from "@shophost/react/storefront";

export function CheckoutRoute() {
  return <CheckoutPages />;
}

export function AccountRoute() {
  return <AccountPages />;
}

Useful storefront exports:

  • ShophostProvider
  • CheckoutPages
  • AccountPages
  • CartDrawer
  • CartItems
  • ModifiersDialog
  • useCart
  • useAPI
  • useOrganization

Reference App

For a complete integration, see apps/example and the workspace README in the repository root.

License

MIT