Skip to main content

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:

Project Setup

If you’re looking for a fully functioning example, you can scaffold a full-fledged demo game.
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 file src/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 the shard registered, you can now sendCommand to the Cardinal shard.
spawn-player.ts
The example assumes you scaffolded the project using the World CLI, and have the following command and system on your Cardinal shard:
system/player_spawn.go
If you need help, please drop by our Telegram channel.

Making your first query

You’ve now spawned your first player. With that, we can query the world state and see that the player exists:
player-query.ts
The example assumes you scaffolded the project using the World CLI, and have the following components in your cardinal:
component/playertag.go
component/position.go
If you need help, please drop by our Telegram channel.
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.

Next Step

To build a complete multiplayer experience, you’ll want to set up authentication using Argus Auth. World Engine integrates seamlessly with Argus Auth to handle user authentication and identity management, making it easy to create personalized gaming experiences for your players.

Argus Auth

Learn how to integrate Argus Auth into your game