> For the complete documentation index, see [llms.txt](https://visionstore.gitbook.io/visionstore-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://visionstore.gitbook.io/visionstore-docs/scripts/advanced-clothing/developers/framework-bridge.md).

# Framework bridge

The open-source framework adapter for money, jobs, gangs, identifiers, permissions and notifications.

`bridge/framework/server.lua` and `bridge/framework/client.lua` are **open source**. Money, jobs, gangs, identifiers, permissions and notifications all go through them.

They detect frameworks in this order and fall back to standalone:

| Detected resource | `Framework.Type`                                                        |
| ----------------- | ----------------------------------------------------------------------- |
| `qbx_core`        | `qbx`                                                                   |
| `qb-core`         | `qb`                                                                    |
| `es_extended`     | `esx`                                                                   |
| `ox_core`         | `ox`                                                                    |
| None              | `standalone` (no money, no jobs, `license:` identifier as character id) |

The detected type is printed in the startup banner (`framework: qbx`).

## Server functions

| Function                                                | Returns                          | Used for                                                                                                                 |
| ------------------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `Framework.GetPlayerId(src)`                            | Character id or `nil`            | citizenid (QBCore / Qbox), identifier (ESX), charId (ox\_core). Outfits, favourites and peds are stored per character id |
| `Framework.GetPlayerName(src)`                          | Name                             | Nearby sharing list                                                                                                      |
| `Framework.GetMoney(src)`                               | `{ cash, bank }`                 | The money boxes in the menu                                                                                              |
| `Framework.RemoveMoney(src, account, amount)`           | `true` / `false`                 | Checkout. `account` is `"cash"` or `"bank"`                                                                              |
| `Framework.GetJob(src)`                                 | `{ name, grade, label, onduty }` | Job lockers, job shops, discounts, locks                                                                                 |
| `Framework.GetGang(src)`                                | `{ name, grade, label }`         | Gang lockers and locks. On ESX and ox\_core the job is used as the gang                                                  |
| `Framework.GetGender(src)`                              | `"male"` / `"female"`            | Gender rules                                                                                                             |
| `Framework.HasAce(src, ace)`                            | `true` / `false`                 | Ace checks (locked items)                                                                                                |
| `Framework.Notify(src, text, type)`                     | None                             | Notifications (ox\_lib)                                                                                                  |
| `Framework.OnPlayerLoaded(cb)` / `OnPlayerUnloaded(cb)` | None                             | Character load / unload hooks                                                                                            |

Accounts per framework:

| Framework     | `cash`                     | `bank`            |
| ------------- | -------------------------- | ----------------- |
| QBCore / Qbox | `cash`                     | `bank`            |
| ESX           | `money`                    | `bank`            |
| ox\_core      | ox\_inventory `money` item | Character account |
| Standalone    | None                       | None              |

## Client functions

`Framework.IsLoaded()`, `GetCitizenId()`, `GetJob()`, `GetGang()`, `GetPlayerName()`, `GetGender()`, `IsDead()`, `Notify(text, type)`, `OnPlayerLoaded(cb)`, `OnPlayerUnloaded(cb)`, `OnJobUpdate(cb)` and `Refresh()`. The client side is used for the wardrobe pre-checks (hiding a locker prompt from players who don't qualify) and notifications; the server always decides.

## Examples

{% tabs %}
{% tab title="Bank only" %}
No cash account on your server? No code needed: set the payment order in `config/config.lua`.

```lua
Config.Payment = {
    order = { "bank" },
    allowChoice = false,
}
```

{% endtab %}

{% tab title="Standalone economy" %}
On a standalone server `Framework.RemoveMoney` returns `false`, so paid checkouts fail. Connect your own economy in the standalone branch at the end of `Framework.GetMoney` and `Framework.RemoveMoney` (`bridge/framework/server.lua`):

```lua
-- in Framework.GetMoney, before `return money`
if ftype == "standalone" then
    money.bank = exports.my_economy:GetBalance(src) or 0
end

-- in Framework.RemoveMoney, replace the final `return false`
if account == "bank" then
    return exports.my_economy:RemoveBalance(src, amount) == true
end
return false
```

Here `my_economy` stands for your own economy resource and its exports. Then use `Config.Payment.order = { "bank" }`.
{% endtab %}

{% tab title="Another framework" %}
Add a branch next to the existing ones:

1. In `detectType()` (server) and `detect()` (client), return a new type when your framework's resource is started.
2. In each `Framework.*` function, add an `elseif ftype == "myframework" then` branch that reads your framework's player data.
3. Restart and check the startup banner shows your type.

Every cross-resource call in the bridge is wrapped in `pcall`, so follow the same pattern: a failing framework call should never break a checkout.
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Updating?** Back up `bridge/` before replacing the resource folder, then copy your changes back.
{% endhint %}


---

# 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://visionstore.gitbook.io/visionstore-docs/scripts/advanced-clothing/developers/framework-bridge.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.
