Installation
Requirements
| Dependency | Required | Notes |
|---|---|---|
oxmysql | Yes | Database driver |
es_extended | No | Required only for ESX framework |
qb-core or qbx_core | No | Required only for QBCore framework |
ox_inventory | No | Optional — auto-detected |
Setup
-
Place the
koja-libfolder inside your resources directoryresources/ [dev]/ koja-lib/ -
Add to your
server.cfgbefore any script that depends on itensure koja-lib -
Open
See Configuration.editable/shared/config.luaand configure the options for your server
Accessing the API
In a client script
local KOJA = exports['koja-lib']:getSharedObject()
-- or via event
TriggerEvent('koja:getSharedObject', function(obj)
KOJA = obj
end)
In a server script
local KOJA = exports['koja-lib']:getSharedObject()
-- or via event
TriggerEvent('koja:getSharedObject', function(obj)
KOJA = obj
end)
The shared object exposes
KOJA.Clienton the client andKOJA.Serveron the server, along withKOJA.Framework,KOJA.Inventory, andKOJA.Misc.
File Structure
koja-lib/
editable/
shared/
config.lua ← Main configuration
utils.lua ← Framework detection
inventory.lua ← Inventory detection
custom/
framework_client.lua ← Custom framework stubs (client)
framework_server.lua ← Custom framework stubs (server)
inventory_client.lua ← Custom inventory stubs (client)
inventory_server.lua ← Custom inventory stubs (server)
client/
server/
web/
Only files inside editable/ are intended to be modified.
Related pages
- Configuration — All configuration lives in editable/shared/config.lua.
- Getting Started — back to the section overview