Overview
koja-lib provides a unified inventory API that works across multiple inventory resources. The same function calls work regardless of which inventory is installed.
Supported Inventories
| Resource | Detection Name |
|---|---|
| ox_inventory | ox_inventory |
| qb-inventory | qb-inventory |
| qs-inventory | qs-inventory |
| codem-inventory | codem-inventory |
| jaksam_inventory | jaksam_inventory |
| Framework native | framework (fallback) |
| Custom | custom |
Detection Order
When Config.Inventory = "auto", koja-lib checks for running resources in this order:
ox_inventoryqb-inventoryqs-inventorycodem-inventoryjaksam_inventory
The first one in started state wins. If none are running, koja-lib falls back to the framework's native item functions (ESX addInventoryItem / QB Player.Functions.AddItem).
Runtime Value
print(KOJA.Inventory)
-- "ox_inventory" | "qb-inventory" | "qs-inventory" | "codem-inventory"
-- "jaksam_inventory" | "framework" | "custom"
Forcing an Inventory
-- editable/shared/config.lua
Config.Inventory = "ox_inventory"
If the specified resource is not started, koja-lib prints a warning and falls back to auto-detection.
Adapter Coverage
| Feature | ox_inventory | qb-inventory | qs-inventory | codem-inventory | jaksam_inventory |
|---|---|---|---|---|---|
| AddItem | ✅ | ✅ (framework) | ✅ | ✅ | ✅ |
| RemoveItem | ✅ | ✅ (framework) | ✅ | ✅ | ✅ |
| GetItemCount (server) | ✅ | ✅ (framework) | ✅ | ✅ | ✅ |
| GetItemCount (client) | ✅ | ✅ (framework) | ✅ | ✅ | ✅ |
| GetItems (server) | ✅ | ✅ (framework) | ✅ | ✅ | ✅ |
| GetItems (client) | ✅ | ✅ (framework) | — | ✅ | ✅ |
| metadata support | ✅ | — | ✅ | ✅ | ✅ |
| slot support | ✅ | — | ✅ | ✅ | ✅ |
qb-inventoryand its forks keep QB's native item functions intact. koja-lib uses those automatically via the framework fallback, so you do not need a dedicated adapter for them.
Related pages
- Custom Inventory — If you use an inventory that is not supported out of the box, set Config.Inventory = "custom" and fill in the stub files.
- Inventory — back to the section overview