The ioGame TypeScript SDK (iohao-sdk) at version 21.0.1 provides a non-blocking client interface for interacting with ioGame game servers over WebSocket and Protobuf. It offers two API styles: callback-based and async/await, plus broadcast listening and error handling. Key differentiators include code generation support that reduces boilerplate and enforces type safety, making server-client integration more like local method calls. The SDK is TypeScript-first with bundled types, and supports Cocos Creator, Vue, and plain HTML/TS projects. It is actively maintained by ioGame team with regular releases.
npm install iohao-sdkNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to configure the SDK, connect via WebSocket, send requests using both callback and async/await styles, and listen for broadcasts.
Ensure the server is an ioGame instance with WebSocket support.
Use import { ioGameSetting } from 'iohao-sdk';Chain methods correctly: RequestCommand.ofString(...).onCallback(...).execute();