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.
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.
The calls and their results are the same on all three. Two differences matter:
- On the device
sell,buyandclaimopen 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
pendingright 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
npm create rare-game.SDK referenceEvery call, option, result and error code.Voucher signingThe exact bytes your game key signs, replay rules and key rotation.Check your gamenpx @rare/sdk check and running the game in Rare Launcher.