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

# Mini games overview

> How NodeLoc mini games run, what they are made of, and how to build one

A mini game is a web game package. It runs in the native game container of the NodeLoc app and in desktop browsers. The game calls only the `nl.*` methods of the JS SDK, and the host provides identity, game energy, sharing, audio, and haptics. Rules for multiplayer matches run on the server in the game service.

> [!NOTE]
>
> Mini games and [in-post apps](https://docs.nodeloc.com/en/miniprogram/introduction.md) are separate systems. In-post app code runs in a server-side sandbox and is embedded in posts. A mini game is a full-screen front-end package with its own signature, scopes, and game energy wallet. Mini games are rolling out gradually; check site announcements for availability.

## Hosts

| Host | How it runs | Identity and game energy |
| - | - | - |
| iOS / Android app | The native container downloads the game package, verifies the platform signature, and loads it locally | Native bridge. Sign-in, deposits, and payments are confirmed in native panels |
| Desktop browser | Web version: `https://games.nodeloc.com/play/{slug}/{build}/`, on a different origin from the forum | Forum authorization (PKCE). Deposits and payments are confirmed in forum pop-ups |

The same package runs in both hosts. The SDK detects the host automatically, and methods the host does not support return `NOT_SUPPORTED`.

## Components

| Component | Purpose |
| - | - |
| Game package (`.nlgame`) | Web files plus `manifest.json`, signed by the platform on upload |
| JS SDK `@nodeloc/game-sdk` | The only interface between the game and the host |
| Game energy wallet | A balance deposited 1:1 from community energy and used only in games. Double-entry bookkeeping, reconciled daily |
| Game service | WebSocket service for matchmaking, rooms, autoplay, spectating, and stake settlement |
| Ruleset | Match rules that run on the server. The client only sends actions and receives views |

## Where to start

* Single-player, front-end-only games: start from the Tap Tap template in the [Quickstart](https://docs.nodeloc.com/en/minigames/quickstart.md). You only need the SDK.
* Real-time multiplayer matches: the client connects to the [game service](https://docs.nodeloc.com/en/minigames/realtime.md), and the rules are written as a [ruleset](https://docs.nodeloc.com/en/minigames/rulesets.md). The reference implementation is Dou Dizhu.
* Games that use game energy: read [Game energy and payments](https://docs.nodeloc.com/en/minigames/energy.md). A game can only make requests, and the user confirms each one in a host panel.

## Pages

* [Quickstart](https://docs.nodeloc.com/en/minigames/quickstart.md)
* [SDK reference](https://docs.nodeloc.com/en/minigames/sdk.md)
* [Manifest, scopes, and game packages](https://docs.nodeloc.com/en/minigames/manifest.md)
* [Game energy and payments](https://docs.nodeloc.com/en/minigames/energy.md)
* [Real-time matches](https://docs.nodeloc.com/en/minigames/realtime.md)
* [Rulesets](https://docs.nodeloc.com/en/minigames/rulesets.md)
* [Local development and publishing](https://docs.nodeloc.com/en/minigames/publishing.md)


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