# Install the resource

Download the fivedash resource, add it to server.cfg, set up config.lua and link your city to the dashboard.

Source: https://fivedash.fivex.gg/docs/en/getting-started/install-resource

The **fivedash** resource links your FiveM city to the dashboard. It detects the framework on its own and applies in game what FiveDash decides: it grants and removes whitelist (including for people who leave Discord), delivers store purchases to the player's ID and sends your scripts' logs. This page is for whoever runs the server (owner or admin) and has access to the city's files.

## Before you start

* The **Owner** or **Admin** role in the organization. Members see **Only the organization's owners and admins can connect the server.**
* The organization must have an active plan or be in its trial. See [Plans and billing](https://fivedash.fivex.gg/docs/en/getting-started/plans-and-billing).
* Access to the FiveM server's `resources` folder and `server.cfg`.
* Your city's framework started before fivedash. For whitelist and store delivery, a started MySQL driver: `oxmysql`, `mysql-async` or `ghmattimysql`.

> Each server's modules (Discord, Store, Logs, Rules, CDN) stay closed until the resource connects for the first time. When you open one, the **Connect** + server name screen appears, with the subtitle **One step before setting up the modules**. The server's **Overview** is always open.

## Where to connect

There are two ways in. Both show the same steps.

| Path                     | How to get there                                                                                                      |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------- |
| From the lock screen     | Open any of the server's modules (e.g. **Discord**). The **Connect** + server name screen shows instead of the pages. |
| From the server overview | **Server → Overview** → **Game connection** card → **Connect server**. The **Connect the server** window opens.       |

## Install and connect

### Generate the server's key

Click **Generate key**. The key starts with `fdk_` and comes inside the resource download.

### Download the resource

Under **Download the resource**, click **Download fivedash.zip**. It comes with this server's key in `config.lua` and works with any framework.

### Extract the fivedash folder into resources

Unzip it and put the `fivedash` folder inside the server's `resources`. Keep the folder name `fivedash`. Already had the resource? Just paste the key into `fivedash/config.lua` (see below).

### Start the resource in server.cfg, after the framework

Add the line below to `server.cfg`, after the line that starts your framework.

### Restart the server

Restart the city, or type `refresh` and then `ensure fivedash` in the console. The screen shows **Waiting for the server to connect…** and switches to **Connected** on its own. The modules open right away.

The `server.cfg` line:

```bash
# after your framework (e.g. ensure qb-core, ensure es_extended, ensure vrp)
ensure fivedash
```

If you already had the resource, the line to paste into `fivedash/config.lua` is:

```lua
Key = "fdk_xxxxxxxx",
```

> The key is only shown when it's generated and gives access to the server on FiveDash. Don't share `config.lua`. If you lose the key, generate another one: the old one stops working right away.

## config.lua

The `fivedash/config.lua` file is read by the server only: it's never sent to players. After changing something, type `restart fivedash` in the console.

```lua
FiveDash = {
	Key = "fdk_xxxxxxxx",
	Framework = "auto",
	AutoUpdate = true,
	Debug = false,
}
```

| Field        | What it does                                                                                                                            | Default                                          |
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| `Key`        | The dashboard key, generated in **Server → Game connection → Connect server**. Without it, the server doesn't connect to FiveDash.      | Empty (the dashboard's download comes filled in) |
| `Framework`  | The city's framework. `"auto"` detects it. To force one: `"creative-enchanted"`, `"qbox"`, `"qbcore"`, `"esx"`, `"ox-core"` or `"vrp"`. | `"auto"`                                         |
| `AutoUpdate` | Installs new versions of the resource by itself. `config.lua` stays as it is.                                                           | `true`                                           |
| `Debug`      | Prints every sync and command in the console.                                                                                           | `false`                                          |

Two more settings files ship next to `config.lua`: `loja.lua` (store purchase delivery) and `logs.lua` (logs sent through the export). See [In-game delivery](https://fivedash.fivex.gg/docs/en/store/in-game-delivery) and [FiveM resource](https://fivedash.fivex.gg/docs/en/developers/fivem-resource).

> Updates never remove or change what you wrote in these files. New options show up at the end of the file by themselves, and a copy of the original is kept as `config.lua.bak`.

## Supported frameworks

With `Framework = "auto"`, the resource looks for the framework on its own. Today it recognizes:

| Framework                  | Value to force it      |
| -------------------------- | ---------------------- |
| Creative Network Enchanted | `"creative-enchanted"` |
| Qbox                       | `"qbox"`               |
| QBCore                     | `"qbcore"`             |
| ESX                        | `"esx"`                |
| ox_core                    | `"ox-core"`            |
| vRP / vRPex                | `"vrp"`                |

With no known framework, the dashboard connection works, but the whitelist stays on Discord and the store only delivers commands. Details for each one in [Frameworks](https://fivedash.fivex.gg/docs/en/developers/frameworks).

## How the resource shows in the dashboard

In **Server → Overview**, the **Game connection** card shows the city's state.

| Field                      | What it shows                                                                                                                                         |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| Status                     | **Connected**, **Disconnected** or **Waiting for the server**. The server counts as connected while the last sync is recent (up to about 75 seconds). |
| **Framework**              | The detected framework, or **None detected**                                                                                                          |
| **Whitelist via FiveDash** | **Active**, **Unavailable** or **Not supported yet**                                                                                                  |
| **Last sync**              | **Never**, **just now**, **1 minute ago**, **N minutes ago**, **N hours ago**                                                                         |
| **Resource**               | The installed resource version                                                                                                                        |

| Button                          | What it does                                                                                                                                                             |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Generate new key**            | Creates another key. The old one stops working.                                                                                                                          |
| **Disconnect**                  | Asks for confirmation (**Disconnect the server?**). The current key stops working and whitelist unlocks go back to Discord only. To connect again, generate another key. |
| **Download the latest version** | Downloads the newest resource without a key in `config.lua`                                                                                                              |

When a new version is out, the card tells you: the server downloads it on its own and it takes effect on the city's next restart (or with a console command). `config.lua` stays as it is.

## Server console commands

| Command            | What it does                                                                                                                                  |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `fivedash status`  | Shows the framework, the dashboard connection state, the server in FiveDash, the language, the syncs and store deliveries waiting for players |
| `fivedash detect`  | Looks for the framework again and shows the evidence found                                                                                    |
| `fivedash store`   | Store delivery commands (`fivedash loja` also works)                                                                                          |
| `fivedash logs`    | Logs commands                                                                                                                                 |
| `restart fivedash` | Reloads the resource after changing `config.lua` or to apply a downloaded version                                                             |

## FAQ

**Do I need one key per server?** Yes. Each server in the organization has its own key. Using the same key on two servers running at the same time makes the dashboard refuse the connection.

**Can I use convars instead of config.lua?** Yes. `fivedash_key`, `fivedash_framework`, `fivedash_debug` and `fivedash_locale` work and take priority over the file. Use `set`, never `sets`, so the key doesn't become public.

**The console says the key doesn't look right.** The key must start with `fdk_`. Copy it again or generate another. See [Troubleshooting](https://fivedash.fivex.gg/docs/en/help/troubleshooting).

## Next steps

[Discord bot](https://fivedash.fivex.gg/docs/en/discord/bot)

Connect your city's bot.

[In-game delivery](https://fivedash.fivex.gg/docs/en/store/in-game-delivery)

How purchases reach the player.

[Frameworks](https://fivedash.fivex.gg/docs/en/developers/frameworks)

What each framework supports.

[Troubleshooting](https://fivedash.fivex.gg/docs/en/help/troubleshooting)

A resource that won't connect or sync.
