> 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/api-reference/client-api/notifications.md).

# 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.


---

# 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/api-reference/client-api/notifications.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.
