> For the complete documentation index, see [llms.txt](https://saka-store.gitbook.io/main/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://saka-store.gitbook.io/main/resources/notification/usage-guide.md).

# Usage Guide

### Triggering Notifications

You can trigger a notification from **any client-side script** using the following event:

```lua
TriggerEvent('saka_notify:notify', {
    title = 'Your Title',
    description = 'Your description goes here.',
    type = 'success' -- or info / error / bank / etc.
})
```

***

### Basic Notification

```lua
TriggerEvent('saka_notify:notify', {
    title = 'Welcome',
    description = 'You’ve joined the server.',
    type = 'info'
})
```

***

### Using Custom Notification Types

If you’ve defined a new type in Config.notificationTypes (e.g., "warning" or "bank"), just use it directly:

```lua
TriggerEvent('saka_notify:notify', {
    title = 'Bank Update',
    description = 'Your deposit has been received.',
    type = 'bank'
})
```

{% hint style="info" %}
Make sure that the type (bank in this case) exists in your config.
{% endhint %}

***

### Custom Display Time

You can override the default duration using the duration field (in ms):

```lua
TriggerEvent('saka_notify:notify', {
    title = 'Quick Tip',
    description = 'This message will vanish quickly.',
    type = 'info',
    duration = 3000
})
```

***

### Advance Example

```lua
TriggerEvent('saka_notify:notify', {
    title = 'Error 404',
    description = 'The requested resource was not found.',
    type = 'error',
    duration = 7000
})
```

***

### OX\_lib Usage

Here is the usage to bridge OX\_lib notifys to Saka's.

{% code overflow="wrap" %}

```lua
function lib.notify(data)
    local sound = settings.notification_audio and data.sound
    data.sound = nil 

    if sound then
        if sound.bank then
            lib.requestAudioBank(sound.bank)
        end

        local soundId = GetSoundId()
        if soundId then
            PlaySoundFrontend(soundId, sound.name or "DEFAULT", sound.set or "HUD_FRONTEND_DEFAULT_SOUNDSET", true)
            ReleaseSoundId(soundId)
        end

        if sound.bank then
            ReleaseNamedScriptAudioBank(sound.bank)
        end
    end
    
    TriggerEvent('saka-notification:client:Notification', {
        header = data.title or 'Notification',
        text = data.description or '',
        type = data.type or 'info',
        time = data.duration or 5000,
    })
end
```

{% endcode %}

***

### &#x20; Tips

• You **don’t need a server event;** this is purely client-side.

• Works in any framework – just make sure the script is ensured and the event is called from the client.

• Customize notification sounds or icons via config.lua.
