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

@86d-app/gamification

v0.0.25

Published

Gamified promotions module for 86d commerce platform — spin the wheel, scratch cards, slot machine

Readme

[!WARNING] This project is under active development and is not ready for production use.

Gamification Module

Add interactive games (spin-to-win wheels, scratch-off cards, slot machines) to your storefront with configurable prizes, play-rate limiting, and analytics.

Installation

npm install @86d-app/gamification

Usage

import gamification from "@86d-app/gamification";

const module = gamification({
  defaultGameType: "wheel",
  requireEmail: "true",
  maxPlaysPerDay: "1",
  cooldownMinutes: "1440",
});

Configuration

| Option | Type | Default | Description | |--------|------|---------|-------------| | defaultGameType | string | "wheel" | Default game type (wheel, scratch, slot) | | requireEmail | string | "true" | Require email to play | | maxPlaysPerDay | string | "1" | Max plays per user per day | | cooldownMinutes | string | "1440" | Cooldown between plays in minutes |

Store Endpoints

| Method | Path | Description | |--------|------|-------------| | GET | /gamification/games/:id | Get game details | | POST | /gamification/games/:id/play | Play a game | | GET | /gamification/games/:id/can-play | Check if user can play | | POST | /gamification/plays/:id/redeem | Redeem a won prize |

Admin Endpoints

| Method | Path | Description | |--------|------|-------------| | GET | /admin/gamification/games | List all games | | POST | /admin/gamification/games/create | Create a game | | GET | /admin/gamification/games/:id | Get game details | | POST | /admin/gamification/games/:id/update | Update a game | | POST | /admin/gamification/games/:id/delete | Delete a game | | GET | /admin/gamification/games/:id/prizes | List prizes for a game | | POST | /admin/gamification/games/:id/prizes/add | Add a prize to a game | | POST | /admin/gamification/prizes/:id/update | Update a prize | | POST | /admin/gamification/prizes/:id/delete | Delete a prize | | GET | /admin/gamification/games/:id/plays | Play history for a game | | GET | /admin/gamification/games/:id/stats | Game statistics |

Controller API

interface GamificationController extends ModuleController {
  createGame(params: { name: string; type?: GameType; ... }): Promise<Game>;
  getGame(id: string): Promise<Game | null>;
  updateGame(id: string, params: Partial<Game>): Promise<Game | null>;
  deleteGame(id: string): Promise<boolean>;
  listGames(params?: { type?: GameType; isActive?: boolean; ... }): Promise<Game[]>;
  addPrize(gameId: string, params: { name: string; value: string; probability: number; ... }): Promise<Prize>;
  updatePrize(id: string, params: Partial<Prize>): Promise<Prize | null>;
  removePrize(id: string): Promise<boolean>;
  listPrizes(gameId: string): Promise<Prize[]>;
  play(gameId: string, params: { email?: string; ... }): Promise<Play>;
  redeemPrize(playId: string): Promise<Play | null>;
  getPlayHistory(params?: { gameId?: string; email?: string; ... }): Promise<Play[]>;
  getGameStats(gameId: string): Promise<GameStats>;
  canPlay(gameId: string, params: { email?: string; ... }): Promise<CanPlayResult>;
}

Types

  • GameType"wheel" | "scratch" | "slot"
  • PrizeType"discount-percent" | "discount-fixed" | "free-shipping" | "free-product" | "custom"
  • Game — Game configuration with play limits, date range, and settings
  • Prize — Prize with probability weight, max wins tracking, and optional discount code
  • Play — Play result record (win/lose) with optional prize details
  • GameStats — Aggregate stats with win rate and prize breakdown
  • CanPlayResult — Eligibility check with reason and next available play time

Notes

  • Prize probability uses a cumulative weight system (0-100 scale). If total weights sum to less than 100, some plays result in a loss.
  • Play rate limiting checks email, customerId, or ipAddress -- any single match counts against the limit.
  • Games support optional start/end dates for time-limited campaigns.