Logotipo Hedhog

Get Hedhog updates in your inbox

New releases, fresh recipes, and breaking changes — no spam.

Back to Core modulesWired in CoreModule
setting module screenshot

Core Submodule

setting

Stores global/user settings and import/export workflow.

Source path: libraries/core/src/setting

Module file: setting.module.ts

Introduction

The Setting submodule provides a centralized, typed configuration store that separates operational parameters from code, enabling runtime adjustments to application behavior without deployments. Settings are organized into named groups (general, mail, security, ai) and each setting carries a type that drives both storage semantics and the input widget rendered in the admin panel.

Six value types are supported. String stores arbitrary text. Number stores numeric values. Boolean drives toggle switches and checkboxes. Array manages lists of string values rendered as tag inputs. JSON stores structured objects parsed at read time. Secret stores sensitive values (API keys, credentials, SMTP passwords) that are stored encrypted and automatically masked in list responses and export payloads — the raw value is only accessible through the setting service at runtime.

When a setting has user_override enabled, individual users can set their own value that takes precedence over the global default. GET /setting/effective merges the global value with any user-specific override, returning the final value that should govern behavior for the authenticated user. Theme selection, preferred language, and dashboard preferences are typical examples of user-overridable settings.

The public GET /setting/initial endpoint returns a curated subset of non-sensitive settings needed to render the frontend before the user authenticates — application name, logo URL, available locales, enabled OAuth providers. This eliminates hardcoded frontend configuration and enables white-label customization through the admin panel.

Settings can be exported as JSON via GET /setting/export. Import follows a two-step validation-then-confirm flow: upload a JSON file to POST /setting/import for validation, then POST the validated payload to POST /setting/import/confirm to apply. This guards against applying malformed or environment-mismatched configuration to production. List-type settings carry a set of selectable options managed via PUT /setting/:settingId/options, enabling custom dropdown values without code changes.

HTTP Endpoints

17 endpoints

Return the initial public settings required to bootstrap the frontend.

List setting groups.

Query
page, pageSize

Get all settings belonging to a specific group.

Params
slug (string)
Query
page, pageSize

List all settings with pagination.

Query
page, pageSize, search

Get a setting by ID.

Params
settingId (int)

Return all settings scoped to the current user.

Return the effective settings for the current user (global merged with user overrides).

Export all settings as JSON, optionally including secret values.

Query
secrets? (bool)

Create a new setting.

Body

FieldTypeRequiredNotes
slugstringyesMax 255 chars
type"string" | "array" | "number" | "boolean" | "json" | "secret"yes
component"input-text" | "input-number" | "input-secret" | "input-file" | "input-tags" | "combobox" | "radio" | "color-picker" | "switch" | "checkbox"no
valuestringyesMax 1023 chars
user_overridebooleanyesWhether users can override this setting
group_idnumberyes

Upload a settings export file for import validation.

Body

FieldTypeRequiredNotes
fileFileyesJSON export file, multipart/form-data

Confirm and apply a previously validated settings import.

Body

FieldTypeRequiredNotes
settings{ slug: string, value: string }[]yes

Set multiple settings by slug in one request.

Body

FieldTypeRequiredNotes
[slug]stringyesKey-value map of slug → value pairs

Update a setting by its slug.

Params
slug (string)

Body

FieldTypeRequiredNotes
valuestringyes

Update a user-scoped setting by slug.

Params
slug (string)

Body

FieldTypeRequiredNotes
valuestringyes

Replace the selectable options for a list-type setting.

Params
settingId (int)

Body

FieldTypeRequiredNotes
options{ id?: number, value: string, order?: number }[]yesFull replacement of selectable options

Partially update a setting.

Params
settingId (int)

Body

FieldTypeRequiredNotes
slugstringnoMax 255 chars
type"string" | "array" | "number" | "boolean" | "json" | "secret"no
componentstringno
valuestringno
user_overridebooleanno
group_idnumberno

Delete one or more settings.

Body

FieldTypeRequiredNotes
idsnumber[]yesIDs to delete

MCP Tools

Named tools callable by AI models via the Model Context Protocol (MCP).

  • core.settings.get

    Get a setting value by key

  • core.settings.set

    Set a setting value by key

  • core.settings.list

    List all settings with pagination

  • core.settings.get-by-id

    Get a setting by its numeric ID

  • core.settings.groups.list

    List setting groups

  • core.settings.set-many

    Update multiple settings at once

  • core.settings.update-from-slug

    Update a setting by group slug and setting slug

  • core.settings.delete

    Delete one or more settings