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

@tempered/hydrogen-wishlist

v0.0.0

Published

Wishlist components for Shopify Hydrogen storefronts with Shopify metafield storage

Readme

@tempered/hydrogen-wishlist

Wishlist components for Shopify Hydrogen storefronts. Data stored in Shopify customer metafields - zero vendor lock-in.

Features

  • Metafield Storage: Wishlist data stored in Shopify customer metafields, not a third-party database
  • Guest Support: localStorage fallback for non-logged-in users with automatic merge on login
  • Zero Lock-in: Your data stays in Shopify even if you uninstall
  • Bundle Size: < 15KB gzipped
  • SSR Compatible: Works with Hydrogen's server-side rendering

Installation

npm install @tempered/hydrogen-wishlist

Quick Start

1. Add the Provider

Wrap your app with WishlistProvider:

import { WishlistProvider } from '@tempered/hydrogen-wishlist';

export default function App() {
  const customer = useCustomer(); // Your customer hook

  return (
    <WishlistProvider
      config={{
        apiUrl: 'https://wishbridge.temperedtools.xyz',
        shopDomain: 'my-store.myshopify.com',
        apiKey: 'wb_live_...', // From WishBridge dashboard
        customerId: customer?.id,
        customerAccessToken: customer?.accessToken,
      }}
    >
      <Outlet />
    </WishlistProvider>
  );
}

2. Add Wishlist Button to Products

import { WishlistButton } from '@tempered/hydrogen-wishlist';

function ProductPage({ product }) {
  return (
    <div>
      <h1>{product.title}</h1>
      <WishlistButton
        product={{
          id: product.id,
          title: product.title,
          handle: product.handle,
          variantId: selectedVariant?.id,
          image: product.featuredImage,
          price: selectedVariant?.price,
        }}
      />
    </div>
  );
}

3. Add Wishlist Count Badge

import { WishlistCount } from '@tempered/hydrogen-wishlist';

function Header() {
  return (
    <nav>
      <Link to="/wishlist">
        <HeartIcon />
        <WishlistCount />
      </Link>
    </nav>
  );
}

4. Create a Wishlist Page

import { WishlistPage } from '@tempered/hydrogen-wishlist';

export default function WishlistRoute() {
  const navigate = useNavigate();

  return (
    <WishlistPage
      onAddToCart={(item) => {
        // Add to your cart
      }}
      onViewProduct={(item) => {
        navigate(`/products/${item.productHandle}`);
      }}
      showShare
    />
  );
}

Components

WishlistProvider

Configuration provider. Required at root.

<WishlistProvider
  config={{
    apiUrl: string;           // WishBridge backend URL
    apiKey?: string;          // API key for authentication
    shopDomain: string;       // your-store.myshopify.com
    customerId?: string;      // Shopify customer GID
    customerAccessToken?: string; // For Storefront API reads
    enableGuestWishlist?: boolean; // Default: true
    enableAutoMerge?: boolean;    // Default: true
  }}
>
  {children}
</WishlistProvider>

WishlistButton

Heart toggle button for adding/removing products.

<WishlistButton
  product={ProductInfo}
  size={40}
  iconActive={<CustomIcon />}
  iconInactive={<CustomIcon />}
  onAdd={(item) => {}}
  onRemove={(productId, variantId) => {}}
/>

WishlistCount

Badge showing item count.

<WishlistCount
  showZero={false}
  maxDisplay={99}
/>

WishlistDrawer

Slide-out panel for viewing wishlist.

<WishlistDrawer
  isOpen={boolean}
  onClose={() => {}}
  position="right"
  onAddToCart={(item) => {}}
  onViewProduct={(item) => {}}
/>

WishlistPage

Full-page wishlist view.

<WishlistPage
  layout="grid"
  columns={4}
  showSort
  showShare
  onAddToCart={(item) => {}}
  onViewProduct={(item) => {}}
/>

Hooks

useWishlist

Core hook for wishlist operations.

const {
  items,           // WishlistItem[]
  count,           // number
  isLoading,       // boolean
  isSyncing,       // boolean
  error,           // string | undefined
  add,             // (product: ProductInfo) => Promise<void>
  remove,          // (productId, variantId?) => Promise<void>
  toggle,          // (product: ProductInfo) => Promise<void>
  isWishlisted,    // (productId, variantId?) => boolean
  clear,           // () => Promise<void>
  sync,            // () => Promise<void>
} = useWishlist();

useWishlistCount

Optimized hook for count only.

const { count, isLoading } = useWishlistCount();

useWishlistSync

Handle guest-to-customer merge.

const {
  isSyncing,
  syncError,
  triggerSync,
} = useWishlistSync({
  autoSync: true,
  onSyncSuccess: () => {},
  onSyncError: (error) => {},
});

Storage Strategy

Guest Users (not logged in)

  • Data stored in localStorage
  • Key: wishbridge_items
  • Instant operations, no network calls

Logged-in Customers

  • Data stored in Shopify customer metafields
  • Namespace: wishbridge, Key: items
  • Read via Storefront API, write via Admin API through backend

Login Merge

When a guest logs in:

  1. Guest items read from localStorage
  2. Customer metafield read via backend
  3. Items merged (keeping earliest addedAt)
  4. Merged result written to metafield
  5. localStorage cleared

Plans

| Feature | Free | Pro ($9/mo) | Agency ($29/mo) | |---------|------|-------------|-----------------| | Guest wishlist (localStorage) | ✓ | ✓ | ✓ | | Customer metafield sync | - | ✓ | ✓ | | Shareable wishlist links | - | ✓ | ✓ | | Analytics dashboard | - | ✓ | ✓ | | Multi-site support | - | - | ✓ | | Advanced analytics | - | - | ✓ | | White-label | - | - | ✓ | | Public API | - | - | ✓ |

License

MIT