Skip to content

Config schema

A module’s config is a Valibot schema for settings that belong to the deployment rather than to one run: a brand voice, banned terms, a Slack channel.

config: v.object({
brandVoice: v.optional(v.pipe(v.string(), v.title('Brand voice and style'))),
bannedTerms: v.optional(v.pipe(v.string(), v.title('Words that must not appear (comma separated)'))),
slackChannel: v.optional(v.pipe(v.string(), v.title('Slack channel for summaries'))),
}),

Stages read the values from ctx.config:

const channel = ctx.config.slackChannel as string | undefined;

Values are layered. A higher layer wins, key by key.

Layer Source Badge in the dashboard
Deployment KNETIK_MODULE_CONFIG environment variable DEPLOYMENT
Workspace Saved from the dashboard’s Configuration tab (admins) WORKSPACE
Dev fixtures/dev-config.json under knetik dev, which replaces the environment values for that module DEV
Terminal window
KNETIK_MODULE_CONFIG='{"content-creator":{"brandVoice":"Plain, warm and specific. No hype.","bannedTerms":"guaranteed, miracle"}}'

The variable is JSON keyed by module id. An invalid value stops the server at start-up with a message saying what the shape is.

  • Config is read per stage context, so a change applies to stages that start afterwards. A running stage keeps the object it started with.
  • Saving from the dashboard replaces the complete set of overrides. Keys left out go back to the deployment value.
  • Saved overrides are stored in the database table knetik_module_config, with who saved them and when.

List keys that must be masked in ui.config.secret. They are masked in the dashboard and in the API. A secret sent back as the mask marker keeps its stored value. See Module UI.

GET /api/modules/:id returns the module with its configuration view (secrets masked), and PUT /api/modules/:id/config saves overrides. Only admins can save. See the API reference.