Documentation menu

Storefront Relay

The Citadel relay client makes player purchases on a Citadel storefront automatically apply CFTools grants (priority queue / whitelist) to a DayZ server — and revoke them when a subscription perk expires. It's purely additive: every other bot feature works the same with or without it.

How it works

player buys a perk on {slug}.sites.citadel-hub.com/store
   → Citadel resolves {{user.steam64}} / form answers
   → enqueues a RelayCommand on the tenant's ExternalService
   → this bot polls the Citadel Command Relay (handshake / get-all / ping)
   → applies it via the CFTools API on the configured server

On boot the bot handshakes (declaring the commands it implements), resyncs any queued commands, then long-polls for new ones. Each command's payload already has its placeholders resolved by the platform, so the bot just reads the values. Application is idempotent and at-least-once — a paid grant is never silently lost.

Configuration

Per server in config/servers.js:

CITADEL_RELAY_ENABLED: true,
CITADEL_API_URL: 'https://api.citadel-hub.com',
CITADEL_SERVICE_ID: 'ext_...',   // the ExternalService id
CITADEL_API_KEY: 'csk_...'       // shown once in the Citadel dashboard

Get CITADEL_SERVICE_ID and CITADEL_API_KEY from the Citadel dashboard: Relays → New relay (the csk_ key is shown only once). That ExternalService represents this game server.

[!WARNING] server. The CFTools application must also be granted access to the server (see Prerequisites).

Command convention

Configure each perk's relay command in the Citadel dashboard Store page (the product editor's "in-game grant" plus a {{user.steam64}} form input):

CommandTypePayloadEffect
AddPriorityQueue{ steam64, days?, comment? }Grant priority queue (days omitted/-1 = permanent)
RemovePriorityQueue{ steam64 }Revoke priority queue
AddWhitelist{ steam64, days?, comment? }Grant whitelist
RemoveWhitelist{ steam64 }Revoke whitelist

Verifying

After enabling, buy a perk on the storefront with a Steam-linked player. The bot logs a line like:

[citadel-relay] applied AddPriorityQueue for 7656… on "My Server"

and the grant appears in CFTools. If nothing happens, check Troubleshooting.

Next: Permissions.