> For the complete documentation index, see [llms.txt](https://docs.nm1scripts.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nm1scripts.in/classy-series/advanced-classy-notification/intergrations/esx.md).

# ESX

es\_extended/client/functions.lua  \[Search **function ESX.ShowNotification** ]

{% code title="es\_extended/client/functions.lua" overflow="wrap" lineNumbers="true" fullWidth="false" expandable="true" %}

```lua
---@param message string The message to show
---@param notifyType? string The type of the notification
---@param length? number The length of the notification
---@param title? string The title of the notification
---@param position? string The position of the notification
---@return nil
function ESX.ShowNotification(message, notifyType, length, title, position)

    local typeMap = {
        [0] = 'info',
        [1] = 'success',
        [2] = 'error',
        [3] = 'warning',
    }

    local resolvedType = typeMap[notifyType] or notifyType or 'info'

    local success = pcall(function()
        exports['nm1-classynotify']:Notify({
            type = resolvedType,
            message = message,
            title = title,
            duration = length or 5000,
            position = position or 'top-right'
        })
    end)

    if not success then
        print('^1[nm1-classynotify]^7 Failed to send notification. Is the resource started?')
    end
end
```

{% endcode %}
