Koja Scripts
KOJA-LIB

Overview

koja-lib provides a unified inventory API that works across multiple inventory resources.

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

ResourceDetection Name
ox_inventoryox_inventory
qb-inventoryqb-inventory
qs-inventoryqs-inventory
codem-inventorycodem-inventory
jaksam_inventoryjaksam_inventory
Framework nativeframework (fallback)
Customcustom

Detection Order

When Config.Inventory = "auto", koja-lib checks for running resources in this order:

  1. ox_inventory
  2. qb-inventory
  3. qs-inventory
  4. codem-inventory
  5. jaksam_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

Featureox_inventoryqb-inventoryqs-inventorycodem-inventoryjaksam_inventory
AddItem✅ (framework)
RemoveItem✅ (framework)
GetItemCount (server)✅ (framework)
GetItemCount (client)✅ (framework)
GetItems (server)✅ (framework)
GetItems (client)✅ (framework)
metadata support
slot support

qb-inventory and 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.

  • 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