# 03 — Servers & Licensing

Mandatory server registration, Keymasters, license validation and common errors.

# Registering Your Server

# Registering Your Server

Protected Nord Forge resources require the FiveM server to be registered in the customer **Servers** area.

In production, Nord Forge has automatic server binding disabled by default.

## Before registering a server

The account must have at least one **active product license**.

## What to register

Register the server's FiveM `sv_licenseKey`, normally beginning with:

```text
cfxk_
```

Nord Forge accepts either:

```text
cfxk_xxxxxxxxxxxxxxxxx
```

or a pasted configuration line such as:

```cfg
sv_licenseKey "cfxk_xxxxxxxxxxxxxxxxx"
```

## Registration flow

1. Sign in to Nord Forge.
2. Make sure the required product is active in **My Products**.
3. Open **Servers**.
4. Add your server.
5. Enter its FiveM `sv_licenseKey`.
6. Optionally add a display name or hostname.
7. Save the server.
8. Configure the same Keymaster in `server.cfg`.
9. Start the protected resource.

> If the server has not been registered, protected resources are blocked with `server_not_registered_add_keymaster_in_forge`.


# server.cfg Configuration

# server.cfg Configuration

The recommended production configuration is:

```cfg
setr nord_license "FG-XXXX-XXXX-XXXX-XXXX"
setr nord_keymaster "cfxk_xxxxxxxxxxxxxxxxx"
sv_licenseKey "cfxk_xxxxxxxxxxxxxxxxx"
```

## `nord_license`

Contains the customer's global Forge Key.

```cfg
setr nord_license "FG-XXXX-XXXX-XXXX-XXXX"
```

## `nord_keymaster`

Contains the server Keymaster used by Nord Forge validation.

```cfg
setr nord_keymaster "cfxk_xxxxxxxxxxxxxxxxx"
```

## `sv_licenseKey`

This is the normal FiveM server license key.

```cfg
sv_licenseKey "cfxk_xxxxxxxxxxxxxxxxx"
```

The value used for `nord_keymaster` should match the FiveM `sv_licenseKey` registered in Nord Forge.

## Legacy Forge Key fallbacks

Protected loaders first use `nord_license`, while older integrations may support:

```cfg
setr nord_forge_key "FG-XXXX-XXXX-XXXX-XXXX"
```

or:

```cfg
setr forge_key "FG-XXXX-XXXX-XXXX-XXXX"
```

The recommended configuration is always `nord_license`.


# Server Limits & Privacy

# Server Limits & Privacy

The production configuration allows a limited number of active Keymasters per Forge account.

## Default limit

The default platform limit is:

```text
3 active servers / Keymasters per Forge Key
```

The server administrator can change this platform limit with:

```env
NORD_FORGE_MAX_KEYMASTERS=3
```

## One customer per active Keymaster

An active FiveM Keymaster cannot be registered to two different Forge customers at the same time.

If it is already linked elsewhere, Nord Forge returns:

```text
keymaster_already_registered_to_another_forge_key
```

## Raw Keymaster storage

Nord Forge does **not** store the raw `cfxk_` value.

The backend normalizes it and stores a cryptographic hash. The interface can use a masked display value instead of exposing the full key.

## Removing a server

Removing a server changes its registration status to removed.

A protected resource running from that server will no longer validate until the server is registered and active again.


# License Validation Flow

# License Validation Flow

A protected resource validates against the Nord Forge licensing API.

The validation checks:

1. The Forge Key exists and belongs to an active account.
2. The product can be resolved.
3. The product is assigned to the customer.
4. The product license is active.
5. The license has not expired.
6. The FiveM Keymaster is registered and active.
7. The Keymaster belongs to the same Forge customer.

## Session validation

Protected builds can request a temporary session used to unlock protected runtime code.

The current backend returns:

- A temporary decryption key
- A session TTL
- A heartbeat interval
- Release update information
- Active server slot information

Revoking or suspending product access causes later validation/session requests to fail.


# License Error Reference

# License Error Reference

These are the main licensing errors implemented by the current Nord Forge backend.

## `invalid_forge_key`

The Forge Key does not exist or the account is not active.

## `product_not_assigned`

The requested product is not assigned to this customer.

## `license_inactive`

The product license exists but is not active.

## `license_expired`

The product license has expired.

## `missing_keymaster_use_server_cfg_setr_nord_keymaster`

The protected resource did not receive a valid Keymaster.

Check:

```cfg
setr nord_keymaster "cfxk_xxxxxxxxxxxxxxxxx"
```

## `server_not_registered_add_keymaster_in_forge`

The server is not registered in **Forge → Servers**.

Add the server manually before using the protected resource.

## `keymaster_already_registered_to_another_forge_key`

The Keymaster is already active on another Nord Forge account.

## `keymaster_blocked`

The server was previously registered but is currently removed or blocked.

## `keymaster_limit_reached_max_3`

The Forge Key already has the maximum number of active servers under the default limit.

## `product_not_found_for_...`

Nord Forge could not match the requested product/resource to an existing product.