> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fascripts.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrations

> Connect FA Shop Robbery to inventory, dispatch, minigame, shop, and logging resources.

FA Shop Robbery keeps editable adapters inside `bridge/`. Select a built-in integration in `config/config.lua`, or choose `custom` and adapt the matching bridge.

<Columns cols={2}>
  <Card title="Inventory" icon="box-open">Item checks, capacity checks, rewards, removal, and standalone currency items run on the server.</Card>
  <Card title="Dispatch" icon="tower-broadcast">Robbery alerts route through the selected client dispatch adapter.</Card>
  <Card title="Minigames" icon="gamepad">Register, legacy safe, keypad, and drill adapters can be changed independently.</Card>
  <Card title="Logging" icon="file-lines">Send server events to console, Discord, ox\_lib, FiveManage, Fivemerr, or a custom export.</Card>
</Columns>

## QB-Shops v1.5.0

The included replacement supports the official `qbcore-framework/qb-shops` v1.5.0. It attaches the normal shop interaction to the FA clerk and prevents a duplicate shop ped.

<Warning>
  The replacement is version-specific. Do not install it over an unknown or modified QB-Shops fork without comparing its `client/main.lua` first.
</Warning>

<Steps>
  <Step title="Back up QB-Shops">Back up `qb-shops/client/main.lua`.</Step>
  <Step title="Copy the integration">Copy `fa_shoprobbery/integrations/qb-shops/client/main.lua` over `qb-shops/client/main.lua`.</Step>
  <Step title="Restart both resources">Restart `fa_shoprobbery` and `qb-shops`, or restart the server. No store ID or resource-order changes are required.</Step>
  <Step title="Run the acceptance test">Confirm one clerk appears, the shop opens while the clerk is idle, the interaction disappears during a robbery, and it returns after a reset.</Step>
</Steps>

The adapter matches each enabled FA clerk to the nearest ped-based QB-Shops location within two metres. Read the client console summary after startup.

## Clerk API for custom shops

Use the [client export reference](/scripts/shop-robbery/exports) for the canonical signatures, return values, and lifecycle events. The API is client-side only.

```lua theme={null}
canInteract = function()
    return exports['fa_shoprobbery']:CanUseClerkShop('ltd_grove')
end
```

Do not cache clerk entities permanently. Subscribe to the documented lifecycle events and refresh your target when the clerk is created, changes state, or is removed. Purchases and prices must remain server-authoritative in your shop resource.

## Custom adapters

<AccordionGroup>
  <Accordion title="Custom inventory" icon="box-open">Select `Config.Inventory = 'custom'`, then implement `HasItem`, `CanCarryItem`, `AddItem`, and `RemoveItem` in `bridge/server/inventory.lua`.</Accordion>
  <Accordion title="Custom dispatch" icon="tower-broadcast">Select `Config.Dispatch = 'custom'`, then connect your alert export in `bridge/client/dispatch.lua`.</Accordion>
  <Accordion title="Custom minigame" icon="gamepad">Select `custom` in `Config.Minigames`. Implement the register, legacy safe, keypad, or drill path in `bridge/client/minigames.lua`.</Accordion>
  <Accordion title="Custom punishment" icon="gavel">Extend `ServerEditable.Punish` in `bridge/server/punish.lua` to connect an anticheat ban, screenshot, staff alert, or audit flow.</Accordion>
</AccordionGroup>

<Note>
  Test every custom or paid-resource adapter in a live FiveM server. A clean startup does not prove that another resource's current exports match the included adapter.
</Note>
