# ApiVault Public Developer Debug API

ApiVault exposes a limited, data-only bridge for external addons.

```lua
local AV = ApiVault and ApiVault.GetPublicAPI and ApiVault:GetPublicAPI("MyAddon", 1)
```

## Safety

```text
- Addon-provided data is treated as data, not code.
- ApiVault does not run addon-provided functions.
- ApiVault does not call protected APIs for external addons.
- ApiVault does not call SetAttribute automatically.
- ApiVault does not read addon source files at runtime.
```

## Basic usage

```lua
local AV = ApiVault and ApiVault.GetPublicAPI and ApiVault:GetPublicAPI("MyAddon", 1)

if AV then
    AV:RegisterAddon({
        name = "MyAddon",
        version = "1.0.0",
        interface = select(4, GetBuildInfo()),
    })

    AV:Log("info", "MyAddon initialized")

    AV:TraceAPI("C_Item.GetItemInfo", {
        file = "MyAddon/Items.lua",
        line = 42,
        context = "Item cache refresh",
    })

    AV:TraceEvent("BAG_UPDATE", {
        file = "MyAddon/Events.lua",
        line = 18,
        registration = "RegisterEvent",
    })
end
```

## Bridge methods

```text
RegisterAddon(metadata)
Log(level, message, context)
ReportError(errorInfo)
TraceAPI(apiName, traceInfo)
TraceEvent(eventName, traceInfo)
ReportSecureRisk(riskInfo)
ReportSavedVariables(svInfo)
Checkpoint(label, data)
StartSession(name)
EndSession(name)
GetReport()
ExportReport()
HasCapability(name)
GetCapabilities()
GetVersion()
```

## Commands

```text
/av devapi
/av debugbridge
/av addondebug
/av reports
/av bugadvisor
```
