Skip to content
Skip to article

Settings contract v1

On this page

Widgets and tools can declare per-instance settings. These values make two instances of the same type different. For example, a setting can select the Jira board that a widget shows, or the project that a kanban tool tracks. Helm shows the settings form. The extension receives the validated values.

Declare settings

In the manifest, settings is an array of fields. The maximum is 24 fields.

Code
"settings": [
  { "id": "board", "type": "select", "label": "Board", "required": true,
    "options": { "from": "connection", "connection": "jira", "call": "boards" } },
  { "id": "columns", "type": "choice", "label": "Columns", "multiple": true,
    "options": ["To do", "In progress", "Review", "Done"], "default": ["To do", "In progress"] },
  { "id": "mine", "type": "checkbox", "label": "Only my issues", "default": true },
  { "id": "limit", "type": "number", "label": "Max issues", "min": 1, "max": 100, "step": 1, "default": 20 },
  { "id": "jql", "type": "text", "label": "Extra JQL filter", "placeholder": "labels = ui", "multiline": false }
]

Common properties

PropertyTypeNotes
idstring^[a-zA-Z][a-zA-Z0-9_-]{0,63}$, unique in the manifest
typetext | select | choice | checkbox | number
labelstring ≤ 120Helm shows it above the control
helpstring ≤ 400Optional help text below the control
requiredbooleanThe default is false. A checkbox is never required, because false is a valid value
defaultper typeHelm validates it as it validates a user value. A default value does not give consent to do an action
groupstring ≤ 60Optional section heading. Helm puts consecutive fields with the same group together

Field types

TypeValueExtra propertiesControl
textstring ≤ 2000placeholder, multiline (bool), pattern (regex), maxLengthInput or textarea
selectstringoptions (see below)Dropdown, one value
choicestring, or string[] when multipleoptions, multiple (bool), min/max selectionsRadio group, or checkbox group when multiple
checkboxboolean—Single checkbox/toggle
numberfinite numbermin, max, step (> 0), unit (string ≤ 16)Number input

Options

For select and choice, options is one of these:

  • A static array. The items are strings (1–100, unique, each ≤ 200 characters) or { "value": string, "label": string } objects.
  • A dynamic source: { "from": "connection", "connection": "<id>", "call": "<call-id>" }. Helm gets the options through a connection that the same manifest declares (see connection.md). The call must return [{ value, label }].

For a dynamic source, Helm shows a loading state, and an error with a retry button. If a saved value is not in the options, Helm keeps it and marks it "unavailable". Helm does not remove it without a notice.

Rules

  • Do not keep secrets in settings. API tokens and passwords belong to the connection. Helm keeps them outside the workspace (see connection.md). Validation refuses a field whose id or label suggests a secret (token, password, secret, key).
  • Helm saves the settings of each instance with the dashboard layout or the tool tab. Users can edit the settings. Changes apply immediately, without a restart.
  • If required settings are missing, the extension must show a useful message. Show a short "Configure this widget" message and a button that opens the settings.
  • Helm validates the values before they go to the extension. The extension receives only declared ids, with values of the declared types.

Runtime

Helm gives the settings in the render context (ctx.settings). When the settings change, Helm sends a settings bridge event. Built-in React extensions read useSettings(). See packages/sdk/src/settings.ts. The form is in apps/helm/src/components/settings/SettingsForm.tsx.