Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@milkywaygaming/rgs-player-sdk

Latest version: v0.1.0-alpha.78

Overview

Last scanned
28 Nov 2026
Published
28 Nov 2026
npm package Publisher: milkyway-gaming
48 Versions
8.8K Downloads

Scan summary

@milkywaygaming/rgs-player-sdk was last scanned on 28 Nov 2026 at version 0.1.0-alpha.78. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 48 versions; the latest 5 were published within 2 days (27 and 28 Nov 2026).
  • Findings: No rules fired in version 0.1.0-alpha.78.
  • Downloads: 8,778 downloads.

Versions

48 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.1.0-alpha.78 LATEST 28 Nov 2026 No rules fired
0.1.0-alpha.77 28 Nov 2026 No rules fired
0.1.0-alpha.76 27 Nov 2026 No rules fired
0.1.0-alpha.75 27 Nov 2026 Not shown
0.1.0-alpha.74 27 Nov 2026 Not shown

No rules fired in 0.1.0-alpha.78

Findings

Findings for v0.1.0-alpha.78. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.1.0-alpha.78; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@milkywaygaming/rgs-player-sdk

The player SDK for Milkyway Gaming games in a casino's own frontend: framework-free TypeScript, ESM with type declarations, and two dependencies: SignalR's client (@microsoft/signalr), loaded only when the hub first connects, and FingerprintJS (@fingerprintjs/fingerprintjs, MIT), loaded only for the device report once a session is ready. A React or Next.js app builds its game UI on it. It passes two things: the API origin Milkyway Gaming gives the casino (https://player.<domain>), and the session's token, which the casino's backend gets from the launch and hands to its frontend. The SDK does the rest:

  • the player API over the platform's player hub (createHubPlayerApi: one WebSocket per session, a fresh connect ticket on every connect and reconnect, pushed balances), behind the PlayerApi port, with typed errors (PlayerApiError, whose message is a stable code, never server text);
  • the balance: the game asks the casino's wallet for the balance at most once every 30 seconds, and never because of a bet (BALANCE_READ_MIN_INTERVAL_MS). A bet or a win shows the balance the casino's answer, or its pushed event, carries, and the newest by asOf wins;
  • the game session (createGameSession): a browser client seed on every active pair, kept across launches when this browser set it, bets with replay-safe retries under one idempotency key, reveal checks, and verify links (buildVerifyLink); the game state the hub pushes as it connects (the settings, the balance, the player's earlier bets), with older bets and their verify links on request; and bets that stay open across the player's moves (placeOpenBet, placeOpenFreespin, act), resumed from the game state;
  • round replays: a settled round shared as a public link (session.createShareLink), and a shared round read with no session at all (loadReplay), with no amount and no currency when the share hides them, and each item's price either way;
  • amount text that is never parsed into a float (amountFromInput, addAmounts, compareAmounts, multiplyAmount), shown exactly in one standard format, 1,234.56, in every language (formatAmount); multipliers in the same format at two decimals (formatMultiplier); and plain numbers and percentages (formatNumber, formatPercent);
  • a table game's payout tables, read from the session's settings and never worked out (findPaytable, paysAt, chanceAt), and their chances at two decimals (formatChance).

readLaunch and siteOrigins serve Milkyway Gaming's own play pages, which read the token from their launch URL and derive the API origin from their host; a casino's app doesn't use them. So do readReplayLaunch and createReplaySession: a play page opened from a replay link (#replay=<code>) shows the round in replay mode, with no session, and refuses every bet, move, rotation and share with replay_mode.

Importing it touches no browser global, so any module of a Next.js app may import it. But Next.js renders client components ('use client') on the server too, and a session must start in the browser: its client seed is the player's, made in the page, never on the casino's server. So create and start the session in useEffect or an event handler, never during render; or load the game component with next/dynamic and { ssr: false }. A session on systemRuntime started where there is no window ends at once with browser_required and sends nothing. The client seed needs crypto.subtle, which a browser offers only on HTTPS.

A game in your page

A React or Next.js component for Dice, whole. Another game's has its own engineId, paramOrder, paramKinds and params, from that game's page.

'use client';

import { useEffect, useState, useSyncExternalStore } from 'react';
import { createGameSession, createHubPlayerApi, type GameSession, systemRuntime } from '@milkywaygaming/rgs-player-sdk';

// Milkyway Gaming gives the casino these two origins.
const API_ORIGIN = 'https://player.example-rgs.com';
const VERIFY_ORIGIN = 'https://verify.example-rgs.com';

export function DiceGame({ token }: { readonly token: string }) {
  const [session, setSession] = useState<GameSession | null>(null);

  useEffect(() => {
    // In the browser only: the hub connection and the client seed are made here, never during render.
    const api = createHubPlayerApi({ apiOrigin: API_ORIGIN, token });
    const game = createGameSession({ api, engineId: 'dice', paramOrder: ['Target', 'Over'], paramKinds: { Target: 'integer', Over: 'boolean' }, verifyOrigin: VERIFY_ORIGIN, runtime: systemRuntime });
    setSession(game);
    void game.start().then(() => game.gameShown()); // never rejects: the snapshot says how it went
    return () => {
      game.dispose();
      void api.close();
    };
  }, [token]);

  return session === null ? <p>Loading…</p> : <DiceTable session={session} />;
}

function DiceTable({ session }: { readonly session: GameSession }) {
  const snapshot = useSyncExternalStore(session.subscribe, session.getSnapshot, session.getSnapshot);
  if (snapshot.status === 'starting') return <p>Starting…</p>;
  // 'closed' comes with every end: nothing comes back by itself (endedCode says why).
  if (snapshot.connection === 'closed') return <p>Session closed. Reopen the game. ({snapshot.endedCode})</p>;
  // 'reconnecting': the SDK reconnects by itself; stop betting until it is back.
  const reconnecting = snapshot.connection === 'reconnecting';
  // The stakes a bet is checked against, in the session's currency: never constants of your own (null until known).
  const stake = snapshot.settings?.minStake ?? null;

  const roll = async () => {
    if (stake === null) return;
    // Amounts are strings at the currency's scale; never numbers.
    const outcome = await session.placeBet({ items: [{ itemId: 'main', stake }], params: { Target: 5000, Over: true } });
    if (outcome.kind === 'refused') console.warn(outcome.code, outcome.reason, outcome.roundId);
    // 'unresolved': the SDK couldn't confirm the bet; offer session.resolvePendingBet().
  };

  return (
    <div>
      {reconnecting && <p role="status">Connection lost. Reconnecting…</p>}
      <p>Balance: {snapshot.balance === null ? '—' : session.formatAmount(snapshot.balance.amount)}</p>
      <button type="button" onClick={() => void roll()} disabled={stake === null || reconnecting || snapshot.busy !== null || snapshot.pending !== null}>
        Roll over 50.00
      </button>
      {snapshot.pending !== null && (
        <button type="button" onClick={() => void session.resolvePendingBet()} disabled={reconnecting}>
          Check bet
        </button>
      )}
      <ul>
        {snapshot.bets.map(({ bet, verifyLink }) => (
          <li key={bet.betId}>
            {session.formatAmount(bet.stake)} paid {session.formatAmount(bet.payout)} {verifyLink !== null && <a href={verifyLink}>Verify</a>}
          </li>
        ))}
      </ul>
    </div>
  );
}
  • start() never rejects. It resolves once status is 'ready' or 'ended' (endedCode says why), and also once you call dispose(), which stops it at once: check status after it, never that it resolved.
  • start() has no time limit during a network fault. While the platform can't be reached (network_error, request_timeout, gateway_error, service_unavailable) status stays 'starting' and connection reads 'reconnecting', for as long as it takes. Give it a wait of your own (30 s, say), then show your message with a Try again button that calls dispose() and the adapter's close() and creates both again with the same token.
  • A connection the hub closes with rate_limited and a wait is waited out, at start as later: a connection past its address's connection limit is closed with retryAfterSeconds (10). So is a connect ticket refused rate_limited with a Retry-After. connection reads 'reconnecting' meanwhile, nothing connects and no ticket is asked for before the wait is over (a wake doesn't make it sooner), and the session then connects anew by itself. It never ends the session. A ticket refused rate_limited with no Retry-After still ends a start with rate_limited.
A Home button

snapshot.session.returnUrl is the address your launch gave for going back, such as your lobby, or null when it gave none. Offer the button only with one, and only navigate with it, on the player's press:

'use client';

import { useSyncExternalStore } from 'react';
import type { GameSession } from '@milkywaygaming/rgs-player-sdk';

/** Goes back to the casino: the top window, or the game's own window where the browser refuses the top one. */
function goHome(returnUrl: string): void {
  try {
    (window.top ?? window).location.href = returnUrl;
  } catch (error) {
    // The browser refused the top window (a sandboxed frame): leave from the frame.
    if ((error as { name?: unknown } | null)?.name !== 'SecurityError') throw error;
    window.location.href = returnUrl;
  }
}

export function HomeButton({ session }: { readonly session: GameSession }) {
  const snapshot = useSyncExternalStore(session.subscribe, session.getSnapshot, session.getSnapshot);
  const returnUrl = snapshot.session?.returnUrl ?? null;
  if (returnUrl === null) return null;
  return (
    <button type="button" onClick={() => goHome(returnUrl)}>
      Home
    </button>
  );
}
A crash round's betting

A page bets on a crash round (createGameSession({ ..., mode: 'crash' })) while snapshot.crash.phase is 'betting' and snapshot.crash.closing isn't true. Closing comes between the two: the window has closed, the round waits for the debits still on their way, and it starts as soon as they are answered. Show "Starting…" then, with the bet buttons off: a bet placed in it is refused round_closed, and a cancel round_started.

const { crash } = session.getSnapshot();
const open = crash?.phase === 'betting' && crash.closing !== true; // null: a platform that doesn't say
const starting = crash?.phase === 'betting' && crash.closing === true;
A crash bet after a reload

A reload, a new tab or another device launches the game again: a new session, which never placed the player's bets on the running round. The game state lists them, and snapshot.crash.bets shows them beside this page's own, each bet once, so the player can still cash a running bet out. Show them as any bet of the page's, and offer Cash out (session.cashOut(bet.id)) for a 'placed' bet that stakes main while the round runs: a bet of only red, green or moon has nothing to cash out (nothing_to_cash_out). A bet the state lists cashed out shows cashedOutAt and cashOutPayout; one of a voided round shows in that round; a lost one stays 'placed', and its record says how it ended. A cancel takes a bet out of play, 'cancelled', whichever of the player's pages cancelled it, this page's own bets included, and a cancelled bet never comes back; a bet still being placed that is cancelled first ends bet_cancelled. A bet the state doesn't list is never dropped. A reconnect can bring a later round: a bet of an earlier round is never cashable (cashOut refuses it, sending nothing), so compare its roundId with the room's. Such a bet's accepted has no balanceAfterDebit or asOf, and its variant may be null (RebuiltCrashBet). Never place a bet again because it is listed. A platform that doesn't list them, and a demo session, leave the bets as they are.

const { crash } = session.getSnapshot();
const running = crash?.phase === 'running';
const cashable = (crash?.bets ?? []).filter(
  (bet) => running && bet.roundId === crash?.round?.roundId && bet.state === 'placed' && bet.items.some((item) => item.itemId === 'main'),
);

What it keeps on the device

Seed pairs are per game: every game has its own, a title included, and another game's bets, rotations and open rounds never change them. A session start reads the player's pairs in the session's game. When the active pair is one this browser set, in an earlier launch of the game or another tab, the session keeps it: nothing is rotated, and the pair's nonce counter goes on. Otherwise it rotates once with a fresh browser client seed: the first time the player opens a game (its new pair carries a client seed the platform chose), on a new device, after cleared browser data, on a pair another device set, and after the platform's own rotation at the nonce cap. A player's own rotation is remembered too.

To know which pairs it set, the session keeps a short list in SdkRuntime.storage, under the one key rgs.seed-pairs.v1: each pair's id, its commitment and the client seed it sent, newest first by when this browser set it, at most 10 for every player and game on the device. Once 10 newer pairs have been set there, the game whose pair was set longest ago rotates once more at its next launch, however recently it was played, and nothing else changes. A pair it sees leave the active slot is forgotten, and so is one a read shows as the next pair, or one that fails the nonce counter check or shows its commitment under another id. A pair from the list that the platform shows as active with another commitment or client seed ends the session with fairness_check_failed. Nothing in it is secret: those three are on every bet the player sees. The launch token is never stored.

systemRuntime's storage is the browser's localStorage, for that key, the player settings' browser copy (rgs.settings.v1.all and rgs.settings.v1.game.<gameId>, "Player settings", below) and one more per game only: any other key reads as nothing and is never written, so nothing else reaches the device through it. Where localStorage is missing, blocked (a sandboxed frame, storage switched off) or full, the list lives in memory for the page's life, and each launch rotates as on a new device. A write that fails removes the key from localStorage, so a later launch never reads a list that still holds a pair the page saw revealed.

The one more key is a game's intro opt-out, rgs.intro-optout.v1.<gameId>: a slot intro's "Don't show again", which the game keeps through the runtime's storage rather than localStorage itself, so a casino's own storage (scoped to its player, below) keeps it too. It is the older way: the session now keeps the choice as the player setting intro.opt-out, and reads this key as that setting while the game's browser copy lacks it.

  • Its value is "1", or the key is absent. Set "1" when the player opts out and remove the key to show the intro again. Any other value is never written, and one another script left there reads as null.
  • <gameId> is the game's ID as the platform writes it (snapshot.session.gameId, a title's own ID for a title): lower-case letters, digits and single hyphens, at most 63 characters. A key with anything else after rgs.intro-optout.v1. (a capital, a dot, a space, a slash, an accented letter) is refused, never encoded: it reads as null and is never written.
  • Like the list, it lives in memory for the page's life where localStorage is missing, blocked or full: the intro then shows again at the next launch.
import { INTRO_OPT_OUT_VALUE, introOptOutKey } from '@milkywaygaming/rgs-player-sdk';

const key = introOptOutKey(gameId); // null for a game ID the storage would refuse
if (key !== null) {
  const optedOut = runtime.storage?.getItem(key) === INTRO_OPT_OUT_VALUE;
  runtime.storage?.setItem(key, INTRO_OPT_OUT_VALUE); // "Don't show again" ticked
  runtime.storage?.removeItem(key); // and unticked
}

To keep it elsewhere, pass a runtime with a storage of your own (KeyValueStorage): an object with getItem(key), setItem(key, value) and removeItem(key), as Web Storage has. When a write that forgets a pair fails, the session removes the whole list with removeItem, which only costs rotations. Only a storage that refuses that too can keep a pair the session saw revealed.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @milkywaygaming/rgs-player-sdk

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Frame 2085668439 (1)
Group 1261154229