# 7 · Integrations & Bridges

Connect Nord Crafting to Nord Inventory, Nord Staff, targets, notifications, crime organizations and Nord VIP.

# Nord Inventory Integration

Nord Inventory is the recommended inventory for the Nord Crafting ecosystem because it is the target of the new **automatic installation workflow**.

## Recommended startup

```cfg
ensure nord_inventory
ensure nord_crafting
```

## Automatic installation

Use the Nord Inventory auto-installer for Crafting's required inventory setup. This is the only inventory integration for which the documentation should promise automatic installation.

## Other inventories

Crafting includes inventory bridge logic for OX/QS/QB/ESX workflows, but those integrations require manual item/image setup.

## Support wording

A useful rule for customer support is:

> Nord Inventory: automatic installation supported. Third-party inventory: runtime bridge supported where listed, item installation is manual.


# Nord Staff Integration

Nord Crafting exposes its Admin Studio to **`nord_staff`**.

The manifest declares:

```lua
nord_staff_admin_export 'OpenAdminInterface'
```

and the client provides:

```lua
exports('OpenAdminInterface', function(options)
    if type(options) == 'table' and options.probe == true then
        return true
    end

    TriggerServerEvent('nord_crafting:server:adminOpenUI')
    return true
end)
```

## What the integration provides

`nord_staff` can discover/probe the Crafting admin interface and open the same Admin Studio used by `/craftbench`.

This means staff do not need a separate duplicated Crafting admin UI.

## Recommended startup order

```cfg
ensure nord_crafting
ensure nord_staff
```

When Nord Inventory is also used:

```cfg
ensure nord_inventory
ensure nord_crafting
ensure nord_staff
```

## Dependency model

`nord_staff` is **optional**. Nord Crafting remains usable without it through its own admin command and license permission system.


# Inventory Bridge

Crafting centralizes inventory operations in `server/bridge/inventory.lua`.

Public operations include:

- Get item count.
- Add item.
- Remove item.
- Search slots/items.
- Read inventory.
- Read item registry.
- Set metadata where supported.
- Register/open stashes where supported.

## Active bridge types in the package

- `ox`
- `qs`
- `qb`
- `esx`

The exact feature depth varies by inventory. OX has the most direct stash and metadata support in the current generic bridge.

> Automatic installation remains a separate Nord Inventory-only feature; do not confuse it with these runtime bridge operations.


# Target Bridge

```lua
Config.Target = 'auto'
```

Automatic detection order:

1. `ox_target`
2. `qb-target`
3. `qtarget`
4. no target provider

The bridge exposes internal helpers to add/remove local entity targets and a safe-add routine that waits briefly for the entity to exist.

Interaction distance uses:

```lua
Config.UI.CraftDistance
```

when the target provider requires a distance value.


# Notifications, Text UI & Progress

## Notification auto-detection

When `Config.Notify.type = 'auto'`, the current bridge checks:

1. `nord_textui`
2. `codem-supreme-notification`
3. `ox_lib`
4. QBCore
5. ESX
6. console print fallback

## Text UI

Text UI prefers:

1. `nord_textui`
2. `ox_lib`

## Progress

Craft progress supports:

- Nord Text UI progress.
- `ox_lib` progress circle.
- `qb-progressbar`.
- Fallback timer that temporarily freezes the player.

This bridge design allows the core crafting logic to stay independent from the visual notification/progress provider.


# Nord Crime & OpCrimes

```lua
Config.CrimeBridge = 'auto'
```

## Automatic provider choice

The intended automatic behavior is to use `nord_crime` when started and fall back to `op-crime` when appropriate.

Organization-aware benches read organization state from the player and validate access server-side.

Nord Crime integration also provides exports that can create fixed organization benches directly from another resource.

Set:

```lua
Config.CrimeBridge = false
```

to disable organization access integration entirely.


# Nord VIP Integration

Nord VIP support is optional.

```lua
Config.NordVIP = {
    Enabled = false,
    MissionKey = 'crafts',
    MissionProgressPerCraft = 1,
    PassXpPerCraft = 50,
}
```

When enabled and `nord_vip` is started, a successful craft can call:

```lua
exports['nord_vip']:AddPassXpAndMission(
    source,
    passXp,
    missionKey,
    missionProgress
)
```

If the resource is not running, Crafting skips the reward and can log the issue when debug is enabled.