Installation
Install tLib, depend on it from your own resource, and optionally open its port for browser access.
Download
Take the latest release from GitHub Releases. A source checkout is not enough — only the release carries the built NUI page and server bundle. To work from source, see Building from source in the repository README.
Extract
Put the tLib folder in your server's resources directory.
Start the resource
Add this to server.cfg, above every resource that depends on tLib:
ensure tLibOpening the port, if you want browser access
Optional, and nothing needs it. Every tLib resource is fully working at this point: tRadio runs over the connection players already have, tDB serves its database, and all of it is reached in game. No port is involved in any of that.
What the port adds is the hub — one page linking every tLib resource that has a web surface, so you can reach them from a browser instead of from inside the game. Today that is tDB's admin panel and tRadio's dispatch panel, which a desktop app can also connect to. Leave the port closed and those surfaces are simply not reachable from a browser; the resources behind them are unaffected.
If you want it: open 7777/tcp on the machine — the host firewall, plus NAT
port-forwarding if the server is behind a router — then visit http://<your-server-ip>:7777.
For a different port, set it above ensure tLib and open that one instead:
set tlib_http_port 8080Depend on tLib
dependencies { 'tLib' }
shared_scripts {
'@tLib/imports.lua', -- only if you use the import modules
}Exports need the dependency line alone:
exports['tLib']:ShowToast(nil, 'success', 'tLib is running', 'Installed correctly.')The menu is declared, not built imperatively — pages on the server, handlers on the client. See Exports and Menu Consumers.
The import modules need @tLib/imports.lua and nothing else. Each one loads the first time
you touch it:
local value = tlib.kvp.getString('my_key', 'default')tLib
Still stuck? Support can answer it directly.
Was this page helpful?
TIMMYG Studios