Koja Scripts
KOJA-LIB

Notifications

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

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)
FieldTypeDescription
typestring?"success", "error", "info", "warning"
titlestring?Notification title
descstringNotification body text
timenumber?Duration in milliseconds (default varies by backend)
iconstring?Icon name (backend-specific)
colorstring?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)
FieldTypeDescription
titlestring?Header text
descstring?Body text
timenumber?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)
FieldTypeDefaultDescription
labelstring?Small label above the title
tagstring?Tag used for deduplication
descriptionstringNotification body
colorstring?"blue"Accent color
typestring?"info""success", "error", "warning", "info"
durationnumber?3000Duration in milliseconds
positionstring?"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.NotifyBackend
"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.

  • 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