Skip to main content

Key Value

How to use the key value type in the connector spec

You can use the keyValue type to allow users to enter multiple key-value pairs in a single entry box. This is useful for configuration such as custom HTTP headers, metadata attributes, or environment-specific mappings.

Fields

PropertyTypeRequiredDescription
keystringYesThe config key used to access the key-value map in connector code.
labelstringYesThe label displayed for the field in the ISC UI.
typestringYesMust be "keyValue".
requiredbooleanNoWhether at least one entry is required before saving. Defaults to false.
keyValueKeyobjectYesDefines the input field for the key side of each pair. Supports key, label, type, required, and maxlength.
keyValueValueobjectYesDefines the input field for the value side of each pair. Supports key, label, type, required, and maxlength.

Example key value item type

{
"key": "customHeaders",
"label": "Custom Headers",
"type": "keyValue",
"keyValueKey": {
"key": "key",
"label": "Header Name",
"type": "text",
"required": true,
"maxlength": "256"
},
"keyValueValue": {
"key": "value",
"label": "Header Value",
"type": "text",
"required": true,
"maxlength": "4096"
}
}

key value input type

Reading key-value values in connector code

When an administrator adds key-value pairs, the config exposes them as an array of objects, each containing key and value properties. Convert this to a plain object or Map for convenient access:

constructor(config: any) {
// config.customHeaders is an array like: [{ key: "X-Tenant-ID", value: "acme" }]
const headerEntries: { key: string; value: string }[] = config.customHeaders ?? []

// Convert to a plain object for use with Axios headers
this.extraHeaders = Object.fromEntries(
headerEntries.map(entry => [entry.key, entry.value])
)
}