# Client

The `ak47_lib` automatically detects the running framework. You can access these functions by importing the lib export in your script.

```lua
local Lib47 = exports['ak47_lib']:GetLibObject()
```

### Client Player Data

These functions allow you to access player data directly on the client side, updated automatically when framework events fire.

#### `Lib47.GetJob`

Returns the local player's job data standardized.

```lua
--- @return table { name, label, payment, isboss, grade = { name, level } }
local job = Lib47.GetJob()

if job.name == 'police' then
    print("You are a cop!")
end
```

#### `Lib47.GetPlayerData`

Returns the raw framework-specific player data table (QBCore.PlayerData or ESX PlayerData).

```lua
--- @return table
local data = Lib47.GetPlayerData()
```

#### `Lib47.GetTargetMetaValue`

A utility function to fetch metadata from another player (server-side) via a callback. Useful for checking status like `isdead` or `inlaststand` on a target player.

```lua
--- @param targetServerId number
--- @param metaKey string
--- @return any
local isDead = Lib47.GetTargetMetaValue(targetPlayerId, 'isdead')
```

#### **`Lib47.GetCoreConfig`**

Retrieves the active framework's core configuration table.

```lua
--- @return table The core config table
local config = Lib47.GetCoreConfig()
```

#### **`Lib47.GetIdentifier`**

Returns the unique identifier (CitizenID/Identifier) for the local player directly from the client.

```lua
--- @return string The unique identifier
local identifier = Lib47.GetIdentifier()
```

#### **`Lib47.GetCharacterName`**

Returns the full character name of the local player.

```lua
--- @return string The full name (Firstname Lastname)
local name = Lib47.GetCharacterName()
```

**`Lib47.AddStress` / `Lib47.RemoveStress`**

Modifies the local player's stress levels across frameworks.

```lua
--- @param amount number
Lib47.AddStress(10)
Lib47.RemoveStress(10)
```
