> For the complete documentation index, see [llms.txt](https://striga.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://striga.gitbook.io/docs/striga-core/integration/inventory.md).

# Inventory

Striga Inventory, qb-inventory, ox\_inventory, ESX, or your own.

Config key: `inventory` in `config.json`. Default `"auto"`.

## Built-in adapters

| Name     | Inventory                                   |
| -------- | ------------------------------------------- |
| `striga` | Striga Inventory                            |
| `qb`     | qb-inventory (QBCore)                       |
| `ox`     | ox\_inventory                               |
| `esx`    | ESX built-in inventory                      |
| `none`   | No inventory: counts are 0, lists are empty |

## Auto detect

1. `striga-inventory` installed → `striga`
2. QBCore and `qb-inventory` installed → `qb`
3. `ox_inventory` installed → `ox`
4. ESX → `esx`
5. Else → `none`

{% hint style="info" %}
On QBCore, qb-inventory wins over ox\_inventory when both are installed: ox\_inventory has no qb-core bridge.
{% endhint %}

## Related options

| Option               | Default  | What it does                                                                                      |
| -------------------- | -------- | ------------------------------------------------------------------------------------------------- |
| `itemImagePath`      | `""`     | `""` = the inventory's own images. Else a path with one `%s`, e.g. `"nui://my-inv/images/%s.png"` |
| `inventoryMaxWeight` | `120000` | Bag limit used on the client when the inventory does not give one                                 |

## Your own inventory

```json
"inventory": "my-inv"
```

{% tabs %}
{% tab title="Client" %}
Required: `weight`, `maxWeight`, `getItemCount`, `getItems`, `itemLabel`.

```lua
exports['striga-core']:RegisterAdapter('inventory', 'my-inv', {
    weight = function() return exports['my-inv']:GetWeight() end,
    maxWeight = function() return exports['my-inv']:GetMaxWeight() end,
    getItemCount = function(item) return exports['my-inv']:Count(item) or 0 end,
    getItems = function() return exports['my-inv']:GetItems() end, -- { name, label, count, slot, weight, metadata }
    itemLabel = function(item) return exports['my-inv']:Label(item) end,
})
```

Optional: `getItemData(name)`, `itemImage(name)`, `isOpen()`, `useSlot(slot)`.
{% endtab %}

{% tab title="Server" %}
Required: `weight`, `maxWeight`, `getItemCount`, `canCarry`, `getItems`, `itemLabel`, `addItem`, `removeItem`.

```lua
exports['striga-core']:RegisterAdapter('inventory', 'my-inv', {
    weight = function(src) return exports['my-inv']:GetWeight(src) end,
    maxWeight = function(src) return exports['my-inv']:GetMaxWeight(src) end,
    getItemCount = function(src, item) return exports['my-inv']:Count(src, item) or 0 end,
    canCarry = function(src, item, count) return exports['my-inv']:CanCarry(src, item, count) end,
    getItems = function(src) return exports['my-inv']:GetItems(src) end,
    itemLabel = function(item) return exports['my-inv']:Label(item) end,
    addItem = function(src, item, count, metadata, slot, reason) return exports['my-inv']:Add(src, item, count, metadata, slot) end,
    removeItem = function(src, item, count, metadata, slot, reason) return exports['my-inv']:Remove(src, item, count, metadata, slot) end,
})
```

Optional: `getItemData`, `getItemBySlot`, `setMetadata`, `registerUsable(name, dispatch)` (call `dispatch(src, name, item)` when a player uses it), `openInventory`, `registerStash`, `closeInventory`, `clearInventory`, `registerShop`, `createDrop`.
{% endtab %}
{% endtabs %}

{% hint style="warning" %}
**Tell core about changes.** On the client, call `exports['striga-core']:InventoryChanged()` when the player's items change, and `exports['striga-core']:InventoryOpen(true)` / `InventoryOpen(false)` when your UI opens and closes. Core then fires its inventory events (the HUD weight updates at once).
{% endhint %}

A missing optional function makes core answer "not supported" (`false` / `nil`) for that feature and print it once in the console.

{% content-ref url="/pages/4BHzwhnhtogTzMScX7cr" %}
[Notify](/docs/striga-core/integration/notify.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://striga.gitbook.io/docs/striga-core/integration/inventory.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
