Getting Started
This guide will help you set up and start using the Argus Labs SDK in your project. The SDK provides a powerful interface for building multiplayer games and real-time applications.Prerequisites
Before you begin, make sure you have:- Scaffolded a boilerplate project (World Engine quickstart)
- Node.js version 22 or higher installed
- A package manager (npm, yarn, pnpm, or bun)
Project Setup
If you don’t have an existing project, you can create one using either Phaser or an empty Vite project. The SDK is flexible and works seamlessly across the spectrum, from simple vanilla JavaScript projects to complex Phaser + React + TypeScript games.Installing the SDK
Install the World SDK using your preferred package manager:Basic Setup
First, set up your SDK instance. Create a new filesrc/lib/sdk.ts (or src/lib/sdk.js for JavaScript projects):
sdk.ts
TypeScript is optional, but highly recommended.
Registering Shard Client
A shard client connects to a specific Cardinal shard. It lets you send commands, query game state, and listen for events from that shard.shard.ts
Sending your first command
With theshard registered, you can now sendCommand to the Cardinal shard.
spawn-player.ts
I got an error.
I got an error.
The example assumes you scaffolded the project using the World CLI, and have the following
command and system on your Cardinal shard:If you need help, please drop by our Telegram channel.
system/player_spawn.go
Making your first query
You’ve now spawned your first player. With that, we canquery the world state and see that the player exists:
player-query.ts
I got an error.
I got an error.
The example assumes you scaffolded the project using the World CLI, and have the following
components in your cardinal:If you need help, please drop by our Telegram channel.
component/playertag.go
component/position.go
Congratulations! You’ve now set up your first World Engine game client using the Argus Labs SDK
and learned the basics of Shard Client, Command, and Query.