> ## Documentation Index
> Fetch the complete documentation index at: https://docs.leaderos.net/llms.txt
> Use this file to discover all available pages before exploring further.

# LeaderOS Connect

> Connect your FiveM server to LeaderOS, enabling you to execute commands on your server directly from the website.

## Download

[https://www.leaderos.net/plugin/fivem](https://www.leaderos.net/plugin/fivem)

## Source Code

[https://github.com/leaderos-net/fivem-leaderos-connect](https://github.com/leaderos-net/fivem-leaderos-connect)

## Installation

### Step 1: Download the Script

1. [Download](https://www.leaderos.net/plugin/fivem) the ZIP file.

### Step 2: Extract and Upload

2. Extract the contents of the downloaded ZIP file.
3. Upload the `leaderos_connect` folder to your server's `resources` directory (e.g., `resources/leaderos_connect`).

### Step 3: Configure the Server

4. Open your server's `server.cfg` file and add the following lines:

   * `ensure leaderos_connect`: Ensures the script starts with your server.
   * `add_ace resource.leaderos_connect command allow`: Grants the script permission to execute server commands.

### Step 4: Configure the Script

5. Open `resources/leaderos_connect/config.js` and configure the following settings:
   * `websiteUrl`: The URL of your LeaderOS-based website. Example: `https://example.com`
   * `apiKey`: Your website's API key. You can find this in your LeaderOS control panel under **Dashboard > Settings > API**.
   * `serverToken`: The unique token for your server. You can find this in your LeaderOS control panel under **Dashboard > Store > Servers > \[Your Server] > Server Token**.
   * `checkPlayerOnline`: If set to `true`, commands for offline players will be queued and executed when they join. If set to `false`, commands are executed immediately regardless of player status.
   * `lang`: The language for system messages. Supported languages: en, tr

### Step 5: Restart Your Server

6. Restart your FiveM server to apply the changes.

* If everything is configured correctly, you should see the following message in the server console: `[LeaderOS Connect] Successfully connected to the server!` (or the equivalent in your selected language).

## Troubleshooting

* **Website URL Error**: If you encounter a URL error, ensure your URL starts with `https://` and does *not* end with a trailing `/`.
* **API Key/Server Token Error**: Double-check that both values are copied correctly from your LeaderOS panel.
* **Permission Error**: Ensure you have added the `add_ace` line to your `server.cfg` file.
* **Resource Not Starting**: Check the server console for error messages and confirm that the folder is named `leaderos_connect` and located in the correct directory.
