Skip to content
⌘K

Build a game

Check your game

Run npx @rare/sdk check to validate a web game's manifest, Content-Security-Policy and controller input, and run the game in Rare Launcher.

rare-sdk check is a static check of a web game for Rare. It takes a live URL or a build folder and exits with status 1 when anything fails, so it works in CI.

Shell
npx @rare/sdk check https://my-game.example
npx @rare/sdk check ./dist
npx @rare/sdk check ./dist --json

In a project made with npm create rare-game, run npm run build && npm run check.

What it checks

AreaPasses whenFails when
PageThe page loads and is https (or localhost).It does not load, answers an error, or is plain http. A missing viewport meta is a warning.
Manifestrare.json at the game's root has a valid slug, a name, an https playUrl, an input mode of keys, gamepad or focus, and well-formed ids and collection types.The file is missing or invalid. An empty id, a missing description or image, and the template's placeholder URL are warnings.
CSPThere is no Content-Security-Policy, or connect-src allows https://rare.market and script-src is not 'none'.connect-src blocks https://rare.market, which the web transport and the API client need.
InputThe code matches the manifest's input mode: key events for keys, getGamepads for gamepad, buttons, links or inputs on the page for focus.The mode has nothing to drive it. See Controller input.
SDKThe scripts use @rare/sdk, rare:platform or Wallet Standard.Never. It is a warning when nothing is found.

The check reads the page and up to 12 same-origin scripts. It does not run the game. A minified bundle is searched as text, so a feature loaded later from a separate chunk can show up as a warning.

The manifest

rare.json sits next to index.html and uses the same field names as the catalog entry, plus the Rare OS profile fields and your item and trophy ids.

rare.json
{
  "slug": "my-game",
  "name": "My Game",
  "description": "A small loot game.",
  "playUrl": "https://my-game.example/",
  "logoUrl": "https://my-game.example/logo.png",
  "bannerUrl": "https://my-game.example/banner.png",
  "input": "keys",
  "classId": "0x...",
  "registryId": "0x...",
  "gameId": "0x..."
}

A Content-Security-Policy that works

If you set a CSP, include https://rare.market in connect-src. Inside Rare Launcher the wallet and the rare:platform calls are injected by the launcher and are not blocked by your CSP. The web transport and the API client are ordinary requests and are.

Text
default-src 'self'; img-src 'self' data: https:; connect-src 'self' https://rare.market

The full run

The static check cannot tell you that the wallet registers or that the pad arrives. For that, run the game in Rare Launcher:

Shell
rare-launcher --dev-game http://localhost:5173

See Testing your game in Rare OS.

--
TPS:--