> 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>


---

# 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 dynamically by asking a question.

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

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
