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

# Framework Bridge

All CrankChaos scripts talk to one interface, `CC.*`, instead of ESX or QBCore directly. The bridge ships inside every script as `shared/cc_framework.lua`.

## Automatic detection

On start the bridge checks which framework resource is running, in this order:

| Order | Resource checked | Result     |
| ----- | ---------------- | ---------- |
| 1     | `qbx_core`       | QBox       |
| 2     | `es_extended`    | ESX Legacy |
| 3     | `qb-core`        | QBCore     |
| -     | none             | standalone |

QBox is checked first because it also provides a `qb-core` compatibility layer.

{% hint style="warning" %}
Your framework must be started **before** any CrankChaos script in `server.cfg`, otherwise detection falls back to standalone.
{% endhint %}

## Switching frameworks

No configuration change is needed. Start the other framework and restart the server; the bridge detects it automatically. Database content (characters, vehicles, accounts) is framework-specific, so plan the data migration separately.

## Custom or modified frameworks

The bridge files are intentionally **not encrypted**. If you run a modified ESX/QBCore/QBox or your own framework, adapt the functions in `shared/cc_framework.lua` (and related bridge files such as `cc_characters.lua`, `cc_society.lua`, `cc_vehicles.lua`, `cc_vehicleprops.lua` where present). Keep the change identical across all CrankChaos resources.

Useful helpers:

```lua
CC.GetFramework() -- 'esx' | 'qb' | 'qbox' | 'standalone'
CC.IsESX()        -- true on ESX
CC.IsQB()         -- true on QBCore and QBox
```


---

# 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://ccfivem.gitbook.io/ccfivem-docs/getting-started/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.
