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

@proofedge/medusa-storefront

v1.0.2

Published

React component library for ProofEdge social proof widgets in Medusa Next.js storefronts

Readme

@proofedge/medusa-storefront

React components for adding ProofEdge social proof widgets to your Medusa.js storefront.

Works with Next.js, Gatsby, or any React-based Medusa storefront.


What Is This?

This package gives you two things:

  1. ProofEdgeWidget — A React component that shows social proof popups like "Sarah from London just bought this" on your storefront.
  2. useProofEdgeTracking — A React hook that tracks product page views and sends them to your Medusa backend.

Together with the medusa-plugin-proofedge backend plugin, this creates a complete social proof system for your Medusa store.


Quick Start

1. Install

npm install @proofedge/medusa-storefront

2. Add your environment variable

In your storefront .env.local (Next.js) or .env:

NEXT_PUBLIC_PROOFEDGE_SITE_ID=your_site_id_here

Get your Site ID from the ProofEdge dashboard.

3. Add the widget to your layout

This shows purchase notifications across your entire store:

import { ProofEdgeWidget } from "@proofedge/medusa-storefront"

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        {children}
        <ProofEdgeWidget
          siteId={process.env.NEXT_PUBLIC_PROOFEDGE_SITE_ID}
          position="bottom-left"
        />
      </body>
    </html>
  )
}

That's it! You should see social proof popups on your storefront.


Product-Specific Notifications

Want to show "Someone just bought THIS product" on a product page? Pass the productId and use the tracking hook:

import { ProofEdgeWidget, useProofEdgeTracking } from "@proofedge/medusa-storefront"

export default function ProductPage({ product }) {
  // Tracks when someone views this product page
  useProofEdgeTracking(product.id, product.title)

  return (
    <div>
      <h1>{product.title}</h1>
      {/* ... your product details ... */}

      <ProofEdgeWidget
        siteId={process.env.NEXT_PUBLIC_PROOFEDGE_SITE_ID}
        productId={product.id}
        position="bottom-left"
        theme="light"
      />
    </div>
  )
}

For product view tracking, also add this to your .env.local:

NEXT_PUBLIC_MEDUSA_BACKEND_URL=http://localhost:9000

ProofEdgeWidget Props

| Prop | Type | Required | Default | What It Does | |------|------|----------|---------|--------------| | siteId | string | Yes | — | Your ProofEdge Site ID | | productId | string | No | — | Filter notifications to a specific product | | position | string | No | "bottom-left" | Where the popup appears on screen | | theme | string | No | "light" | Color theme of the popup | | onLoad | function | No | — | Callback when the widget script loads |

Position Options

  • "bottom-left" — Bottom left corner (default, recommended)
  • "bottom-right" — Bottom right corner
  • "top-left" — Top left corner
  • "top-right" — Top right corner

Theme Options

  • "light" — White background, dark text (default)
  • "dark" — Dark background, light text
  • "auto" — Matches the user's system preference

useProofEdgeTracking Hook

Tracks product page views. Call it on your product detail page:

useProofEdgeTracking(productId, productTitle, siteId?, options?)

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | productId | string | Yes | The Medusa product ID | | productTitle | string | Yes | The product name | | siteId | string | No | Your Site ID (reads from NEXT_PUBLIC_PROOFEDGE_SITE_ID if not passed) | | options | object | No | { medusaBackendUrl?: string } to override the backend URL |

The hook automatically:

  • Fires once per product page mount (no duplicate tracking)
  • Sends the event to your Medusa backend's /proofedge/track endpoint
  • Fails silently — never blocks or breaks your page

How It Works

1. ProofEdgeWidget loads the ProofEdge script on your page
2. The script connects to ProofEdge and fetches recent purchase events
3. It shows popups like "Sarah from London just bought Premium Widget"
4. useProofEdgeTracking sends product view events through your Medusa backend
5. Your Medusa backend (with medusa-plugin-proofedge) forwards them to ProofEdge

Requirements

  • The backend plugin (medusa-plugin-proofedge) must be installed on your Medusa server for purchase data to flow into ProofEdge.
  • This storefront package handles the display side — showing popups and tracking views.

Full Setup Guide

For a complete setup guide (backend + storefront), see the medusa-plugin-proofedge README.


Troubleshooting

Widget not showing?

  • Check that NEXT_PUBLIC_PROOFEDGE_SITE_ID is set in .env.local
  • Make sure the Site ID matches your ProofEdge dashboard
  • Open browser console and look for [ProofEdge] messages

Product view tracking not working?

  • Add NEXT_PUBLIC_MEDUSA_BACKEND_URL to your .env.local
  • Make sure your Medusa backend is running
  • Make sure "product.viewed" is in your plugin's events config

Need help?


Compatibility

| Requirement | Version | |-------------|---------| | React | 17 or higher | | Next.js | 13 or higher (App Router or Pages Router) | | Node.js | 16 or higher |


License

MIT © ProofEdge