Skip to content
⌘K

Build a game

Rare SDK

What @rare/sdk does, how a game reaches Rare on the device and off it, and where to start.

@rare/sdk lets a game sell, buy and claim Sui items without carrying a Sui SDK. It has two halves.

HalfImportRuns inWhat it does
Client@rare/sdkThe game: a web page, or a native game with a JavaScript hostme, inventory, sell, buy, claim, open, licence and notices. Rare opens the sheets and does the chain work.
Server@rare/sdk/serverYour game server (Node 22 or later)Signs vouchers with your game key, verifies them, and reads ownership from the API.

The package is ESM and CommonJS, fully typed, tree-shakeable and has no dependencies in the client half. The server half needs @mysten/sui as a peer dependency.

Pre-release. @rare/sdk and create-rare-game are not on npm yet, and the item contract they claim against (rare_items) is not published. Everything on these pages is tested against a mock of the Rare Local API.

One set of calls, three transports

Rare.connect looks for the best way to reach Rare, in this order.

Transportrare.transportWhereHow it talks
Launcher, web gamelauncher-webA web game running in Rare LauncherThe rare:platform feature of the injected Rare Wallet
Launcher, native gamelauncher-nativeA native or Proton game started by Rare LauncherThe Rare Local API on 127.0.0.1, found through the RARE_API, RARE_TOKEN and RARE_GAME environment variables
WebwebAnywhere else: a browser, a Steam or Epic build, a phonerare.market in the system browser, plus the public API

The calls and their results are the same on all three. Two differences matter:

  • On the device sell, buy and claim open Rare's own sheet over your game and answer when the player is done.
  • On the web transport the sheet is a rare.market page. Those calls answer pending right after the page opens, and the real result arrives as a notice.

A game can never move anything by itself. Every action goes through the player's own review and PIN.

Where to go next

--
TPS:--