> For the complete documentation index, see [llms.txt](https://docs.okokscripts.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.okokscripts.io/lib/okoklib.md).

# okokLib

{% hint style="info" %}
**About okokLib**

okokLib provides a centralized configuration for all our new resources. It automatically detects your framework, inventory, society management system, and other installed okok Scripts resources (such as okokNotify, okokRequests, and okokBanking), allowing you to configure shared settings, such as currency and Discord webhooks, just once in **`okokLib/config.lua`**.
{% endhint %}

## Installation Guide

To install **okokLib**, simply place the resource inside your server's **`resources`** folder and add it to your **`server.cfg`**.

**Important:** **`okokLib`** must always start **after your framework** and **before any other okokScripts resource**.

Make sure your **`server.cfg`** follows this order:

```lua
ensure es_extended # or qb-core / qbx_core

# Start all your other server resources here
ensure oxmysql
ensure ox_inventory
ensure ox_target
# ...

# okok Scripts resources
ensure okokLib
ensure okokBillingV3
```

### Configuration

Open the **`config.lua`** file to customize your settings.

All future okok Scripts resources will use this configuration, meaning **you only need to configure these settings once**.

### Automatic Detection

okokLib automatically detects your server's setup, including:

* **Framework** - ESX, QBCore or Qbox.
* **Inventory** - Automatically detects supported inventory systems.
* **Society Management** - Automatically detects supported society management resources.
* **okok Scripts** - Automatically detects installed okok Scripts resources.

No manual configuration is required for these integrations, although you can override the detected settings if needed.

### Currency Settings

To customize the currency symbol and its position across all supported okokScripts resources, edit **`Config.Currency`** in **`config.lua`**.

These settings will automatically apply to future resources using okokLib.

### Discord Webhooks

Discord webhook settings can be configured directly in **`config.lua`**.

To configure your Discord API, open:

**`server/api.lua`**

Paste your **Discord API key** into the appropriate field.

You can also assign **different webhooks to individual resources**, allowing you to keep your Discord logs organized.

### You're All Set!

Once configured, okokLib will automatically share your settings with all compatible okok Scripts resources.

**Remember:** Always ensure **`okokLib`** starts before any other okok Scripts resource.

### Supported Resources

The following resources currently support okokLib:

* **okokBillingV3**

All future okokScripts releases will include okokLib integration. This list will be updated as more resources become compatible.
