> 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-mdt/configuration/framework-and-bridges.md).

# Framework and Bridges

config/bridge.lua — how the MDT connects to your framework, inventory, notify, clothing, dispatch, and billing resources.

Mango MDT never calls third-party resources directly. Every integration goes through a **bridge** — a category (inventory, notifications, billing, …) with swappable **providers** (one file per supported resource). Core code calls `Mango.Bridge.Inventory:AddItem(...)` and the bridge decides which resource that reaches.

You pick providers in `config/bridge.lua` — **one line per category**:

```lua
Config.Bridge = {
    Framework     = 'auto',
    Inventory     = 'auto',
    Notifications = 'mdt',
    Clothing      = 'auto',
    Dispatch      = 'mdt',
    Billing       = 'auto',
    Jail          = 'auto',
    Insurance     = 'auto',
}
```

## The three value forms

| Value      | Meaning                                                                                         |
| ---------- | ----------------------------------------------------------------------------------------------- |
| `'auto'`   | Probe the known providers in order and bind the first whose resource is running.                |
| `'<name>'` | Bind **exactly** this provider (a file in `bridge/<category>/`). Detection is skipped entirely. |
| `'none'`   | Bind nothing — that category's calls become safe no-ops.                                        |

{% hint style="info" %}
Naming a provider explicitly **always wins**. If you renamed a resource or run a fork auto-detection doesn't recognise, the explicit name is the escape hatch.
{% endhint %}

## Choosing your framework

This is the only bridge most servers ever set by hand:

```lua
Framework = 'auto',   -- or 'esx' | 'qbcore' | 'qbox'
```

All three ship fully implemented. `'auto'` probes **qbox before qbcore** deliberately — a Qbox server usually also runs a `qb-core` compatibility shim, and probing in that order means the real framework binds, never the shim. If your framework resource has a non-standard name, adjust `Config.ESXResource` / `Config.QBCoreResource` / `Config.QBoxResource` in `config/core.lua`.

What the framework provider drives: who counts as a player, job + grade lookups, rank display names, the Person Database's civilian identities, and hiring/resignation job changes (online **and** offline members).

## Categories and providers

| Category          | Providers shipped                                                                                                                                                                                                  | What it powers                                                                                                                                                                                                                                                 |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Framework**     | `esx`, `qbcore`, `qbox`                                                                                                                                                                                            | Players, jobs, civilian identities, rank names, hiring.                                                                                                                                                                                                        |
| **Inventory**     | `ox_inventory`, `qb-inventory`, `esx`, `custom`                                                                                                                                                                    | Bodycam item, printed warrants, evidence booking.                                                                                                                                                                                                              |
| **Notifications** | `mango_notify`, `mdt`, `ox_lib`, `okokNotify`, `mythic_notify`, `custom`                                                                                                                                           | Officer-facing messages. `mdt` renders them inside the tablet UI; any other provider shows them in that resource's HUD style. `mango_notify` is the matching Mango notification resource — when set to `auto` it is preferred over the others if it's running. |
| **Clothing**      | `illenium-appearance`, `fivem-appearance`, `custom`                                                                                                                                                                | Department uniforms.                                                                                                                                                                                                                                           |
| **Dispatch**      | `mdt`, `ps-dispatch`, `custom`                                                                                                                                                                                     | The on-screen alert for new calls — see [Dispatch Integration](/mango5m-docs/resources/mango-mdt/configuration/dispatch-integration.md).                                                                                                                       |
| **Billing**       | `okokbilling`, `codem`, `esx_billing`, `qb`, `custom`                                                                                                                                                              | Collecting fines — see [Billing Integration](/mango5m-docs/resources/mango-mdt/configuration/billing-integration.md).                                                                                                                                          |
| **Jail**          | `rcore_prison`, `tk_prison`, `qb-policejob`, `esx_jail`, `custom`                                                                                                                                                  | Prison sentences from reports — see [Jail and Sentencing](/mango5m-docs/resources/mango-mdt/features/jail-and-sentencing.md).                                                                                                                                  |
| **Insurance**     | `core_insurance`, `m-insurance` (m-InsuranceV2), `dcarinsurance` (dCarInsurance — **verified against the real resource**: it stores an on/off flag, so profiles show Insured/Not Insured with no expiry), `custom` | Read-only: the insurance panel on vehicle profiles. With `'none'` (or nothing detected) the Vehicles page hides its insurance section entirely.                                                                                                                |

## Checking what was bound

Run this in the **server console**:

```
mango_bridges
```

It prints every category and which provider (if any) is active — the first thing to check whenever an integration isn't behaving.

## Dispatch job targeting

Most dispatch resources scope alerts by job name and can't ask the MDT who's on duty, so the jobs that should receive MDT alerts are config:

```lua
Config.Bridge.DispatchOptions = {
    jobs = { 'police' },
}
```

Add every law-enforcement job that should hear MDT calls (e.g. `{ 'police', 'sheriff', 'highway' }`).

## Writing a custom provider

Every category has a `template.lua` (fully commented) and a `custom.lua` stub in its `bridge/<category>/` folder. Copy the template, fill in the functions for your resource, set the category to `'custom'` (or your file's registered name) in `config/bridge.lua`. No core edits — bridge files are self-registering drop-ins.
