# The manifest

> Each field of a RPG Desk plugin's manifest, what it accepts and what the verifier checks.

Page: https://docs.rpgdesk.com/en/referencia/manifesto/

The manifest tells RPG Desk what the plugin is. It goes:

- **in a single `.html` file**, inside the `<head>`: `<script type="application/rpgdesk+json" id="rpgdesk-manifest">{ … }</script>`;
- **in a `.zip` package**, in the `manifest.json` file, at the root.

It is JSON: double quotes, no comments and no comma after the last item. The JSON Schema, for your editor’s help, is at `https://docs.rpgdesk.com/_sdk/1/manifest.schema.json` (use it in `"$schema"`).

## Example

```json
{
  "rpgdesk": 1,
  "id": "com.yourname.system",
  "name": { "pt": "Meu Sistema", "en": "My System" },
  "version": "1.2.0",
  "author": "Your name",
  "description": "My System's sheet and NPC table.",
  "sdk": 1,
  "icon": "icon.svg",
  "sheets": [
    { "type": "com.yourname.system.sheet", "title": "Character", "entry": "sheet.html", "private": { "gm": "gm" } }
  ],
  "tables": [
    { "type": "com.yourname.system.npcs", "title": "NPCs", "entry": "npcs.html" }
  ],
  "webhooks": [
    { "name": "rolls", "description": "Every roll from the sheet", "example": { "total": 17 } }
  ]
}
```

## The fields

| Field         | Required       | What it is                                                                                                                                                        |
| ------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `rpgdesk`     | yes            | the manifest format’s version: `1`                                                                                                                                |
| `id`          | yes            | the plugin’s identifier: lowercase letters, numbers, `.`, `-` and `_`, starting with a letter or number (up to 120). Use a reversed domain: `com.yourname.system` |
| `name`        | yes            | the plugin’s name (up to 120), as one text or per language (see below)                                                                                            |
| `version`     | yes            | major.minor.patch, like `1.0.0`. Bump it with each change                                                                                                         |
| `sdk`         | yes            | rpgdesk.js’s major version: `1`                                                                                                                                   |
| `author`      | no             | who made it (up to 120)                                                                                                                                           |
| `description` | no             | what the plugin brings (up to 1000). It shows up when installing and in the plugin list                                                                           |
| `sheets`      | one of the two | the sheets (see below)                                                                                                                                            |
| `tables`      | one of the two | the room tables (see below)                                                                                                                                       |
| `webhooks`    | no             | the webhooks the plugin uses (see below)                                                                                                                          |
| `icon`        | no             | a `.png` or `.svg` from the package                                                                                                                               |
| `$schema`     | no             | the JSON Schema’s address, for the editor                                                                                                                         |

A field RPG Desk does not know triggers a warning, and is ignored.

## Sheets and tables

`sheets` and `tables` are lists. Each item:

| Field     | What it is                                                                                                                                                                                       |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `type`    | the sheet or table’s data type: it starts with the plugin’s `id` and a period (`com.yourname.system.sheet`), with the same characters as the `id` (up to 120). Do not change it after publishing |
| `title`   | the name shown in **New sheet…** or on the table’s tab (up to 120), as one text or per language                                                                                                  |
| `entry`   | **packages only:** the sheet or table’s HTML, inside the package (`sheet.html`). In a single file, the entry is the file itself                                                                  |
| `private` | **sheets only:** the private parts, `{ "path": "gm" \| "owner" }`. See [Private parts](https://docs.rpgdesk.com/en/fichas/partes-privadas/)                                                      |

- The plugin needs at least one sheet or table, and has at most 20.
- A single `.html` file brings **one** sheet or **one** table.
- Each `type` appears once.

## Webhooks

`webhooks` is a list (up to 20). Each item:

| Field         | What it is                                                                                                        |
| ------------- | ----------------------------------------------------------------------------------------------------------------- |
| `name`        | the name the page uses in `RPGDesk.webhooks.send(name, data)`: lowercase letters, numbers, `-` and `_` (up to 40) |
| `description` | what the webhook sends, for the game master (up to 300)                                                           |
| `example`     | optional: a sample of the data, up to 4 KB as JSON                                                                |

See [Webhooks on the sheet](https://docs.rpgdesk.com/en/fichas/webhooks/).

## Texts in two languages

`name` and `title` accept one text per language:

```json
"name": { "pt": "Ficha Básica do RPG Desk", "en": "RPG Desk Basic Sheet" }
```

Each person sees the one in their RPG Desk language; without theirs, Portuguese is used, then English, then the first one. The keys are language codes: `pt`, `en`, `pt-BR`.

> **Note**
>
> The `description` and the page’s texts have no per-language version in the manifest: to translate the page, use the context’s `language`. See [JavaScript on the sheet](https://docs.rpgdesk.com/en/fichas/javascript/#a-sheet-in-two-languages).
