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

Field
Type
Description

title

string?

Header text

desc

string?

Body text

time

number?

Duration in milliseconds

Example


LibNotify

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

Also available as an export for use from other resources:

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


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.

Last updated