> For the complete documentation index, see [llms.txt](https://docs.boii.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.boii.dev/fivem-free-resources/bdsc/api.md).

# API

The **BOII Development Server Core (BDSC)** exposes a clean, structured API designed to give you controlled access to essential systems - without enforcing how your server should work.

It focuses on **player handling**, **server registry**, and **utility helpers**, giving you full control over your gameplay logic through modular extensions.

***

## What It Covers

The API is split into three main areas:

#### **1. Registry**

Manage the core player lifecycle.

* Create and register player objects
* Retrieve players by source
* Maintain the live player registry

#### **2. Player API**

Interact with a player object via its public-facing interface.

* Add data or methods dynamically
* Sync data to clients when needed
* Trigger save/destroy lifecycle events

#### **3. Utility Functions**

Access core helpers for logging, and translations.

***

## Design Philosophy

BDSC is built for developers who want flexibility without the baggage.

* Clean, minimal API
* Lifecycle and data sync built-in
* Fully extensible from external resources
* No forced framework rules
* No prebuilt gameplay logic

***

## How to Use the API

BDSC exposes its full API via a single namespace import.

#### **Namespace Import**

Use `exports.bdsc:import()` to get access to all available functions and objects:

```lua
local bdsc = exports.bdsc:import()

local player = bdsc.get_player(source)
player:add_data("custom", { foo = "bar" }, true)
```

> All player objects support the full public API, including `add_data`, `run_method`, and `save`.

***

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Player Registry</td><td><a href="/files/p74L34Q7wphkJXWHab48">/files/p74L34Q7wphkJXWHab48</a></td><td><a href="/pages/x3Fl6t9j4MWactzQWlSQ">/pages/x3Fl6t9j4MWactzQWlSQ</a></td></tr><tr><td>Player Object</td><td><a href="/files/KQrHHTGU9BKAX4iXpBCC">/files/KQrHHTGU9BKAX4iXpBCC</a></td><td><a href="/pages/Y5meDzXaD8uaE629pU4y">/pages/Y5meDzXaD8uaE629pU4y</a></td></tr><tr><td>Utility Functions</td><td><a href="/files/4dK946byRmmvxHpcPH1e">/files/4dK946byRmmvxHpcPH1e</a></td><td><a href="/pages/BBgGtpTQvejMJWvFxbKS">/pages/BBgGtpTQvejMJWvFxbKS</a></td></tr></tbody></table>
