> For the complete documentation index, see [llms.txt](https://mango-5m.gitbook.io/mango5m-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mango-5m.gitbook.io/mango5m-docs/resources/mango-prison/developer-guide/bridges.md).

# Bridges

Seven adapter families keep every third-party integration out of the core.

Core code never touches a framework, inventory, target, notification, clothing, door or dispatch API directly — everything goes through `bridge/` adapters behind neutral interfaces. Swapping QBCore for ESX, or ps-dispatch for mango\_mdt, touches **zero core files**.

| Bridge       | Adapters                                               | Selected by        |
| ------------ | ------------------------------------------------------ | ------------------ |
| `framework/` | ESX Legacy, QBCore, Qbox                               | `Config.Framework` |
| `inventory/` | ox\_inventory, qb-inventory, framework fallback        | `Config.Inventory` |
| `target/`    | ox\_target, qb-target                                  | `Config.Target`    |
| `notify/`    | mango\_notify *(default)*, ox\_lib, custom stub        | `Config.Notify`    |
| `clothing/`  | illenium-appearance, skinchanger, native fallback      | `Config.Clothing`  |
| `doorlock/`  | ox\_doorlock (by door name)                            | `Config.Doors`     |
| `dispatch/`  | mango\_mdt *(default)*, ps-dispatch, custom stub, none | `Config.Dispatch`  |

### Inventories

| Value              | Notes                                                                                                                             |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
| `ox_inventory`     | The richest — stashes and metadata. What `'auto'` prefers, and what the evidence locker, cell hiding spots and cell searches need |
| `qs-inventory`     | Quasar                                                                                                                            |
| `origen_inventory` | Mirrors most ox export names                                                                                                      |
| `codem-inventory`  | Stash features degrade off                                                                                                        |
| `qb-inventory`     | Stash features degrade off                                                                                                        |
| `framework`        | Raw ESX/QB item APIs — last resort, limited metadata                                                                              |
| `custom`           | **Yours.** Fill in `bridge/inventory/custom.lua`                                                                                  |

Anything stash-based switches itself off when the inventory can't do stashes (`Inv.SupportsStashes()` returns false) — the rest of the prison carries on regardless.

{% hint style="info" %}
The qs / origen / codem bridges are written against each inventory's published server exports and every call is wrapped, so a signature that differs on your build degrades to a no-op rather than erroring mid-intake. If an item doesn't move, check the console and adjust that bridge — or copy `custom.lua`.
{% endhint %}

Every selector supports `'auto'` — the loader detects what's running at boot and prints its choices with `Config.Developer = true`.

## Why inventory is separate from framework

ox\_inventory runs on all three frameworks, so it gets its own bridge. The ox\_inventory adapter round-trips **full item metadata and durability** through property storage; the framework fallback works everywhere but with degraded metadata support.

## Writing an adapter

Each adapter is a small file implementing a documented interface — the notify adapters are \~40 lines, dispatch adapters \~25. Pattern:

```lua
-- bridge/dispatch/my_dispatch.lua
if not IsDuplicityVersion() or Mango.dispatch ~= 'my_dispatch' then return end

Dispatch = {}

function Dispatch.Alert(data)
    -- data = { code, title, description, coords = vec3, sound? }
    exports.my_dispatch:SendAlert(data.title, data.description, data.coords)
end
```

Add the file to `fxmanifest.lua`, set the config value, done. The `custom` stubs in `bridge/notify/` and `bridge/dispatch/` are ready-made starting points with examples in the comments.
