# Notifications

koja-lib provides two notification interfaces: `SendNotify` (routes through the configured backend) and `LibNotify` (built-in koja-lib notification).

***

## SendNotify

Sends a notification using the backend configured in `Config.Notify`.

```lua
KOJA.Client.SendNotify(data)
```

| Field   | Type      | Description                                          |
| ------- | --------- | ---------------------------------------------------- |
| `type`  | `string?` | `"success"`, `"error"`, `"info"`, `"warning"`        |
| `title` | `string?` | Notification title                                   |
| `desc`  | `string`  | Notification body text                               |
| `time`  | `number?` | Duration in milliseconds (default varies by backend) |
| `icon`  | `string?` | Icon name (backend-specific)                         |
| `color` | `string?` | Color override (backend-specific)                    |

**Example**

```lua
KOJA.Client.SendNotify({
    type  = 'success',
    title = 'Bank',
    desc  = 'You received $500.',
    time  = 5000,
})

KOJA.Client.SendNotify({
    type = 'error',
    desc = 'You do not have enough money.',
})
```

***

## ShowFreemodeMessage

Displays a freemode message (big text in the top-left corner).

```lua
KOJA.Client.ShowFreemodeMessage(data)
```

| Field   | Type      | Description              |
| ------- | --------- | ------------------------ |
| `title` | `string?` | Header text              |
| `desc`  | `string?` | Body text                |
| `time`  | `number?` | Duration in milliseconds |

**Example**

```lua
KOJA.Client.ShowFreemodeMessage({
    title = 'HEIST',
    desc  = 'Prepare your crew.',
    time  = 7000,
})
```

***

## LibNotify

Built-in koja-lib notification — always uses the lib UI regardless of `Config.Notify`.

```lua
KOJA.Client.LibNotify(data)
```

Also available as an export for use from other resources:

```lua
exports['koja-lib']:LibNotify(data)
```

| Field         | Type      | Default       | Description                                   |
| ------------- | --------- | ------------- | --------------------------------------------- |
| `label`       | `string?` | —             | Small label above the title                   |
| `tag`         | `string?` | —             | Tag used for deduplication                    |
| `description` | `string`  | —             | Notification body                             |
| `color`       | `string?` | `"blue"`      | Accent color                                  |
| `type`        | `string?` | `"info"`      | `"success"`, `"error"`, `"warning"`, `"info"` |
| `duration`    | `number?` | `3000`        | Duration in milliseconds                      |
| `position`    | `string?` | `"top-right"` | Position on screen                            |

**Example**

```lua
KOJA.Client.LibNotify({
    label       = 'Inventory',
    description = 'You picked up a weapon.',
    type        = 'success',
    duration    = 4000,
    position    = 'bottom-right',
})
```

***

## Notification Backends

| Config.Notify | Backend                                 |
| ------------- | --------------------------------------- |
| `"esx"`       | ESX `showNotification`                  |
| `"qb"`        | QBCore `QBCore.Functions.Notify`        |
| `"ox"`        | `exports.ox_lib:notify`                 |
| `"lib"`       | koja-lib built-in (same as `LibNotify`) |

> The backend is set by `Config.Notify` only — it is independent from `Config.Framework`. You can run ESX and use ox\_lib notifications.

## Related pages

- [Callbacks](/koja-lib/api-reference/client-api/callbacks) — koja-lib provides a callback system that lets client scripts request data from the server and vice versa.
- [Inventory](/koja-lib/api-reference/client-api/inventory) — Client-side inventory functions let you check what items the local player has without a server round-trip.
- [DUI](/koja-lib/api-reference/client-api/dui) — DUI (Dynamic UI) allows you to render a web page as a texture on any in-game surface — screens, billboards, laptops, phones, etc.
- [Money](/koja-lib/api-reference/client-api/money) — Retrieve the local player's money balance from the client side via a server callback.
- [Keybinds](/koja-lib/api-reference/client-api/keybinds) — Register persistent key bindings that players can rebind in the GTA V settings menu.
- [Player](/koja-lib/api-reference/client-api/player) — Functions for reading the local player's data on the client side.
- [Client API](/koja-lib/api-reference/client-api) — back to the section overview
