> ## 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.

# Manifest, scopes, and game packages

> manifest.json fields, scope requests and review, the game package format, and runtime restrictions

## manifest.json

```json theme={null}
{
  "schema": 1,
  "id": "doudizhu",
  "name": "Dou Dizhu",
  "icon": "img/logo.jpg",
  "version": "0.1.0",
  "build": 1,
  "entry": "index.html",
  "orientation": "landscape",
  "statusBar": "hidden",
  "deferSystemGestures": true,
  "background": "#0d4433",
  "sdk": ">=1.0 <2",
  "minClient": { "ios": "2.0.1", "android": "3.8.0" },
  "scopes": ["game.identity", "game.realtime", "game.energy.read", "game.energy.stake", "game.share", "game.haptics", "game.audio"],
  "realtime": { "service": "card", "ruleset": "doudizhu@1" },
  "audio": { "preload": ["audio/deal.wav", "audio/click.wav"], "bgm": "audio/bgm.wav" },
  "network": { "connect": [], "img": [] },
  "players": { "min": 3, "max": 3 },
  "ageRating": "18+"
}
```

| Field | Description |
| - | - |
| `schema` | Always `1` |
| `id` | Game identifier. Must match the app's identifier on the forum |
| `name`, `icon` | Name and icon. The icon appears in the app directory, on the detail page, and on the app loading screen |
| `version` | In the form `1.4.2` |
| `build` | Integer. Each upload must be greater than every build registered for the game, including revoked ones |
| `entry` | Entry page, `index.html` by default. Must be an HTML file in the package |
| `orientation` | `portrait`, `landscape`, or `auto` (default) |
| `statusBar`, `deferSystemGestures`, `background` | Status bar, deferring system gestures in landscape, and loading screen background color |
| `sdk` | Required SDK version range |
| `minClient` | Minimum app version. Only `ios` and `android` are allowed |
| `scopes` | Requested scopes, see below |
| `realtime` | Ruleset for multiplayer matches, see [Real-time matches](https://docs.nodeloc.com/en/minigames/realtime.md) |
| `audio` | Sound effects and background music to preload |
| `network.connect` | Additional addresses the game may connect to. Only `wss://` or `https://` |
| `players` | Player count range |

## Scopes

| Scope | Use |
| - | - |
| `game.identity` | Nickname, avatar, and anonymous per-game ID |
| `game.realtime` | Connect to the game service |
| `game.energy.read` | Read the game energy balance and history; open the claim and withdraw panels |
| `game.energy.stake` | Stake tables and ticket tables; includes read |
| `game.energy.pay` | In-game payments; includes read |
| `game.share` | Sharing and invites |
| `game.haptics`, `game.audio` | Haptics and audio |
| `game.storage` | Cloud saves (reserved, not yet available) |

`scopes` lists the requested scopes. Only the scopes staff approve after review (`approved_scopes`) take effect, and methods without an approved scope return `SCOPE_DENIED`. The authorization notice users see when they first open the game also lists the approved scopes. Request only the scopes you use. Game energy scopes get stricter review, and the game must be rated 18+.

## Game packages

A game package (`.nlgame`) is a zip file with `manifest.json` and the entry page at the root. On upload the platform checks that:

* It is at most 20 MB compressed, at most 100 MB uncompressed, and has at most 2,000 files.
* Paths are relative paths inside the package only: no `..`, absolute paths, backslashes, or symbolic links, and no files whose names differ only in case.
* The compression method is store or deflate only. File types are limited to an allowlist of web pages, scripts, images, audio and video, fonts, wasm, and similar.
* `__MACOSX/` and `.DS_Store` are removed. Any existing `_signature/` in the package is discarded.

When the checks pass, the platform generates `_signature/files.json` (the SHA-256 of every file) and signs it with the platform private key. The app verifies the signature after download and does not run packages that fail verification.

## Runtime restrictions

The game page has a strict CSP:

* `script-src 'self' 'wasm-unsafe-eval'`: no inline scripts, no `eval` or `new Function`, and no scripts loaded from outside.
* `connect-src` covers only the game itself, the game service, the forum's `/api/v1/games/`, and the addresses in `network.connect`.
* Images can come from the game itself, `data:`, `blob:`, the forum, and the forum's storage domain (user avatars).
* No embedded iframes or objects, and no form submission.

The static scan on upload blocks external scripts (`<script src="http…">`, `import("http…")`, and so on). `eval` / `new Function` with non-literal arguments and direct access to `webkit.messageHandlers` or `nlBridge` produce warnings. Engines that rely on `new Function` (such as PixiJS) need a patch; the Dou Dizhu example has a ready-made one in `vendor/`.


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