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

gameos-wof-widget

v0.1.5

Published

GameOS Wheel of Luck widget

Readme

GameOS Wheel of Fortune Widget

Usage:

Install gameos-wof-widget

npm install gameos-wof-widget

In your root file add import

import { applyPolyfills, defineCustomElements } from 'gameos-wof-widget/loader';

In that file apply polyfills that you imported before

applyPolyfills().then(() => {
  defineCustomElements(window);
});

Then you can use the gos-wheel-of-fortune tag where you need it.

Attributes:

  • token: String: Ready-to-use long-life token.

To get token and to be aware if current player have available WoF, you should make an API request GET /wof/available/{player_id}/ and token in headers.

headers: {
 "Authorization": "Bearer cCjIkGfFfPbbBkSI0agLIed0oeiikk"
}

Response example:

[
  {
    name: 'Binding',
    token:
      'eyJhbGciOiJIUz351iIsInR5cCI6IkpXVCJ9.eyJ3b2Zfc2VjX2lkIjoiMjI3ZmJjMzQtZTkzNS00ODdjLTlhOTItNWRhYzYzYjZhZTE1IiwijxkydG5lcl9pZCI6IlNreVNvZnRUZWNoIiwiZXhwaXJhdGlvbl9kYXRlIjoiMjAyMy0xMS0wMyAxMTo0Mjo0Ny43ODA2MjkrMDA6MDAifQ.MqlpORCdBrJz4WnTtTLIHI2cbVKGKTXkfX_YMSJgZF8',
    type: 'Single',
  },
];

Example of usage in React:

  1. Assume that you already have a button that will open the WoF widget and you should manage the state of WoF visibility. In React you can do it by using useState hook:
const [isWidgetOpen, setIsWidgetOpen] = useState(false);
  1. You need to create a function to handle on button click.
const onWidgetButtonClick = () => {
  setIsWidgetOpen(true);
};
  1. Add a check in your code to show or hide WoF dependence of isWidgetOpen state.
{
  isWidgetOpen ? (
    <gos-wheel-of-fortune token="eyJhbGciOiJIUz351iIsInR5cCI6IkpXVCJ9.eyJ3b2Zfc2VjX2lkIjoiMjI3ZmJjMzQtZTkzNS00ODdjLTlhOTItNWRhYzYzYjZhZTE1IiwijxkydG5lcl9pZCI6IlNreVNvZnRUZWNoIiwiZXhwaXJhdGlvbl9kYXRlIjoiMjAyMy0xMS0wMyAxMTo0Mjo0Ny43ODA2MjkrMDA6MDAifQ.MqlpORCdBrJz4WnTtTLIHI2cbVKGKTXkfX_YMSJgZF8"></gos-wheel-of-fortune>
  ) : null;
}
  1. When a player clicks on “Close” button you will receive the event “closeModal”. You can handle it in useEffect hook.
useEffect(() => {
  document.body.addEventListener('closeModal', () => {
    setIsWidgetOpen(false);
  });
  return () => {
    document.body.removeEventListener('closeModal', () => {
      setIsWidgetOpen(false);
    });
  };
}, []);

After the player claims the reward in the WoF widget, you will receive reward_id and player_id in the API provided as part of the integration process. In case of receiving error from the API call you will receive the event closeModal.