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

@sagegames/react

v2.3.0

Published

React web SDK for SageGames: playable game screens, launcher and leaderboards

Readme

@sagegames/react

Verified mini-games for React web apps: Quiz Master, Memory Match, Sudoku Arena, Word Search and Word Rush, plus live battles for 2 to 16 players. The app never reports a score. It sends the player's moves, and the SageGames server replays them to compute the score.

  • Plain DOM (CSS grid, pointer events, keyboard play for Sudoku). No react-native-web.
  • React 18/19.
  • The same API as @sagegames/react-native.

Full documentation: https://<api-host>/portal/docs, also as plain Markdown at /portal/docs/llms.txt. The source is at github.com/AnalytixTech/sage-game-platform.

Install

npm install @sagegames/react

Use

Your backend creates a session with your API key (POST /v2/sessions) and returns it to the browser. The API key never goes into the page.

import { allGames, createTheme, GameLauncher, SageGameProvider } from '@sagegames/react';

const theme = createTheme({ brand: '#7c3aed', mode: 'light' });

export function Play({ gameId, onDone }: { gameId: string; onDone: () => void }) {
  return (
    <SageGameProvider games={allGames} baseUrl="https://sage-game-platform.onrender.com" theme={theme} pendingStore={window.localStorage}>
      <GameLauncher
        getSession={() => fetch('/api/games/session', { method: 'POST', body: JSON.stringify({ gameId }) }).then((r) => r.json())}
        onComplete={(result) => console.log('verified', result.score, result.rank)}
        onClose={onDone}
      />
    </SageGameProvider>
  );
}

GameLauncher runs the whole flow: intro, the game, a review of the finished board, the verified result and the leaderboard. It handles pause, quit, retries and "Play again". MatchLauncher runs a battle: lobby, countdown, live race and standings.

Provider props

| Prop | | | --- | --- | | games | Usually allGames. Pass a subset, or replace a game's View. | | baseUrl | The SageGames API origin. | | theme, themeOverrides | A preset (arcadeTheme, darkNavyTheme, lightTheme, minimalTheme), createTheme({ brand }), or a partial theme, plus deep overrides. | | labels | Reword or translate any string (defaultLabels lists them). | | feedback | Haptics and sounds, e.g. webVibrationFeedback(). | | reduceMotion | Force motion off or on. By default it follows prefers-reduced-motion. | | components, slotStyles | Replace parts (Button, IntroCard, ResultHero, LeaderboardRow, Countdown, WordDefinition) or add CSS to them. | | pendingStore | window.localStorage: unsent results survive a reload. | | onWordDefinition | ({ gameId, word }) => void when a player opens a Word Search definition. |

GameLauncher props

getSession (preferred) or session, onComplete, onError, onEvent, onClose, autoStart, showLeaderboard, showCountdown, hideChrome, reviewBeforeResult, className, style, and the render overrides renderHeader, renderIntro, renderReview, renderResult, renderSubmitting and renderError. Each override receives the default element, so you can wrap it instead of rebuilding it.

Theming and slots

<SageGameProvider
  theme={createTheme({ brand: '#0ea5e9', mode: 'dark', radius: 'round' })}
  slotStyles={{ button: { borderRadius: 999 }, review: { paddingTop: 8 } }}
  components={{ Button: MyButton, WordDefinition: MyDefinitionDialog }}
  …
/>

Slot style names: button, card, chip, header, intro, resultHero, leaderboardRow, lobbyRow, countdown, gameBoard, review, wordDefinition. For custom game views, the hooks (useQuiz, useMemoryBoard, useSudoku, useWordSearch, useWordRush) and the ui building blocks are exported too.

New in 2.3

  • Review before the result. When a game ends, the finished board stays on screen with the score, the time, a key stat and Continue, while the score is verified in the background. It's on by default. Use reviewBeforeResult={false} for the 2.2 flow, and renderReview to customise it. MatchLauncher takes both props too.
  • Word Search definitions. Click a found word, in the grid or in the list, to see its definition and note in an accessible dialog (focus is trapped, and Escape closes it). Replace the dialog with the WordDefinition slot.

See CHANGELOG.md (also shipped in this package) for every release.