resource.toml
Each resource is a folder under resourcesDir with a resource.toml. This is the canonical field reference for resource.toml (and the sibling stream.toml). For the resource concept and folder layout see Resources; for server.toml keys see server.toml.
The resource.toml parser is quote- and multi-line-array aware (more capable than the server.toml parser). Keys accept both kebab-case and camelCase.
Example
enabled = true
type = "js"
main = "server/main.js"
client-type = "js"
client-main = "client/main.js"
client-files = ["client/**", "shared/**"]
deps = ["shared-core"]
exports = ["getInventory"]
[config]
debug = true
maxInventorySlots = 40Fields
| Key (aliases) | Type | Default | Purpose |
|---|---|---|---|
type | string | "" | Server runtime: js, csharp, go, asset-pack, dlc, rpf. Only js runs server-side. |
main | string | "" | Server entry (e.g. server/main.js). A js resource with a non-empty main auto-starts the server JS host. |
client-type / clientType | string | inherits type (or js) when client-main is set | Runtime for the client entry |
client-main / clientMain | string | "" | Client entry; added to the manifest automatically |
assets-base / assetsBase | string | /assets/<name>/ | HTTP base exposed to resource code |
stream-base / streamBase | string | /stream/<name>/ | HTTP base for files under stream/ |
stream-manifest / streamManifest | string | auto | Path to the stream manifest; auto-detected (see below) |
enabled | bool | true | Load the resource; false skips it |
client-files / clientFiles | string[] | [] | Globs of files sent to the client |
deps / dependencies | string[] | [] | Declared dependency names (published in the manifest) |
exports | string[] | [] | Declared export names |
[config] table | — | {} | Custom scalars exposed via getResourceConfig() |
Notes:
- Type semantics.
typeis stored verbatim; onlyjs(withmain) runs a server host.csharp/godescriptors are preview material and are not executed by the current server binary.asset-pack/dlc/rpfonly serve/stream files. client-typedefault. Ifclient-mainis set butclient-typeis empty, it inheritstype(orjswhentypeis also empty).- Load order & deps. Resources load in the order listed in the
server.tomlresourcesarray (or filesystem order when that list is empty).deps/dependenciesare recorded and published in the manifest, but the current loader does NOT reorder resources by them.
[config] table
Every scalar under [config] becomes a JSON value: true/false and numbers pass through unquoted, everything else becomes a JSON string. The object is exposed to resource code:
const config = varion.getResourceConfig(); // server: this resource's [config]client-files globs
client-files / clientFiles (and stream.toml's files) accept:
| Pattern | Matches |
|---|---|
path/to/file.js | that exact file |
dir/* | regular files directly in dir (one level) |
dir/** | every file under dir (recursive) |
** | every file in the resource folder (recursive) |
Paths containing .. and absolute paths are rejected. Each expanded file is advertised at /resources/files/<resource>/<path>; client-main is expanded and added automatically.
URLs
Client files are served at /resources/files/<resource>/<path>. Two aliases resolve to the same files:
/assets/<resource>/...(default base/assets/<name>/)/stream/<resource>/...(default base/stream/<name>/)
Any file whose resource-relative path begins with stream/ is advertised under /stream/<resource>/... in the manifest, regardless of resource type.
stream.toml
For streamed game files, a resource may carry a stream.toml. It is used as the stream manifest when stream-manifest points to it, when main ends in .toml, or when a stream.toml exists in the resource root (auto-detected).
files = ["stream/**"]
[meta]
"stream/handling.meta" = "HANDLING_FILE"
"stream/vehicles.meta" = "VEHICLE_METADATA_FILE"files— globs (same rules asclient-files) of streamed files.[meta]— maps a resource-relative path to a GTA data-file tag (e.g.HANDLING_FILE). Entries with../absolute paths or an empty tag are dropped.
Every file matched under stream/ gets a /stream/<resource>/... URL. For the client side see Streaming assets.
Declared but not parsed
required-permissions / optional-permissions appear in some resource descriptors and older docs, but the current server binary does not parse them from resource.toml and does not include them in the client manifest. Treat them as reserved.