> For the complete documentation index, see [llms.txt](https://docs.tebex.io/creators/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tebex.io/creators/tebex-control-panel/game-servers/fivem/fivem-server-wrapper.md).

# FiveM (Server Wrapper)

The **Tebex Server Wrapper** for FiveM simplifies the process of delivering in-game rewards and perks to players, enhancing your Tebex Store experience. Once installed and configured, players can redeem their purchases using a unique Transaction ID directly in-game.

***

### Overview

* **Players use:** `/redeem [Transaction ID]`
* **Transaction IDs look like:** `tbx-xxxxxxxx-xxxx`
* **Found in:** Payment confirmation page and email
* **Purpose:** To automatically deliver packages purchased via Tebex without relying on a direct Tebex plugin or RCON.

***

### Prerequisites

Before installing the wrapper:

1. You must have a **Tebex Store** connected to your **FiveM server**.\
   ➤ Follow the official setup guide to connect your server.
2. Ensure your server supports **MySQL**, as the wrapper requires it for tracking transactions.

***

### Installation Instructions

#### 1. Download and Install the Wrapper

* Download the [wrapper from this link](https://github.com/najeetpie/nass_serverstore).
* Place the unzipped folder into your server’s `resources` directory.
  * Rename the folder to:

    ```bash
    nass_serverstore
    ```
  * Remove any `-main` suffix from the folder name if present.

***

#### 2. Import Database Structure

* Locate the `codes.sql` file inside the wrapper package.
* Import it into your server's **MySQL database** using your preferred tool (e.g., phpMyAdmin, HeidiSQL).

<figure><img src="/files/JCre7VULxJEjwEFn4ZJ4" alt=""><figcaption></figcaption></figure>

***

#### 3. Configure Your Server

* In your `server.cfg`, add:

  ```cfg
  ensure nass_serverstore
  ```

<figure><img src="/files/WToMo3oVDfd1wEKzzSFv" alt=""><figcaption></figcaption></figure>

***

#### 4. Configure Tebex Packages

For each package you want to support with the wrapper:

* In your Tebex Control Panel, go to **Packages > Edit Package > Commands**.
* Add the following command:

  ```json
  purchase_package_tebex {"transid":"{transaction}", "packagename":"{packageName}"}
  ```

  > ⚠️ **Important:** Do not modify the variable placeholders. Use them exactly as shown.
* Click the ⚙️ gear icon next to the command and set:
  * **Require Player to be Online:** `Execute the command even if the player is offline`
* Press **Update** to save changes.

<figure><img src="/files/lFGKLwyxwox3tBtzBaoC" alt=""><figcaption></figcaption></figure>

***

#### 5. Configure the Wrapper Script

* Open the `config.lua` file located inside the `nass_serverstore` script folder.
* Define your package details and settings there.

<figure><img src="/files/0rVxoKIq8zQaGiDEP8Xv" alt=""><figcaption></figcaption></figure>

***

### Testing the Setup

Once everything is in place:

1. Make a test purchase on your Tebex store.
2. In the FiveM server, enter the following command as a player:

   <pre class="language-bash"><code class="lang-bash"><strong>/redeem tbx-12345678-91011
   </strong></code></pre>

If set up correctly, the purchased items or commands will be delivered to the player.

***

### Notes

* This setup bypasses the need for direct command polling by using the redeem flow.
* Ideal for creators who want a lightweight integration or custom control over redemptions.
* For more advanced automation, consider combining this with Tebex Plugin or RCON options.

***

### FAQs

**Q: Can I use both this wrapper and the native FiveM Tebex integration?**\
A: It’s recommended to use one method consistently to avoid conflicts.

**Q: What if the command doesn’t work?**\
A: Verify:

* The `tebexSecret` is set properly.
* The database was imported successfully.
* You’re using a valid `tbx-` transaction ID.

<br>
