Skip to content

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

toml
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 = 40

Fields

Key (aliases)TypeDefaultPurpose
typestring""Server runtime: js, csharp, go, asset-pack, dlc, rpf. Only js runs server-side.
mainstring""Server entry (e.g. server/main.js). A js resource with a non-empty main auto-starts the server JS host.
client-type / clientTypestringinherits type (or js) when client-main is setRuntime for the client entry
client-main / clientMainstring""Client entry; added to the manifest automatically
assets-base / assetsBasestring/assets/<name>/HTTP base exposed to resource code
stream-base / streamBasestring/stream/<name>/HTTP base for files under stream/
stream-manifest / streamManifeststringautoPath to the stream manifest; auto-detected (see below)
enabledbooltrueLoad the resource; false skips it
client-files / clientFilesstring[][]Globs of files sent to the client
deps / dependenciesstring[][]Declared dependency names (published in the manifest)
exportsstring[][]Declared export names
[config] table{}Custom scalars exposed via getResourceConfig()

Notes:

  • Type semantics. type is stored verbatim; only js (with main) runs a server host. csharp/go descriptors are preview material and are not executed by the current server binary. asset-pack/dlc/rpf only serve/stream files.
  • client-type default. If client-main is set but client-type is empty, it inherits type (or js when type is also empty).
  • Load order & deps. Resources load in the order listed in the server.tomlresources array (or filesystem order when that list is empty). deps / dependencies are 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:

js
const config = varion.getResourceConfig();   // server: this resource's [config]

client-files globs

client-files / clientFiles (and stream.toml's files) accept:

PatternMatches
path/to/file.jsthat 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).

toml
files = ["stream/**"]

[meta]
"stream/handling.meta" = "HANDLING_FILE"
"stream/vehicles.meta" = "VEHICLE_METADATA_FILE"
  • files — globs (same rules as client-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.

Varion Multiplayer Platform