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

sui-game-sdk

v0.0.2

Published

The ultimate SDK for building games on SUI. Session Keys, Spawning, & Sync.

Downloads

169

Readme

SUI Game SDK

The ultimate SDK for building games on SUI. Includes Session Keys, Asset Spawning, and Game State Synchronization.

Features

1. Session Manager

Eliminate wallet popups during gameplay.

  • Generate ephemeral Ed25519 keys locally
  • Export/Import session state
  • Sign transactions seamlessly

2. Asset Spawner

Simplified API for minting game objects using Move calls.

  • Fluent spawn(recipient, attributes) API
  • Auto-formats vector arguments for attributes

3. Game State Sync

React to on-chain game events in real-time.

  • Poll for specific Move events
  • Subscription-based handler pattern

Installation

npm install sui-game-sdk

Quick Start

import { SessionManager, AssetSpawner, GameStateSync } from 'sui-game-sdk';
import { SuiClient } from '@mysten/sui/client';

const client = new SuiClient({ url: 'https://fullnode.testnet.sui.io' });

// 1. Create Session
const session = new SessionManager(client);
console.log('Session Address:', session.sessionAddress);

// 2. Spawn Asset
const spawner = new AssetSpawner(client, {
    packageId: '0x...',
    module: 'hero',
    function: 'mint_hero',
    adminCapId: '0x...'
});

// 3. Listen to Events
const sync = new GameStateSync(client);
sync.subscribe('0x...::hero::LevelUpEvent', (event) => {
    console.log('Level Up!', event.parsedJson);
});
sync.startPolling('0x...');

Starter Templates

Kickstart your game development with our ready-to-use starter templates:

Generate a Starter

npx sui-game-sdk init

You'll be prompted to choose from:

1. TypeScript (Web/Node)

Full-featured starter with all SDK components. Perfect for web games or backend services.

  • Uses SessionManager, AssetSpawner, GameStateSync
  • Includes sample "Sui Quest" game
  • Move contract included

2. Next.js (Web App)

Modern React web application with beautiful UI.

  • Direct SDK integration
  • Real-time event streaming
  • Tailwind CSS + glassmorphic design
  • Production-ready structure

3. Unity (C# Scripts)

Game engine integration for Unity developers.

  • Simulates SDK patterns in C#
  • HTTP/RPC blockchain communication
  • Organized Assets folder structure
  • Compatible with Unity 2021.3+

4. Godot (GDScript)

Game engine integration for Godot developers.

  • Simulates SDK patterns in GDScript
  • HTTP/RPC blockchain communication
  • Standard Godot 4 project structure
  • Signals for event handling

Starter Features

All starters include:

  • Sample "Sui Quest" game (Mint Hero, Slay Boar, Level Up)
  • Move smart contract (hero.move)
  • Deployment scripts
  • Comprehensive README
  • SDK integration examples

How Starters Use the SDK

  • TypeScript & Next.js: Direct SDK imports (import { SessionManager } from 'sui-game-sdk')
  • Unity & Godot: Simulate SDK concepts using native languages (C#/GDScript)

For detailed SDK usage comparison, see SDK_USAGE.md

Documentation

Example: Building a Simple RPG

import { SessionManager, GameStateSync } from 'sui-game-sdk';
import { Transaction } from '@mysten/sui/transactions';

// Setup
const client = new SuiClient({ url: 'https://fullnode.testnet.sui.io' });
const session = new SessionManager(client);

// Execute game action
const tx = new Transaction();
tx.moveCall({
    target: `${PACKAGE_ID}::hero::slay_boar`,
    arguments: [tx.object(heroId)]
});

const result = await session.executeSessionTx(tx);
console.log('Action completed:', result.digest);

// Listen for results
const sync = new GameStateSync(client);
sync.subscribe(`${PACKAGE_ID}::hero::AttackEvent`, (event) => {
    console.log('Damage dealt:', event.parsedJson.damage_dealt);
});
sync.startPolling(PACKAGE_ID);

Development

# Install dependencies
npm install

# Build
npm run build

# Run tests
npm test

License

MIT