Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sure-developer.com/llms.txt

Use this file to discover all available pages before exploring further.

Overview

sure_lib is a focused Lua 5.4 helper library for FiveM resources that use ox_lib and es_extended. It is designed around lazy module loading: a consuming resource imports one shared loader, then requests the module it needs through sure.getModule(moduleName).

Shared

validator, listener, track, and config run on both client and server.

Client

player, spawn, lui, and client cooldown handle local runtime work.

Server

db, esx, and server cooldown apply authoritative gameplay changes.

Module catalog

ModuleSidePurpose
validatorSharedRuntime schema validation for objects, arrays, primitives, callbacks, ranges, and enums.
listenerSharedLocal and network event listeners with validator-backed argument checks.
trackSharedSmall reactive state primitive with dependency-based effects.
configSharedCached Lua config loading with optional validator schemas.
playerClientDynamic ESX player shortcuts, including inventory, accounts, loadout, ped, vehicle, and coords.
spawnClientPed/object spawning, streaming on proximity, and scoped cleanup.
luiClientLua-driven NUI rendering with builder and declarative node APIs.
cooldownClient and serverSynchronized position-keyed cooldown state with optional pause and reset behavior.
dbServeroxmysql-backed model helpers plus schema push/pull console commands.
esxServerSafe transaction helpers for items and account money.
sure_lib does not load every module eagerly. Side-specific modules return nil when requested from the wrong runtime, which helps keep client/server boundaries clear.

Repository shape

fxmanifest.lua
init.lua
shared
init.lua
modules
validator
index.lua
client
server

How data moves

Use sure_lib when you want small runtime helpers without hiding the underlying FiveM and ESX concepts.

Getting Started

Install sure_lib and load your first module

Module Loader

How sure.getModule resolves shared, client, and server modules