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

# Client API

Get the bridge object once at the top of your client file:

```lua
local Bridge = exports['brnx_bridge']:GetBridge()
```

## Framework

| Function             | Returns  | Description                                                |
| -------------------- | -------- | ---------------------------------------------------------- |
| `GetFramework()`     | `string` | `'qbox'`, `'qbcore'`, `'esx'`, `'ox'` or `'standalone'`    |
| `GetCoreObject()`    | `table?` | The QBCore or ESX shared object, `nil` on other frameworks |
| `RefreshFramework()` | `string` | Detects the framework again                                |

## Player

| Function           | Returns   | Description                                                                                                               |
| ------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------- |
| `GetPlayerData()`  | `table`   | Raw framework player data (QBCore/Qbox `PlayerData`, ESX `PlayerData`)                                                    |
| `IsPlayerLoaded()` | `boolean` | `true` once a character is loaded. Always `true` on standalone.                                                           |
| `GetJob()`         | `table`   | Normalized job, same shape as on the [server](/brunx-mods-docs/products/scripts/brunx-bridge/server-api.md#the-job-table) |
| `GetJobName()`     | `string?` | Job name                                                                                                                  |
| `GetGrade()`       | `number`  | Grade level                                                                                                               |
| `IsOnDuty()`       | `boolean` | `false` only when the framework reports off duty                                                                          |
| `HasJob(jobs)`     | `boolean` | Same rule formats as the [server](/brunx-mods-docs/products/scripts/brunx-bridge/server-api.md#job-rules-for-hasjob)      |

{% hint style="info" %}
Client job checks are for showing or hiding things. Always check access again on the server before giving items, money or teleporting.
{% endhint %}

## Notifications

```lua
Bridge.Notify({
    title = 'Garage',
    description = 'Your vehicle is ready.',
    type = 'success',     -- inform, success, error, warning
    duration = 5000,
    position = 'top-right' -- ox_lib only
})

Bridge.Notify('Your vehicle is ready.', 'success')
```

## UI

All UI helpers use ox\_lib.

| Function                       | Returns   | Description                                                                                  |
| ------------------------------ | --------- | -------------------------------------------------------------------------------------------- |
| `Progress(data)`               | `boolean` | `lib.progressBar`, `true` when completed. Missing fields come from `Config.DefaultProgress`. |
| `ContextMenu(data)`            | `boolean` | Registers and opens a `lib.registerContext` menu                                             |
| `Input(title, rows, options?)` | `table?`  | `lib.inputDialog`, `nil` when cancelled                                                      |
| `AlertDialog(data)`            | `string`  | `lib.alertDialog`, `'confirm'` or `'cancel'`                                                 |
| `ShowTextUI(text, options?)`   | `boolean` | `lib.showTextUI`                                                                             |
| `HideTextUI()`                 | `boolean` | `lib.hideTextUI`                                                                             |

{% tabs %}
{% tab title="Progress" %}

```lua
local done = Bridge.Progress({
    duration = 5000,
    label = 'Repairing vehicle...'
})

if done then
    Bridge.Notify('Vehicle repaired.', 'success')
end
```

{% endtab %}

{% tab title="Context menu" %}

```lua
Bridge.ContextMenu({
    id = 'garage_menu',
    title = 'Garage',
    options = {
        { title = 'Take out vehicle', icon = 'car', event = 'garage:takeOut' },
        { title = 'Store vehicle', icon = 'warehouse', serverEvent = 'garage:store' }
    }
})
```

{% endtab %}

{% tab title="Input" %}

```lua
local result = Bridge.Input('Transfer money', {
    { type = 'number', label = 'Amount', required = true, min = 1 },
    { type = 'input', label = 'Reason' }
})

if result then
    TriggerServerEvent('bank:transfer', result[1], result[2])
end
```

{% endtab %}
{% endtabs %}

## Callbacks

| Function                         | Description                                      |
| -------------------------------- | ------------------------------------------------ |
| `TriggerCallback(name, cb, ...)` | Calls a server callback, `cb` gets the result    |
| `AwaitCallback(name, ...)`       | Calls a server callback and waits for the result |

```lua
local vehicles = Bridge.AwaitCallback('garage:getVehicles')
```

## Target

`Bridge.Target` wraps ox\_target and qb-target. See [Target](/brunx-mods-docs/products/scripts/brunx-bridge/target-integration.md).

## Direct exports

Also available as single exports, for example `exports['brnx_bridge']:GetJob()`:

`GetBridge`, `GetFramework`, `GetPlayerData`, `IsPlayerLoaded`, `GetJob`, `GetJobName`, `HasJob`, `Notify`, `Locale`, `AddTargetZone`, `AddTargetSphere`, `RemoveTargetZone`


---

# 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://brunx-mods.gitbook.io/brunx-mods-docs/products/scripts/brunx-bridge/client-api.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.
