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.
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
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).
KOJA.Client.ShowFreemodeMessage(data)
| Field | Type | Description |
|---|---|---|
title | string? | Header text |
desc | string? | Body text |
time | number? | Duration in milliseconds |
Example
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.
KOJA.Client.LibNotify(data)
Also available as an export for use from other resources:
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
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.Notifyonly — it is independent fromConfig.Framework. You can run ESX and use ox_lib notifications.
Related pages
- Callbacks — koja-lib provides a callback system that lets client scripts request data from the server and vice versa.
- Inventory — Client-side inventory functions let you check what items the local player has without a server round-trip.
- 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 — Retrieve the local player's money balance from the client side via a server callback.
- Keybinds — Register persistent key bindings that players can rebind in the GTA V settings menu.
- Player — Functions for reading the local player's data on the client side.
- Client API — back to the section overview