@everymatrix/prize-engine-suite

中文文档
0.9.57发布于 2026/11/12ESM + CJS零依赖近 30 天下载 7035

Overview ### Meet the Prize Engine Suite The Prize Engine Suite is a cutting-edge collection of modular web components designed to provide a complete, unified, and highly customizable gamification experience. Whether you are implementing a **Lucky Whee

原始使用文档
文档目录12 节
  1. Overview
  2. Meet the Prize Engine Suite
  3. Why the Prize Engine Suite?
  4. A Progressive & Scalable Suite
  5. Pre-requisites
  6. Setup the widget on your website
  7. Usage
  8. Full Example
  9. API Reference
  10. Styling
  11. Translations
  12. Core Events

Prize Engine Suite Widget

Overview

Meet the Prize Engine Suite

The Prize Engine Suite is a cutting-edge collection of modular web components designed to provide a complete, unified, and highly customizable gamification experience. Whether you are implementing a Lucky Wheel, a Coin Flip, or Mystery Chests, the Suite handles everything from discovery to the final reward claim.

Why the Prize Engine Suite?

Previously, different game types required separate integrations and containers. The Prize Engine Suite changes this by offering:

  • Unified Architecture: One integration to support all "Draw-and-Reward" game types.
  • Modular Design: Components for Listing, History, and Game Details work together seamlessly but can be used independently if needed.
  • Plug-and-Play: Adding a new gamified experience to your product is now as simple as changing a single type attribute.

A Progressive & Scalable Suite

The Suite is built to grow with your product. Start with a simple implementation using default themes, and scale up to a fully customized, branded experience using our robust set of tools for player sessions, custom styling, and dynamic translations.


Pre-requisites

For the Widget to function, the parent website must be integrated with the EveryMatrix platform. Supported integrations:

  • CE new WebAPI Integration
  • UBS Integration

For further information, please contact your assigned Integration Manager.


Setup the widget on your website

To install the latest version of the Prize Engine Suite, add the following script tag to the root page of your application (either in <head> or at the end of <body>).

<script src="https://unpkg.com/@everymatrix/prize-engine-suite/es2015/prize-engine-suite.js" type="module"></script>

Usage

Add the <prize-engine-suite> tag to your page. Use the type attribute to specify which gamification engine to load.

<prize-engine-suite
  endpoint="https://your-wofapi-endpoint.everymatrix.com"
  session="your-player-session-token"
  lang="en"
  type="wheelOfFortune"
/>

Full Example

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Prize Engine Suite Demo</title>
    <script src="https://unpkg.com/@everymatrix/prize-engine-suite/es2015/prize-engine-suite.js" type="module"></script>
  </head>
  <body>
    <prize-engine-suite
      endpoint="https://demo-wofapi-stage.everymatrix.com"
      session="your-session-token"
      lang="en"
      type="flipCoin"
    />
  </body>
</html>

API Reference

ParameterMandatoryDefaultComment
endpointYes-NorWAy endpoint for Prize Engine API
sessionYes-The session token of the player
langYes'en'Language of the widget (en, zh, etc.)
typeNo'wheelOfFortune'Game type: wheelOfFortune, flipCoin, or mysteryChest
isdrawerNo'true'If 'true', the widget renders as a fixed bottom drawer
openedNo'false'If 'true', the drawer opens automatically on load
clientstylingNo-CSS string to override widget styles
clientstylingurlNo-URL to a CSS file for style injection
translationurlNo-URL to a JSON file for custom translations
luckywheelsizeNo324Diameter of the wheel on desktop (px)
luckywheelmobilesizeNo240Diameter of the wheel on mobile (px)

Styling

Our web components support dynamic styling through two attributes: clientstyling and clientstylingurl.

Example:

<prize-engine-suite
  clientstyling=".HeaderTitle { color: gold; }"
  clientstylingurl="https://cdn.yourbrand.com/widget-theme.css">
</prize-engine-suite>

Translations

The Suite supports dynamic translations via the translationurl attribute. The JSON file should provide overrides for the following core keys:

{
  "en": {
    "Play": "Play",
    "History": "History",
    "Rules": "Rules",
    "LuckyWheels": "Lucky Wheels",
    "CoinRoyale": "Coin Royale",
    "MysteryChest": "Mystery Chest",
    "RemainingTimes": "Remaining Times",
    "Spin": "Spin",
    "Flip": "Flip",
    "OpenChest": "Open Chest",
    "Congratulation": "Congratulations!",
    "Success": "You won a {prize}!",
    "NoContent": "No games available at the moment",
    "NoHistories": "No histories",
    "InfoTooltipLuckywheel": "Spin a lucky wheel and take a chance to win!",
    "InfoTooltipCoin": "Flip a virtual coin and take a chance to win!",
    "InfoTooltipChest": "Open Mystery Chest and find your reward!"
  }
}

Core Events

The widget communicates with the parent site using window.postMessage:

Event TypeDescription
OpenPrizeGameTriggered when a player selects a game from the list
ClosePrizeEngineDrawerTriggered when the drawer is closed
PrizeGameSpinEndTriggered when a draw animation completes and result is shown

版本与发布记录

@everymatrix/prize-engine-suite 共发布 244 个版本,首次发布于 2026/04/03;过去 12 个月发布了 244 个版本。

版本发布日期距今
0.9.57latest2026/11/121 天前
0.9.562026/11/121 天前
0.9.552026/11/122 天前
0.9.542026/11/112 天前
0.9.532026/11/112 天前
0.9.522026/11/112 天前

关于 @everymatrix/prize-engine-suite 的常见问题

@everymatrix/prize-engine-suite 是什么?

Overview ### Meet the Prize Engine Suite The Prize Engine Suite is a cutting-edge collection of modular web components designed to provide a complete, unified, and highly customizable gamification experience. Whether you are implementing a **Lucky Whee

如何安装 @everymatrix/prize-engine-suite?

在项目目录运行 npm install @everymatrix/prize-engine-suite,或使用 pnpm add / yarn add / bun add。

@everymatrix/prize-engine-suite 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/everymatrix__prize-engine-suite 是否存在。

@everymatrix/prize-engine-suite 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@everymatrix/prize-engine-suite 可以商用吗?

@everymatrix/prize-engine-suite 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@everymatrix/prize-engine-suite 的下载量有多少?

根据 npm 官方下载统计,@everymatrix/prize-engine-suite 在 2026/10/14 – 2026/11/12 这 30 天内被下载 7,035 次,日均约 235 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@everymatrix/prize-engine-suite 还在维护吗?

最新版本 0.9.57 发布于 2026/11/12(1 天前);至今共发布 244 个版本,其中过去 12 个月发布了 244 个;首次发布于 2026/04/03。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。