> 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/exports.md).

# Exports

## nm1\_classynotify Documentation

This document describes all available exports provided by the `nm1_classynotify` resource, including client-side and server-side usage, parameters, defaults, supported types, positions, and examples.

The system is framework-compatible and works with ESX, QBCore, QBox, and standalone setups.

***

## Client Exports

### exports\['nm1\_classynotify']:Notify(data)

Displays a notification on the local client.

This is the primary and recommended client export for showing notifications.

***

### Parameters

`data` (table)

| Parameter    | Type    | Required | Default             | Description                  |
| ------------ | ------- | -------- | ------------------- | ---------------------------- |
| title        | string  | No       | "Notification"      | Notification title           |
| description  | string  | Yes      | nil                 | Main notification message    |
| type         | string  | No       | "info"              | Notification type            |
| duration     | number  | No       | 5000                | Duration in milliseconds     |
| position     | string  | No       | Saved/User Position | Notification screen position |
| icon         | string  | No       | nil                 | FontAwesome icon             |
| theme        | string  | No       | "dark"              | Notification theme           |
| sound        | boolean | No       | true                | Plays notification sound     |
| showProgress | boolean | No       | true                | Shows duration progress bar  |

***

## Supported Types

* success
* error
* info
* warning

***

## Supported Positions

* top-right
* top-left
* top-center
* bottom-right
* bottom-left
* bottom-center
* center-right
* center-left

***

## Example (Client)

```lua
exports['nm1_classynotify']:Notify({
    title = 'Success',
    description = 'Data saved successfully.',
    type = 'success',
    duration = 4000
})
```

***

## Example (Custom Position & Icon)

```lua
exports['nm1_classynotify']:Notify({
    title = 'Fuel Warning',
    description = 'Your vehicle fuel is low.',
    type = 'warning',
    position = 'bottom-left',
    icon = 'fas fa-gas-pump'
})
```

***

## Example (Light Theme)

```lua
exports['nm1_classynotify']:Notify({
    title = 'Information',
    description = 'Theme switched successfully.',
    type = 'info',
    theme = 'light'
})
```

***

## Server Exports

Server exports allow notifications to be triggered directly from server-side scripts.

***

### exports\['nm1\_classynotify']:NotifyPlayer(src, data)

Sends a notification to a specific player.

***

### Parameters

| Parameter | Type   | Description             |
| --------- | ------ | ----------------------- |
| src       | number | Player server ID        |
| data      | table  | Notification data table |

***

## Example (Server)

```lua
exports['nm1_classynotify']:NotifyPlayer(source, {
    title = 'Server',
    description = 'You received a server notification.',
    type = 'info'
})
```

***

### exports\['nm1\_classynotify']:NotifyAll(data)

Broadcasts a notification to all connected players.

***

### Parameters

| Parameter | Type  | Description             |
| --------- | ----- | ----------------------- |
| data      | table | Notification data table |

***

## Example (Broadcast)

```lua
exports['nm1_classynotify']:NotifyAll({
    title = 'Announcement',
    description = 'Server restart in 5 minutes.',
    type = 'warning',
    duration = 7000
})
```

***

## Events

### Client Event

```lua
TriggerEvent('nm1_classynotify:client:notify', data)
```

Used internally and can also be triggered manually from client scripts.

***

### Server Event

```lua
TriggerClientEvent('nm1_classynotify:client:notify', src, data)
```

Used internally by server exports.

***

## Notification Features

* Modern animated NUI notifications
* Custom notification positions
* Progress bar support
* Sound effects
* Persistent user settings
* Light/Dark theme support
* FontAwesome icon support
* ox\_lib compatibility
* ESX/QBCore/QBox compatible
* Standalone support

***

## Notes & Behavior

* Saved notification settings are persisted per player
* Position settings automatically apply on resource start
* If `position` is passed in `data`, it overrides the saved position for that notification only
* Theme defaults to `"dark"` if not provided
* Duration is automatically handled by the NUI system
* Notifications are stacked dynamically
* Supports multiple notifications simultaneously

***

## Recommended Usage

Use the export system instead of manually triggering NUI events whenever possible.

Recommended:

```lua
exports['nm1_classynotify']:Notify({
    title = 'Success',
    description = 'Action completed successfully.',
    type = 'success'
})
```

Avoid directly sending raw NUI messages unless modifying the core resource.
