Extensions API
Overview

Overview

Extensions can add custom fields to the entry overview section. When an entry is selected, powhttp calls the extension to get the display value for each registered field.


OverviewNode

Overview registrations use a tree structure called OverviewNode. A node is either a field with a unique ID and label or a section containing child nodes.

type OverviewNode =
  | { type: "field"; id: string; label: string }
  | { type: "section"; label: string; children: Array<OverviewNode> };

Sections create collapsible groups. Fields represent individual values with unique IDs that are referenced in handler callbacks.


overview/extend

Registers new fields in the overview section. Accepts an OverviewNode tree to define fields and sections.

Parameters: OverviewNode

Result: null

Example:

{
    "type": "section",
    "label": "My Extension",
    "children": [
        { "type": "field", "id": "status", "label": "Status" },
        { "type": "field", "id": "latency", "label": "Latency" }
    ]
}

overview/remove_field

Removes a previously registered overview field by its ID. If the removal causes a section to become empty, the section is also removed.

Parameters:

{
  fieldId: string;
}

Result: null


Handler Callbacks

These methods are called by powhttp on the extension when it needs values for registered overview fields. The extension must implement these handlers to supply display text.


overview/get_field_value

Called when powhttp needs to display the value for a registered overview field. Return a string to display or null if no value is available for this entry.

Parameters:

{
  fieldId: string;
  sessionId: string;
  entryId: string;
}

Result: Option<string>