> ## Documentation Index
> Fetch the complete documentation index at: https://zyra-store.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Compatibility with ESX, QBCore, and Standalone on FiveM

> Learn how to configure Zyra Store scripts with ESX, QBCore, or Standalone mode. Includes code examples and considerations per framework.

Zyra Store scripts are designed to work with the most popular FiveM frameworks: **ESX**, **QBCore**, and **Standalone**. Each operating mode requires a specific configuration in the `shared/config.lua` file. In this guide you will find configuration details, code examples, and important considerations for each framework.

> [tab] ESX
>
> ## Configuration with ESX
>
> To use the script with ESX, set the following value in `shared/config.lua`:
>
> ```lua shared/config.lua theme={null}
> Config.Framework = 'esx'
> ```
>
> **Prerequisite:** The `es_extended` resource must be active and loading **before** the Zyra Store script in your `server.cfg`.
>
> ### ESX integration example
>
> The following snippet shows how Zyra Store scripts access the ESX shared object and react to the player load event:
>
> ```lua client/main.lua theme={null}
> local ESX = exports['es_extended']:getSharedObject()
>
> AddEventHandler('esx:playerLoaded', function(xPlayer)
>     -- The player has loaded correctly
>     TriggerEvent('zyra:onPlayerReady', xPlayer.identifier)
> end)
> ```
>
> ### ESX Legacy vs ESX 1.9+
>
> > [!NOTE]
> >
> > If you use **ESX Legacy** (versions prior to 1.9), some events and functions may differ slightly. Zyra Store scripts are optimized for **ESX 1.9 or higher**. If you experience problems with an older version, it is recommended to update `es_extended` to the most recent version before continuing.

> [tab] QBCore
>
> ## Configuration with QBCore
>
> To use the script with QBCore, set the following value in `shared/config.lua`:
>
> ```lua shared/config.lua theme={null}
> Config.Framework = 'qbcore'
> ```
>
> **Prerequisite:** The `qb-core` resource must be active and loading **before** the Zyra Store script in your `server.cfg`.
>
> ### QBCore integration example
>
> The following snippet shows how Zyra Store scripts obtain the main QBCore object and react to the player load event:
>
> ```lua client/main.lua theme={null}
> local QBCore = exports['qb-core']:GetCoreObject()
>
> RegisterNetEvent('QBCore:Client:OnPlayerLoaded', function()
>     -- The player has loaded correctly
>     TriggerEvent('zyra:onPlayerReady', QBCore.Functions.GetPlayerData().citizenid)
> end)
> ```
>
> ### Notes on QBCore
>
> > [!NOTE]
> >
> > Zyra Store scripts are compatible with **QBCore 1.3 or higher**. Make sure to keep `qb-core` updated to guarantee compatibility with the latest features and security fixes.

> [tab] Standalone
>
> ## Configuration in Standalone mode
>
> Standalone mode allows you to use Zyra Store scripts **without any additional framework**. It is ideal for servers that do not use ESX or QBCore, or for independent test environments.
>
> Set the following value in `shared/config.lua`:
>
> ```lua shared/config.lua theme={null}
> Config.Framework = 'standalone'
> ```
>
> In this mode, the scripts dispense with any framework shared object and use **only native FiveM events**.
>
> ### Standalone integration example
>
> The following snippet shows the use of a native FiveM event to manage player connections:
>
> ```lua server/main.lua theme={null}
> AddEventHandler('playerConnecting', function(name, setKickReason, deferrals)
>     deferrals.defer()
>     -- Player validation logic
>     print('[Zyra] Player connecting: ' .. name)
>     deferrals.done()
> end)
> ```
>
> ### Standalone mode considerations
>
> * No `es_extended`, `qb-core`, or any other framework is required.
> * Functions related to player data (money, job, identity) will not be available unless you implement your own logic.
> * Scripts that depend on an external inventory (such as `ox_inventory`) remain compatible independently of the framework.

## Switching frameworks

If you need to change your server's framework (for example, migrating from ESX to QBCore), **it is not necessary to reinstall the script**. Simply update the `Config.Framework` value in the resource's `shared/config.lua` file and restart the resource:

```lua shared/config.lua theme={null}
-- Change this value according to your current framework
Config.Framework = 'qbcore'  -- Previously was 'esx'
```

Then restart the resource from the server console or txAdmin:

```text theme={null}
restart zyra-mi-script
```

Zyra Store scripts automatically detect the configured framework at initialization and load the corresponding functions without needing to modify any other files.

> [!WARNING]
>
> **Do not mix framework values.** You must set exactly **one single value** in `Config.Framework`. Leaving the field empty, with an incorrect value, or with references to multiple frameworks will cause runtime errors and unexpected script behavior.

***

See also: [Configuration file](https://zyra-store.mintlify.site/en/configuration/config-file.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.