Skip to main content

Resource configuration

Explanation

The resource.toml file is an essential configuration file required for each resource. It should be placed in the main directory of your resource.

This file contains various configuration options specific to your resource, including its type and any dependencies it may have.

Configuration options

KeyTypeDescription
typestringThe serverside type of your resource (the correct module for that type has to be loaded)
client-typestringThe clientside type of your resource (the correct module for that type has to be loaded)
mainstringThe main serverside file that will get loaded when the server starts
client-mainstringThe main clientside file that will get loaded when the client starts
client-filesstring[]The files that the client has access to (The client-main file does not have to be included here)
required-permissionsstring[]The required permissions to play on the server (these have to be accepted, otherwise the player can't join)
optional-permissionsstring[]The optional permissions to play on the server (these permissions can be declined by the user)
depsstring[]The dependencies of this resource (All dependencies get loaded before the resource)
Client or server only resources

If you want to create a resource that is only loaded on the client or server, you can set the type of the other side to none.

Example resource.toml file

type = "js"
client-type = "js"
main = "server.js"
client-main = "client.js"
client-files = [
"myFile.js",
# You can also use glob patterns to give access to a whole directory
"client/*"
]
required-permissions = [
"Screen Capture"
]
optional-permissions = [
"WebRTC"
]
deps = [
"myOtherResource"
]