# 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:

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

```lua
print(KOJA.Inventory)
-- "ox_inventory" | "qb-inventory" | "qs-inventory" | "codem-inventory"
-- "jaksam_inventory" | "framework" | "custom"
```

## Forcing an Inventory

```lua
-- 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-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.

## Related pages

- [Custom Inventory](/koja-lib/inventory/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](/koja-lib/inventory) — back to the section overview
