SDK Integrations
This guide will be updated as the Playtron SDK and additional tooling become available. Check back regularly for the latest recommendations and implementation details.
Your integration options depend on the environments you expect your users to interact with your game. The Playtron GameOS SDK handles on-device integration, including wallet access, OS-level features, and environment detection. The Sui dApp Kit handles off-device integration for web, desktop, and mobile contexts. Use one or both depending on where your game runs.
What SDKs are available for SuiPlay0X1 integration?
Two SDKs support SuiPlay0X1 integration:
- Playtron GameOS SDK: For games running directly on the SuiPlay0X1 device. Provides OS-level features and automatic Playtron wallet access.
- Sui dApp Kit: For games running on web, desktop, or mobile. Enables Playtron zkLogin wallet as a connection option in off-device contexts.
On device integration
For on-device game integration, you need the Playtron GameOS SDK. The SDK provides access to OS-level features, such as environment detection, remote PACT attestation, virtual keyboard and browser utilities, and Sui wallet integration.
The Playtron GameOS SDK repository contains the installation and initialization steps to begin development. The repository also contains examples on how to use the SDK in C++, C#, and Node.js environments. The .dll build files needed to compile the C++ code are provided. For the C# and Node.js examples, you can install the necessary dependencies from the respective package manager.
The Playtron GameOS SDK provides automatic wallet access with the following benefits:
- Users already have a Playtron wallet through their Playtron account.
- No additional wallet setup required on-device.
- Games can immediately access wallet functions through the SDK.
On-device example: detect environment and access wallet (Node.js)
The Node.js SDK ships as the @playtron/sdk package and requires Node.js 18 or later on GameOS Beta 1.1 or later.
npm install @playtron/sdk
Detect the environment with the OS class. OS.isPlaytron() returns true when the game runs on GameOS.
node/examples/src/is-playtron.ts. You probably need to run `pnpm prebuild` and restart the site.Read the wallet with the Sui class. Sui.getWalletAddress() returns the address of the user's Playtron wallet without any additional setup.
node/examples/src/sui-address.ts. You probably need to run `pnpm prebuild` and restart the site.The Sui class also exposes signMessage(), signTransaction(), and signAndExecuteTransaction() for transaction flows. Refer to the Playtron GameOS Node.js SDK reference for the full API, and to the examples directory for the rest of the Node.js examples and their C++ and C# equivalents.
Off-device integration
For off-device integration, use the Sui dApp Kit. By integrating the Sui dApp Kit, your game can continue to use the Playtron zkLogin wallet when not running directly on the SuiPlay0X1 device. This is useful if your game is available on the web, desktop, or mobile devices.
The Sui dApp Kit documentation site (linked in the previous paragraph), provides the installation instructions for the SDK. With the SDK integrated into your gaming project, you can enable Playtron zkLogin wallet as a connection option.
The dApp Kit runs in TypeScript, meaning your game needs TypeScript processing to integrate with this SDK. If your game is a web-based game, or you navigate users to a browser to perform Web3 transactions on your associated website, this should not be an issue.
If you're unable to run TypeScript, you can always support sending assets from your wallet to the Playtron wallet. Users can also access their Playtron wallet address through the companion web application. Finally, you can support sending assets from your game on a different platform. For example, the user can use your PC client to transfer assets to their Playtron wallet, then continue playing on-device.
Off-device example: add wallet connection with Sui dApp Kit
Install the React package and the Sui TypeScript SDK. Use @mysten/dapp-kit-core instead if your game front end runs on Vue, Svelte, or vanilla JavaScript.
npm install @mysten/dapp-kit-react @mysten/sui
@mysten/dapp-kit without a suffix is the deprecated 1.x package. Older tutorials that wrap your app in SuiClientProvider and WalletProvider target that version. New games should use @mysten/dapp-kit-react.
Create a single dApp Kit instance for your game. The declare module block is what gives the hooks their types, so do not omit it:
packages/dapp-kit/examples/react/simple/src/dApp-kit.ts. You probably need to run `pnpm prebuild` and restart the site.That example defaults to Testnet and enables the burner wallet in development builds. Set defaultNetwork to mainnet and drop enableBurnerWallet for a production game.
Wrap your game's UI in DAppKitProvider, then render the ConnectButton component from @mysten/dapp-kit-react/ui anywhere inside it:
packages/dapp-kit/examples/react/simple/src/main.tsx. You probably need to run `pnpm prebuild` and restart the site.packages/dapp-kit/examples/react/simple/src/App.tsx. You probably need to run `pnpm prebuild` and restart the site.ConnectButton lists the wallets that dApp Kit detects. That covers every wallet the user's browser registers through the Wallet Standard, plus any wallet your game adds through the walletInitializers option on createDAppKit. A wallet that is not a browser extension, such as the Playtron zkLogin wallet, needs that explicit registration before it appears in the list. Refer to the Sui dApp Kit documentation for setup details, and to Playtron for the registration values their wallet requires.
Supported wallet types
- Playtron wallet: Seamless continuation from on-device sessions.
- Self-custody options: Support for any wallet available through the Sui dApp Kit (such as Slush wallet, Backpack) to include future wallet integrations.
How do I choose between on-device and off-device integration?
Your choice depends on where your game runs and what wallet experience you want to provide users.
| Scenario | Recommended integration |
|---|---|
| Game runs only on SuiPlay0X1 | Playtron GameOS SDK |
| Game runs on web, desktop, or mobile | Sui dApp Kit |
| Game runs on SuiPlay0X1 and other platforms | Both SDKs |
| No TypeScript support in your game engine | Playtron GameOS SDK on-device; manual asset transfer off-device |
If your game targets multiple platforms, integrate both SDKs and use environment detection to switch between them at runtime.