Install the bridge resource
The FiveUnity Secure Bridge is a small server-side resource you install on your own FiveM server. It is what turns the settings on the FiveM page into real in-game actions, and what pushes player stats and logs back to Discord.
Where: Dashboard โ Roleplay โ FiveM ยท In Discord: /setup โ FiveM Bridge โ Generate Key
#1. Get the resource
The resource is called fivem-api-resource and is supplied by FiveUnity; there is no download button in the dashboard, so ask FiveUnity support for the current version if you do not already have a copy.
Copy the whole folder into your server's resources directory.
Keep the folder named exactly fivem-api-resource. The bot addresses your server at /fivem-api-resource/โฆ, so a renamed folder means every command fails as if the resource were missing.
#2. Generate your keys
In Discord, run /setup โ FiveM Bridge โ Generate Key. The bot creates both keys, saves them, and replies with a block ready to paste:
set bridge_token "your-inbound-key"
set bridge_outbound_key "your-outbound-key"
set bridge_bot_url "https://YOUR_BOT_HOST:3000"
The dashboard's Rotate keys button does the same, showing the pair once in a Copy keys now panel. Either way the keys are never shown again, so copy them straight into server.cfg.
#3. Configure server.cfg
There is no config file to edit: the bridge reads everything from convars. Put these lines in server.cfg above the ensure line:
# FiveUnity Bridge
set bridge_token "your-inbound-key"
set bridge_outbound_key "your-outbound-key"
set bridge_bot_url "https://the-address-fiveunity-gave-you"
ensure fivem-api-resource
| Convar | What it is |
|---|---|
bridge_token | The inbound bridge key. Every request from the bot carries it, and the bridge rejects anything else. |
bridge_outbound_key | The outbound key, used when your server pushes stats and logs to FiveUnity. If you leave it out, the bridge falls back to bridge_token and prints a warning: set both. |
bridge_bot_url | Where your server sends those pushes. Replace the placeholder from the Generate Key output with the address FiveUnity gave you. It must start with https://, otherwise the bridge refuses to send and logs "Refusing to send credentials to non-HTTPS bridge_bot_url". |
Use set, never setr. setr replicates the value to every connected client, which hands your bridge key to anyone who joins.
Finally, on the dashboard FiveM page, set Server IP to your public game address (for example 203.0.113.10:30120) and turn Integration on.
#4. Framework detection
The bridge detects your framework by itself; there is nothing to configure. On start it looks for Qbox (qbx_core), QBCore (qb-core) and ESX (es_extended), retrying for about 60 seconds and again whenever one of those resources starts. Your server console prints one of:
[FiveUnity] Detected Qbox Framework
[FiveUnity] Detected QBCore Framework
[FiveUnity] Detected ESX Framework
[FiveUnity] No supported framework detected (Qbox/QBCore/ESX). Economy and medical endpoints will be limited.
Individual features look for their own resources on top of that:
| Feature | What it uses |
|---|---|
| Items and inventory | ox_inventory when it is started, otherwise your framework's own inventory. |
| Revive and heal | qbx_medical, then wasabi_ambulance, then qb-ambulancejob (Qbox/QBCore) or esx_ambulancejob (ESX). |
| Clothing menu | illenium-appearance, which must be started. |
| Weather and time | Renewed Weather Sync, then cd_easytime, EasyTime, qb-weathersync or vSync, found by scanning the resource list so a renamed folder such as vSync-1.4.0 still counts. With none of them started, the bridge falls back to your server's own weather / settime commands. |
| Announcements | Nothing extra: works on any server. |
Start your framework before or alongside the bridge. Nothing breaks if it starts later, but detection has to catch up.
Those links are made automatically and re-checked whenever a resource starts or stops. Your console says which one was picked:
[FiveUnity] Weather/time linked to vSync (resource "vSync-1.4.0")
vSync changes the weather on its own every 10 minutes (its dynamic weather). A weather set from Discord holds until that next change; set DynamicWeather = false in vSync's vs_server.lua, or run its /freezeweather command, if you want it to stay.
#Whitelist
With Whitelist switched on for the FiveM page (and a whitelist role picked), the bridge checks every player as they connect: they need Discord linked in FiveM and the whitelist role in your Discord. Anyone else sees a short message saying what to do. Decisions are cached for a minute, so a reconnect does not hit the bot twice. If your server cannot reach the bot at that moment the player is let in and the console warns; add set bridge_whitelist_strict "1" to server.cfg if you would rather refuse joins until the bot answers.
#5. Ports and firewall
The bridge does not open a port of its own: it answers on your FiveM server's main HTTP port, normally 30120. Allow inbound TCP on that port so the hosted bot can reach it, and make sure your server can reach the internet over HTTPS for the outbound pushes.
If your server is only reachable on a private or LAN address, turn on Allow private / LAN addresses on the FiveM page. Link-local and cloud metadata addresses stay blocked regardless.
#6. Test the connection
Restart your server (or ensure the resource), then test from either side:
- Dashboard (Roleplay โ FiveM โ Test bridge. Success reads "Bridge reachable. Framework: QBCore. Weather/time: vSync (vSync-1.4.0). Inventory: ox_inventory.") everything after the framework is a resource the bridge linked itself to.
- Discord:
/setupโ FiveM Bridge โ Test Bridge. Success reads "Success! Bridge Active. Framework: QBCore. Weather/time: vSync (vSync-1.4.0)."
A framework of None means the bridge answered but has not detected Qbox, QBCore or ESX yet. "Weather/time: no sync resource found" means none of the weather resources above is started, so weather and time commands use your server's own console commands.
#What the resource sends back
Once running, the bridge pushes player data on its own: 15 seconds after a player joins, when they disconnect, and for everyone online every 2 minutes. Each push carries the player's name, identifier, cash, bank, job and job grade; this is what /player-info shows as last sync.
Players are matched by their Discord identifier, so a player must have Discord running and linked when they connect for commands that target a Discord user to find them.
Your own server-side scripts can add entries to the log channels by triggering the resource's fiveunity:log* events (or calling its log* exports). All of them are server-only: game clients cannot trigger them, so players cannot forge log entries.
| Event / export | Payload | Log channel |
|---|---|---|
fiveunity:logInventory | src, type, item, count | Inventory log |
fiveunity:logMoney | src or name, type, account, amount, reason | Money log |
fiveunity:logAdmin | staff, action, details | Admin log |
fiveunity:logDeath | victim (or src), killer, weapon, cause | Death log |
fiveunity:logTransaction | from, to, account, amount (required), reason | Transaction log, the channel Money trace reads |
fiveunity:logJob | src or name, type, job, grade | Job log |
fiveunity:logCrime | src or name, type, amount (optional payout), details | Crime log |
Two captures run without any script work: deaths are logged from baseevents:onPlayerDied / onPlayerWasted while bridge_death_events "1" (the default) is set, and with bridge_money_events "1" the bridge also logs framework money events (QBCore OnMoneyChange, ESX addAccountMoney / removeAccountMoney) and job/duty changes (QBCore OnJobUpdate / SetDuty, ESX esx:setJob) into the money and job channels. See the resource README for the full payload shapes and the rate limits (20 money/transaction/job entries and 40 death entries a minute).
#Troubleshooting
| What you see | What it means |
|---|---|
| Unauthorized: Invalid Bridge Token | bridge_token does not match the inbound key saved in FiveUnity. Rotate and re-paste both keys. Your server console prints "Unauthorized access attempts" once a minute. |
| Server Configuration Error: Token not set | bridge_token is missing from server.cfg. The console prints "CRITICAL: bridge_token Convar not set". |
| A connection or timeout error | The bot cannot reach your server. Check the Server IP, that port 30120 is open, and that the resource is started. |
| Endpoint Not Found | The resource is out of date, or the folder was renamed. Reinstall the current version as fivem-api-resource. |
| Too many requests | More than 60 bridge requests arrived in a minute. Wait and retry. |
| Bot API /api/log failed (code 403) in your console | The outbound key does not match, or Integration is switched off in the dashboard. |
| Bot API failed (code 402) in your console | The Discord server has no active subscription, so pushes are refused. |
| Security Audit Failed: No Audit Log Channel configured | Set a General FiveM log channel on the FiveM page. Every action command is blocked until you do. |
| Player not found (Offline?) | The player is offline, or their Discord is not linked in their FiveM identifiers. |
| A 501 on revive, heal or clothing | No medical resource was detected, or illenium-appearance is not started. |