> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opengame.io/llms.txt
> Use this file to discover all available pages before exploring further.

# What is OpenGame

> OpenGame hosts browser games. Deploy with the CLI or your coding agent, add players, leaderboards and invite links with the SDK, and share one link to play.

OpenGame is where you host a browser game and where players find it. You deploy your game's web build with the OpenGame CLI, from your terminal or through your coding agent. OpenGame serves each game from its own address under opengame.gg, and people play it from its page on opengame.io, in the browser, with nothing to install.

## What OpenGame gives a game

* **Hosting.** Each deploy makes a release with a private preview that only your account can play. Players keep the live release while you deploy the next one, and you can [make an earlier release live again](https://docs.opengame.io/reference/cli.md#opengame-rollback).
* **A CLI and skills for coding agents.** `opengame` builds, checks and uploads your game, and when a check fails it says what it saw, where, and the smallest fix. `opengame setup` installs the OpenGame skills for Claude Code, Codex, Cursor and OpenCode, and the CLI keeps them current.
* **The SDK.** `@opengamehq/sdk` tells your game who is playing, and gives it leaderboards, achievements, events, the player's OG character and OG Radio.
* **Multiplayer.** Bring your own game servers, or connect players peer to peer, from any engine. Invite links open your game on OpenGame and put a friend in your lobby.
* **Discovery.** A published game gets a page on opengame.io and a place in the games gallery, where players find it, play it and share it.
* **Analytics.** Players, plays and playtime for each game you own, week by week, from `opengame stats` or the [analytics API](https://docs.opengame.io/api-reference/analytics.md).
* **Any engine with a web export.** [Three.js](https://docs.opengame.io/engines/threejs.md), [Unity](https://docs.opengame.io/engines/unity.md), [Godot](https://docs.opengame.io/engines/godot.md), [Kaigen](https://docs.opengame.io/engines/kaigen.md), [any JavaScript engine](https://docs.opengame.io/engines/javascript.md), and [WebAssembly](https://docs.opengame.io/engines/webassembly.md) from C, C++, Rust, Zig or Go.

## How do I deploy a game to OpenGame?

Install the CLI, sign in with `opengame login`, and run `opengame deploy .` in your game's folder. The CLI builds the game, checks it and uploads it, then gives you the address of its private preview.

```bash theme={"system"}
npm i -g @opengamehq/cli
opengame setup
```

The [quickstart](https://docs.opengame.io/quickstart.md) walks through it, starter games included.

## How do I use OpenGame with a coding agent?

Run `opengame setup` after installing the CLI to give your agents the OpenGame skills, or `opengame skills add .` in your game's folder to commit them with the game, then ask your agent to deploy it. [For agents](https://docs.opengame.io/for-agents.md) is the procedure it follows, and the [CLI reference](https://docs.opengame.io/reference/cli.md) lists every command and JSON event it reads.

## How do I use the OpenGame SDK?

Add the SDK to your game.

```bash theme={"system"}
npm i @opengamehq/sdk
```

Then start it, and report ready once the player can play:

```js theme={"system"}
import { og } from "@opengamehq/sdk";

await og.init();
og.ready();
```

`og.player` then holds the player's per-game ID, handle and sign-in state. [Connect the SDK](https://docs.opengame.io/guides/identity.md) covers the rest, and the [SDK reference](https://docs.opengame.io/reference/sdk.md) lists every export.

## How do I add multiplayer?

Bring your own game servers. OpenGame runs none, and your game can connect to any server a browser can reach, in any engine: your own server in Node, Go or Rust, Colyseus, Nakama, Photon or a hosted fleet over WebSocket (`wss://`), WebTransport or HTTPS, or other players' browsers peer to peer over WebRTC. A browser cannot open raw UDP or TCP sockets, so Unity, Godot and Unreal web builds use their WebSocket or WebRTC transports.

OpenGame adds the invite link. Share the game's OpenGame page with the lobby code in it: `og.invite.link(code)` makes that link, and `og.invite.code` gives the code to the friend who opens it. Kaigen has multiplayer built in and doesn't read `og.invite.code` yet, so a Kaigen game's players join through Kaigen Online: see [Kaigen](https://docs.opengame.io/engines/kaigen.md#multiplayer). Set `players` in `opengame.json` so the game page shows "2–8 players · private lobbies" or "2–16 players · online". [Multiplayer](https://docs.opengame.io/guides/multiplayer.md) covers each engine, your server's settings and how to identify players.

## How do I update a live game?

Run `opengame deploy .` again from the same folder. Players keep the live release until the new one goes live. [Update a live game](https://docs.opengame.io/guides/updating.md) covers linking a fresh checkout and deploying from CI.

## Where next

> [card] [Quickstart](https://docs.opengame.io/quickstart.md)
>
> Install the CLI and deploy your first private preview.

> [card] [Engines](https://docs.opengame.io/engines/overview.md)
>
> Export settings and SDK setup for each engine.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.