> For the complete documentation index, see [llms.txt](https://docs.noctrastore.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.noctrastore.net/noctra-notify/exports.md).

# Exports

Client exports and server usage for notifications and Text UI prompts.

Noctra Notify exports are client-side. Server resources can send notifications through the provided client event.

## Notify

Displays a notification.

```lua
exports.noctra_notify:Notify({
    type = 'success',
    title = 'Vehicle stored',
    message = 'Your vehicle was stored successfully.',
    duration = 5000,
    position = 'top-right'
})
```

| Field      | Required | Description                                                            |
| ---------- | :------: | ---------------------------------------------------------------------- |
| `type`     |    No    | `success`, `error`, `warning`, or `info`. Defaults to `info`.          |
| `title`    |    No    | Optional heading displayed above the message.                          |
| `message`  |    Yes   | Main notification text. `description` is also accepted.                |
| `duration` |    No    | Display time in milliseconds, from 1000 to 30000. Defaults to 5000.    |
| `position` |    No    | Notification position. Ignored when `Config.ForcePosition` is enabled. |

The compact positional form is also supported:

```lua
-- type, message, duration, title, position
exports.noctra_notify:Notify(
    'error',
    'Action unavailable.',
    5000,
    'Unable to continue',
    'bottom-right'
)
```

Position is the fifth argument and supports the same values as the table form. It is ignored when `Config.ForcePosition` is enabled.

## ShowTextUI

Displays or updates a Text UI prompt and returns its ID.

```lua
local textUiId = exports.noctra_notify:ShowTextUI({
    id = 'garage',
    title = 'Garage',
    text = 'Open garage',
    key = 'E',
    position = 'left'
})
```

| Field      | Required | Description                                                                       |
| ---------- | :------: | --------------------------------------------------------------------------------- |
| `id`       |    No    | Unique prompt ID. Defaults to `default`.                                          |
| `title`    |    No    | Optional prompt heading.                                                          |
| `text`     |    No    | Action text. `label` is also accepted. Defaults to `Interact`.                    |
| `key`      |    No    | Key shown to the player. `bind` is also accepted. Defaults to `E`.                |
| `position` |    No    | `left`, `right`, or `bottom`. Ignored when `Config.ForceTextPosition` is enabled. |

The positional form uses this order:

```lua
-- title, text, key, position, id
local textUiId = exports.noctra_notify:ShowTextUI(
    'Garage',
    'Open garage',
    'E',
    'left',
    'garage'
)
```

Calling `ShowTextUI` again with the same ID updates that prompt. Use different IDs when several prompts need to be visible together.

## HideTextUI

Hides the Text UI prompt with the matching ID.

```lua
exports.noctra_notify:HideTextUI('garage')
```

Store the ID returned by `ShowTextUI` when it is created dynamically:

```lua
local promptId = exports.noctra_notify:ShowTextUI({
    id = 'vehicle_storage',
    text = 'Store vehicle',
    key = 'E'
})

-- Later
exports.noctra_notify:HideTextUI(promptId)
```

## Sending a notification from the server

Use the client event when a server resource needs to notify a player:

```lua
TriggerClientEvent('noctra_notify:client:notify', playerId, {
    type = 'info',
    title = 'System ready',
    message = 'Your session is now active.',
    duration = 5000
})
```

The data table accepts the same fields as the `Notify` export.

Text UI prompts should be controlled by a client resource. If a server action needs to show one, trigger an event in your own client script and call `ShowTextUI` there.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.noctrastore.net/noctra-notify/exports.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
