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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kyakaze/shopify-hydrogen-2

v2.0.1

Published

This module helps integrate Judge.me Widgets to Hydrogen V2 storefront app. Currently, it works mostly on the client side. Review data will be fetched from Judge.me CDN To see support for Hydrogen V1, please visit https://www.npmjs.com/package/@judgeme/sh

Downloads

14

Readme

Hydrogen x Judge.me Widgets

This module helps integrate Judge.me Widgets to Hydrogen V2 storefront app. Currently, it works mostly on the client side. Review data will be fetched from Judge.me CDN To see support for Hydrogen V1, please visit https://www.npmjs.com/package/@judgeme/shopify-hydrogen

Known issues

  • Widgets will flash (disappear and reappear swiftly) because of the way Hydrogen2 renders components. We will release a react version for the widgets in the future.
  • Widgets may appear twice (depends on your delay config)

Getting Started

Installation:

  • Install module: npm i @judgeme/shopify-hydrogen-2
  • Edit content and rename .env.development.example to .env:
JUDGEME_SHOP_DOMAIN="your shop domain registered with Judge.me"
JUDGEME_PUBLIC_TOKEN="judge.me public token"
JUDGEME_CDN_HOST="https://cdn.judge.me"

Usage guide:

  • Code below is taken from the Hydrogen V2 sample storefront.

A. Setup:

  • In your root.jsx file, loader function, add Judge.me configuration in the defer return E.g:
  return defer({
    // ... other properties
    judgeme: {
      shopDomain: context.env.JUDGEME_SHOP_DOMAIN,
      publicToken: context.env.JUDGEME_PUBLIC_TOKEN,
      cdnHost: context.env.JUDGEME_CDN_HOST,
      delay: 500, // optional parameter, default to 500ms
    },
  });
  • In function App(), import and register judgeme module with credentials above
import {useJudgeme} from '@kyakaze/shopify-hydrogen-2'
//...

export default function App() {
  const data = useLoaderData();
  useJudgeme(data.judgeme);
  // ... rest of your script
}

B. Widgets:

Below is the list of our widget components:

import {
  JudgemeMedals,
  JudgemeCarousel,
  JudgemeReviewsTab,
  JudgemePreviewBadge,
  JudgemeReviewWidget,
  JudgemeVerifiedBadge,
  JudgemeAllReviewsCount,
  JudgemeAllReviewsRating,
} from "@judgeme/shopify-hydrogen-2";

These following widgets require param id

  • Components: JudgemeReviewWidget, JudgemePreviewBadge and JudgemeVerifiedBadge
  • Required props: product id, it could be either shopify graph ID or simply ID: gid://shopify/Product/12345678, 12345678.
  • example:
    <JudgemeVerifiedBadge id={product.id}/>

Other widgets

  <JudgemeAllReviewsCount />

References

Hydrogen is a React framework and SDK that you can use to build fast and dynamic Shopify custom storefronts.

Check out the docs