API Reference
This page is a compact reference for sure_lib version2.2.1.
Module availability
Loader
Validator
Builders
Builders
object(fields), array(itemRule), string(), number(), integer(), boolean(), and callback() create rules.Rule methods
Rule methods
required(message?), message(message), min(value), max(value), between(min, max), oneOf(values), and parse(data).Return and errors
Return and errors
parse(data) returns true when data is valid. It raises Validation Error: ... when data is invalid.Listener
Track
Player
- Data
- State
- Lifecycle
data, inventory, accounts, and loadout read current ESX player data. Inventory and account lists support lookup by name. Loadout supports normalized weapon lookup.Config
Loads and caches a Lua config file. When
schema is supplied, the cached or freshly loaded value is validated before it is returned.Spawn
LUI
- Page
- Builder nodes
- Declarative nodes
lui.page(pageId, pageBuilder, props?), lui.render(pageId), lui.open(pageId, focusOptions?), and lui.close(pageId) manage client NUI pages.Cooldown
- Server
- Client
define(key, definition) registers a cooldown definition with initialDurationMs, durationMs, optional pauseTimerOn, and optional resetAfterZeroTicks.DB
Console command:
sure_lib:db push <schemaName> creates a table from db/<schemaName>.lua; sure_lib:db pull <targetTable> writes a schema file from the current database table.
ESX
All ESX helpers return a boolean.
false means invalid input, missing player, malformed transaction data, or an unknown transaction action.