Skip to main content
The SDK is configured via the config.json file located in the root of your nocloud resource folder. The default configuration is preconfigured with secure defaults and sensible limits—you can adjust these values to fit your needs.
The $schema property enables autocomplete and validation in editors like VS Code.

Logging

boolean
default:"true"
Enable or disable logging output.
string
default:"info"
The minimum log level to output.

Storage

boolean
default:"true"
Whether clients can trigger uploads from their game client or nui.
number
default:"50"
Maximum allowed file size in megabytes. Files exceeding this limit will be rejected.
string[]
An array of MIME types permitted for upload. Any file type not in this list will be rejected.

Rate Limiting

Per-client rate limiting prevents abuse by restricting how many uploads each client can make within a time window.
boolean
default:"true"
Enable or disable rate limiting.
number
default:"60000"
The time window in milliseconds for rate limit tracking.
number
default:"10"
Maximum number of upload requests allowed per client within the time window.
string
default:"ip:license"
Defines how clients are uniquely identified for rate limiting. This is a colon-separated list of identifiers.
Examples:
  • ip:license — Combines IP and license (default)
  • license — License only
  • ip:license:steam — Multiple identifiers

Feature Flags

Settings for the feature flags module. The defaults fetch nothing until a flag is read, so a server that never reads one costs a single request in its life.
boolean
default:"true"
Whether feature flags are available at all. With this off every read falls back and nothing is fetched.
integer
default:"10"
How long a fetched configuration is served from memory before a read goes back to the API, in seconds. Minimum 1.
This window bounds the polling loop too — a poll landing inside it skips its turn rather than spending a request to be told nothing changed.
string
default:"nocloud_flags"
The GlobalState key the shared flag values are published under, which is how clients read them. Must match ^[A-Za-z_][A-Za-z0-9_]*$.
Server-only flags are never included in the state bag. Changing this key changes what your client scripts and AddStateBagChangeHandler calls must watch.
boolean
default:"true"
Whether the last received flags are kept in resource key/value storage, so they are served immediately on the next start and while the API is unreachable.
The cache holds server-only values and stays on the server host. Turn it off if you would rather a restart fetched from scratch than served a snapshot.

Polling

boolean
default:"false"
Whether the flags are refetched whether or not a client is reading them.
Off by default, in which case polling runs only while at least one client is reading. Turn it on when something watches rather than reads — an AddStateBagChangeHandler on the state bag, or a nocloud.flags.updated handler — since a change nobody reads is a change nothing would otherwise go and find.
integer
default:"60000"
How often the flags are refetched while polling runs, in milliseconds. Values below 10000 are raised to 10000.
A tick landing inside cache_ttl_seconds skips, so that window is the real floor. The API advises polling no faster than every 20 seconds and the SDK logs a warning once if your interval is shorter.

Example

config.json