> For the complete documentation index, see [llms.txt](https://docs.kojascripts.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kojascripts.eu/koja-lib/frameworks/overview.md).

# Overview

koja-lib abstracts the differences between ESX and QBCore so your scripts work on both without any changes.

***

## Supported Frameworks

| Framework | Resource Name | Config value |
| --------- | ------------- | ------------ |
| ESX       | `es_extended` | `"esx"`      |
| QBCore    | `qb-core`     | `"qb"`       |
| QBX Core  | `qbx_core`    | `"qb"`       |
| Custom    | —             | `"custom"`   |

QBCore and QBX Core both map to the `"qb"` internal identifier. koja-lib resolves the correct core object automatically.

***

## Detection Order

When `Config.Framework = "auto"`, koja-lib checks resources in this order:

1. `es_extended`
2. `qbx_core`
3. `qb-core`

The first one found in `started` state is used. If none are running, the framework is set to `"custom"`.

***

## Runtime Value

The resolved framework is available at runtime:

```lua
-- Shared (client and server)
print(KOJA.Framework)  -- "esx" | "qb" | "custom"
```

***

## Forcing a Framework

Set `Config.Framework` to skip auto-detection:

```lua
Config.Framework = "qb"  -- always use QBCore, even if ESX is also running
```

***

## How the Bridge Works

Every public koja-lib function is framework-agnostic. Internally, koja-lib maps each call to the correct native API:

```lua
-- Your script:
local job = KOJA.Server.GetPlayerJob(source)
-- Returns: { name = "police", grade = 2 }

-- On ESX this calls:    ESX.GetPlayerFromId(source).getJob()
-- On QBCore this calls: QBCore.Functions.GetPlayer(source).PlayerData.job
```

You never need to check `KOJA.Framework` in your scripts unless you are doing something framework-specific.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kojascripts.eu/koja-lib/frameworks/overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
