# API

This page documents the public exports and events provided by BDUK.

***

## Events

### bduk:notify

Fires a UI notification  to the client.

```lua
TriggerEvent("bduk:notify", {
    type = "success",
    message = "Item added!",
    header = "Done",
    icon = "fa-solid fa-check-circle",
    duration = 5000,
    match_border = true,
    match_shadow = false
})
```

#### Parameters

* `type`: `"success"`, `"error"`, `"info"`, `"warning"` — *(default: `"info"`)*
* `message`: Body text (required)
* `header`: Optional title
* `icon`: Font Awesome class (e.g. `"fa-solid fa-bell"`)
* `duration`: Time in ms (default `5000`, `0` = sticky)
* `match_border`: Whether to color the border based on type
* `match_shadow`: Whether to color the shadow based on type

***

## Exports

### build

Builds and displays a full BDUK UI layout.

```lua
exports.bduk:build(layout)
```

#### Parameters

* `layout`: The full Lua config table for your UI (see: [**Making Your First UI**](/fivem-free-resources/bduk/guides/making-your-first-ui.md))

***

### notify

Triggers a notification programmatically (same as the `bduk:notify` event).

```lua
exports.bduk:notify({
    type = "error",
    message = "Something went wrong!"
})
```

#### Parameters

* Same structure as `bduk:notify` event (see above)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.boii.dev/fivem-free-resources/bduk/api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
