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

@grooveshop/recommendations-widget

v1.0.0

Published

Plug-and-play recommendation widget for any website

Readme

🚀 GrooveShop Recommendations Widget

Plug-and-play AI-powered product recommendations for any website. No framework required!

Features

  • Zero dependencies - Pure TypeScript/JavaScript
  • Universal - Works with WordPress, Shopify, plain HTML, React, Vue, etc.
  • 3 layouts - Carousel, Grid, List
  • Smart auto-detection - Automatically finds product IDs
  • Event tracking - Built-in analytics
  • Responsive - Mobile-first design
  • Themeable - CSS custom properties
  • TypeScript - Full type safety

Quick Start

1. Add Script Tag

<script src="https://cdn.grooveshop.com/widget/v1/widget.umd.js"
        data-api-key="YOUR_API_KEY"
        data-tenant-id="your-store"></script>

2. Add Widget

<!-- Similar products carousel -->
<div data-grooveshop-recommendations
     data-product-id="123"
     data-count="5"
     data-layout="carousel"></div>

That's it! ✨

Layouts

Carousel

<div data-grooveshop-recommendations
     data-product-id="123"
     data-layout="carousel"
     data-count="8"></div>

Grid

<div data-grooveshop-recommendations
     data-product-id="123"
     data-layout="grid"
     data-count="6"></div>

List

<div data-grooveshop-recommendations
     data-product-id="123"
     data-layout="list"
     data-count="4"></div>

Recommendation Types

Similar Products (default)

<div data-grooveshop-recommendations
     data-product-id="123"
     data-type="similar"></div>

Trending Products

<div data-grooveshop-recommendations
     data-type="trending"
     data-count="10"></div>

Auto Mode (Smart)

<!-- Automatically detects product ID and context -->
<div data-grooveshop-recommendations
     data-type="auto"></div>

Configuration

Script Tag Options

| Attribute | Required | Default | Description | |-----------|----------|---------|-------------| | data-api-key | ✅ Yes | - | Your API key | | data-tenant-id | ✅ Yes | - | Your store ID | | data-api-url | ❌ No | https://api.grooveshop.com | API endpoint | | data-auto-track | ❌ No | true | Auto-track events | | data-debug | ❌ No | false | Console logging |

Widget Attributes

| Attribute | Required | Default | Description | |-----------|----------|---------|-------------| | data-product-id | ⚠️ Conditional | - | Source product ID (required for similar) | | data-count | ❌ No | 5 | Number of products | | data-layout | ❌ No | grid | Layout: carousel, grid, or list | | data-type | ❌ No | similar | Type: similar, trending, or auto | | data-theme | ❌ No | light | Theme: light, dark, or minimal |

Customization

CSS Custom Properties

:root {
  --gs-primary-color: #007bff;
  --gs-primary-hover: #0056b3;
  --gs-border-radius: 8px;
  --gs-font-family: 'Your Font', sans-serif;
}

Override Styles

.gs-card {
  border: 2px solid #007bff;
}

.gs-card-title {
  font-size: 18px;
  color: #333;
}

Development

Prerequisites

  • Node.js 18+
  • npm or yarn

Setup

cd widget
npm install

Development Server

npm run dev

Opens at http://localhost:3001 with hot reload.

Build

npm run build

Creates:

  • dist/widget.umd.js - UMD bundle for browsers
  • dist/widget.es.js - ES module
  • dist/widget.css - Styles
  • dist/index.d.ts - TypeScript definitions

Preview Build

npm run preview

Architecture

widget/
├── src/
│   ├── index.ts              # Main entry point
│   ├── config.ts             # Configuration loader
│   ├── api.ts                # API client
│   ├── types.ts              # TypeScript types
│   ├── widgets/
│   │   ├── carousel.ts       # Carousel renderer
│   │   ├── grid.ts           # Grid renderer
│   │   └── list.ts           # List renderer
│   ├── templates/
│   │   └── card.ts           # Product card template
│   └── styles/
│       └── base.css          # Widget styles
├── dist/                     # Build output
├── index.html                # Demo page
├── vite.config.ts            # Vite configuration
├── tsconfig.json             # TypeScript config
└── package.json

Browser Support

  • Chrome (last 2 versions)
  • Firefox (last 2 versions)
  • Safari (last 2 versions)
  • Edge (last 2 versions)

License

MIT

Support