# ox\_lib

ox\_lib\resource\interface\client\notify.lua \[Replace Full File]

#### Light Theme 👇

{% code title="ox\_lib\resource\interface\client\notify.lua" overflow="wrap" lineNumbers="true" fullWidth="false" expandable="true" %}

```lua
local settings = require 'resource.settings'

---`client`
---@param data NotifyProps
---@diagnostic disable-next-line: duplicate-set-field
function lib.notify(data)
    local sound = settings.notification_audio and data.sound
    data.sound = nil

    exports['nm1_notification']:Notify({
        title = data.title or 'Notification',
        message = data.description or '',
        type = data.type or 'info',
        duration = data.duration or 5000,
        position = data.position or settings.notification_position,
        theme = settings.notification_theme or 'light'
    })

    -- ox_lib still owns sound
    if not sound then return end

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

    local soundId = GetSoundId()
    PlaySoundFrontend(soundId, sound.name, sound.set, true)
    ReleaseSoundId(soundId)

    if sound.bank then ReleaseNamedScriptAudioBank(sound.bank) end
end
```

{% endcode %}

#### Dark Theme 👇

{% code title="ox\_lib\resource\interface\client\notify.lua" overflow="wrap" lineNumbers="true" fullWidth="false" expandable="true" %}

```lua
local settings = require 'resource.settings'

---`client`
---@param data NotifyProps
---@diagnostic disable-next-line: duplicate-set-field
function lib.notify(data)
    local sound = settings.notification_audio and data.sound
    data.sound = nil

    exports['nm1_notification']:Notify({
        title = data.title or 'Notification',
        message = data.description or '',
        type = data.type or 'info',
        duration = data.duration or 5000,
        position = data.position or settings.notification_position,
        theme = settings.notification_theme or 'dark'
    })

    -- ox_lib still owns sound
    if not sound then return end

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

    local soundId = GetSoundId()
    PlaySoundFrontend(soundId, sound.name, sound.set, true)
    ReleaseSoundId(soundId)

    if sound.bank then ReleaseNamedScriptAudioBank(sound.bank) end
end
```

{% endcode %}
