# Dashboard Setup

### 🔧 1. Configure the Bot API

Before connecting to the dashboard, you must enable the built-in API in your bot's configuration.

1. Navigate to the `Configs` folder in your bot's directory.
2. Open the `api.yml` file.
3. Update the following settings:
   * **Enabled**: Set this to `true`.
   * **Port**: Enter the port for your API (default is `3000`). This is usually a port allocated to you by your hosting provider. Ensure this port is open on your firewall.
   * **SecretKey**: Enter a secure, random string. **Keep this private**, as it grants access to your bot's data. You do not need to share this key, you can add other users to your bot directly via the dashboard.

```yaml
API:
  Enabled: true
  Port: 3000
  SecretKey: "YOUR_SECURE_KEY_HERE"
```

4. **Restart your bot** to apply these changes.

***

### 🌐 2. Link to the Dashboard

Once your API is running, you can connect it to the web interface.

1. Visit the SupportBot Dashboard: [supportbot.emeraldsrtv.dev](https://supportbot.emeraldsrtv.dev)
2. Navigate to the **Connect** or **Add Bot** section.
3. Enter your connection details:
   * **Bot IP/Domain**: The address where your bot is hosted followed by the port. (example: `http://123.45.67.89:3000`).
   * **Secret Key**: The `SecretKey` you defined in your `api.yml`.
4. Click **Connect**.

***

### ❓ Troubleshooting

* **Connection Refused**: Double-check that your bot is running and that the `Port` is correctly opened in your server's firewall.
* **Unauthorized Error**: Ensure the `SecretKey` on the dashboard exactly matches the one in your `api.yml`.
* **Dashboard Not Loading**: Ensure you are using the correct URL: [supportbot.emeraldsrtv.dev](https://supportbot.emeraldsrtv.dev).

For further assistance, join our [Discord Support Server](https://emeraldsrv.dev/discord).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://emerald-services.gitbook.io/emeraldsrv/bots/supportbot/dashboard-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
