Skip to main content
Every export is called on awoken_bridge. Nothing here decides whether something may happen, only who carries it out.

Check the contract first

api is the contract and only changes when an existing function changes shape or disappears. resource is the build number, which is what belongs in the error: “needs api 2, found 1” is only actionable once you know which bridge is installed. Backends() returns what was actually picked for each job, which is worth printing at boot in any script that genuinely cannot work without, say, an inventory.
Both exist on the client too. The client’s Backends() reports the client-side jobs: interaction, keys, fuel and so on.

Server

Players and jobs

CountPolice and PoliceSources only count officers who are on duty. An off-duty officer does not make a robbery startable, and does not receive the call for it.
GetGang and GetGangs return nothing on ESX, which has no gangs. Ask unconditionally and treat nil as “not in one”.

Money

Accounts are named in your words, cash, bank and black_money, and translated inside each backend. ESX calls cash money and keeps the other two as accounts; qb keeps all three in one table. Neither spelling leaks out.
RemoveMoney refuses rather than taking an account negative, so check its return instead of calling HasMoney first.

Needs and stress

GetNeeds returns nil where the framework has no such idea. That is a different answer from 0, which means starving.

Inventory

ItemSlots returns an empty table on an inventory with no idea of metadata, so it can be asked unconditionally.

Stashes and shops

Registering is the server’s half. The client opens a stash or shop by the same id or name, see Client. OnStashChange drops its hook when the resource that asked for it stops, so restarting your script does not leave a dead callback firing.

Dispatch and evidence

DropObservation is only backed by Awoken Evidence. Other evidence systems ignore it, and SupportsObservations() tells you which you are on.

Phone and vehicles

Society and tax

Skills and XP

The skill name is yours. Servers name these differently, and on DevHub it is a category uid rather than a display name.

Activity, locks and cooldowns

Logs

Client

OpenBossMenu opens qbx_management on QBox. On a framework the bridge has no boss menu for it returns false, so a script can fall back to its own.

Events

Each backend normalises its framework’s own lifecycle events into these, so you listen once rather than carrying three spellings.
moneyChanged carries no amount. The frameworks disagree about what they hand over, and a balance worth showing has to be read back from the server anyway, so it only says to go and look again.

Behaviour worth knowing

Ask before letting somebody start, claim once they have. Claiming during the check leaks a slot on every later refusal.
The category is a free string, so a boosting script passes 'boosting' and needs nothing added to the bridge. The ceiling is off by default, so installing the bridge does not quietly change how much crime your server allows.Activities expire after Config.Activity.timeout minutes, and a script stopping returns its slots, so one that errors before finishing does not hold a slot until the next restart.
Two scripts taking 'heist' cannot both run, and neither has to know the other exists. That is the point of them living here rather than in a script.Locks are named, so a bank job does not block a shoplift unless you ask for the same name. They also expire, five minutes by default or whatever you pass, so a script that throws before releasing cannot wedge every heist on the server.
Call StartGlobalCooldown() and GlobalCooldownLeft() unconditionally. Both do nothing for a resource that is not listed in Config.GlobalCooldown.resources, so the server owner decides whether they mean anything. The resource name is taken from the caller, so a script cannot start or dodge somebody else’s timer.
Treat a minimum of 0 as “no gate” rather than comparing blindly, or a server without one refuses everybody over experience they have no way to earn.
Do not pass resource. A script should not have to name itself correctly to get its own channel.Where an entry goes, in order: a destination the entry carries as key, then a channel it named, then the calling resource’s own channel, then the fallback. A channel name that does not exist still sends, to the fallback, because losing the entry is worse than filing it in the wrong place.
Zones are the one place a function crosses a resource boundary. Restarting the bridge drops every zone a script registered, so rebuild yours on awoken_bridge:started.

Adding a backend

Every file under modules/ ships readable, one per resource the bridge talks to. That is deliberate: they are glue against somebody else’s public API, and a server on a fork or a newer build needs to be able to fix one rather than wait for us.
1

Write the file

modules/dispatch/your_resource.lua. Copy the nearest existing adapter and change what it sends. Every one starts the same way:
The contract each backend has to satisfy is documented at the top of that folder’s main.lua.
2

List it in fxmanifest.lua

An unlisted backend never loads and auto simply never picks it, with nothing in the console to say so.
3

Name it in config

config/core.lua
Naming it is what loads it, so auto detection never having heard of it does not matter.
If it is a public resource rather than something in-house, send it to us and we will ship it for everyone.