'shared' as the last argument to read as a client would.
Exports
IsFlagEnabled
IsFlagEnabled
Checks whether a boolean flag is on.Parameters
- key:
string— The flag’s key - fallback:
boolean— Returned when the flag is not a readable boolean flag (optional,falseby default) - runtime:
'server'|'shared'— The runtime reading the flag (optional,'server'by default)
- enabled:
boolean— Whether the flag is on
GetFlagValue
GetFlagValue
Reads a flag’s value, whatever its type.Parameters
- key:
string— The flag’s key - fallback:
any— Returned when the flag is missing or unreadable (optional) - runtime:
'server'|'shared'— The runtime reading the flag (optional,'server'by default)
- value:
any— The flag’s value, or the fallback
GetFlag
GetFlag
Reads a flag whole — its key, type, value and runtime.Parameters
- key:
string— The flag’s key - runtime:
'server'|'shared'— The runtime reading the flag (optional,'server'by default)
- flag:
table?— A table withkey,type,valueandruntime, ornilif the flag does not exist or this runtime may not read it
GetFlags
GetFlags
Reads every flag this runtime may see, keyed by flag key.Parameters
- runtime:
'server'|'shared'— The runtime reading the flags (optional,'server'by default)
- values:
table— The flag values, keyed by flag key
GetCachedFlags
GetCachedFlags
Reads the values held right now, without contacting the API.Parameters
- runtime:
'server'|'shared'— The runtime reading the flags (optional,'server'by default)
- values:
table— The flag values held in memory, keyed by flag key
Unlike the other server reads, this one returns immediately rather than a
promise. It is for callers that cannot wait — what it returns is whatever the
last fetch or the stored cache left behind.
RefreshFlags
RefreshFlags
Refetches the flags now, ignoring both the cache window and the polling schedule.Returns
- values:
table— The flags the server now holds, server-only ones included
- If the API request fails, or if feature flags are disabled in the configuration.
AreFlagsReady
AreFlagsReady
Whether there are values to read.Returns
- ready:
boolean
AreFlagsStale
AreFlagsStale
Whether the values being served came from the last-known cache rather than from a fetch.Returns
- stale:
boolean
Events
nocloud.flags.updated
Fired locally on the server when a fetch finds a change. Values never cross the network as an event — this is a server-side listener, so it sees the whole snapshot including server-only flags.- values:
table— Every flag the server holds, keyed by flag key - changes:
table[]— What differs from the previous snapshot
A runtime flip counts as a change as much as a value does — it decides whether players still see the flag at all.
Lua Library
For a cleaner API, include the server Lua library in yourfxmanifest.lua:
Cloud.flags autocompletes with parameter and return types in any editor with the Lua Language Server.
