Configuration Reference
Full field-by-field reference for the TenantConfig schema.
Root Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | ✅ | — | Unique tenant identifier. Lowercase alphanumeric + hyphens only, e.g. welt, bild, business-insider |
api | TenantApi | ✅ | — | API connection settings |
branding | TenantBranding | ✅ | — | Display name and optional visual identity |
theme | Record<string, string> | — | {} | CSS custom property overrides — keys must start with -- |
features | TenantFeatureFlags | — | see below | Feature flag overrides |
behavior | TenantBehavior | — | see below | Behavioral configuration |
locale | TenantLocale | — | see below | Locale and i18n settings |
api — API Connection
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
baseUrl | string (URL) | ✅ | — | Base URL of the community API for this tenant |
tenantId | string | ✅ | — | Tenant identifier sent as a header with every API request |
timeoutMs | number | — | — | Optional request timeout in milliseconds |
branding — Identity
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
displayName | string | ✅ | — | Human-readable tenant name, used in aria labels |
logoUrl | string (URL) | — | — | Optional logo URL for the widget header |
primaryColor | string | — | — | Optional primary brand color — also settable via theme tokens |
features — Feature Flags
| Field | Type | Default | Description |
|---|---|---|---|
votingEnabled | boolean | true | Enable upvote/downvote controls |
repliesEnabled | boolean | true | Allow replies to comments |
editEnabled | boolean | true | Allow comment editing (within 15-minute window) |
deleteEnabled | boolean | true | Allow comment deletion |
aiPersonasEnabled | boolean | false | Show AI-generated engagement comments |
debateEnabled | boolean | false | Enable debate/structured discussion mode |
sortingEnabled | boolean | true | Show sort controls in widget header |
moderationLabelsVisible | boolean | false | Show moderation status indicators to end users |
behavior — Behavioral Config
| Field | Type | Default | Description |
|---|---|---|---|
defaultSortMode | 'new' | 'score' | 'controversial' | 'new' | Default sort order when widget loads |
maxReplyDepth | number (0–10) | 3 | Maximum nesting depth for replies. 0 = flat list |
commentsPerPage | number (1–100) | 20 | Number of top-level comments loaded per page |
repliesPerPage | number (1–50) | 10 | Number of replies loaded per comment |
autoLoadReplies | boolean | false | If true, expand replies automatically; if false, show a "load replies" button |
locale — i18n
| Field | Type | Default | Description |
|---|---|---|---|
defaultLocale | string (BCP 47) | 'de-DE' | Default language tag, e.g. de-DE, en-US |
supportedLocales | string[] | ['de-DE'] | All available locales for this tenant |
translationsUrl | string (URL) | — | Optional URL to custom translation overrides JSON |
Example: WELT Config
json
{
"id": "welt",
"api": {
"baseUrl": "https://community.dev.tech.welt.de/api/v2",
"tenantId": "welt"
},
"branding": {
"displayName": "WELT"
},
"theme": {},
"features": {},
"behavior": {},
"locale": {}
}All omitted features, behavior, and locale fields use the defaults shown above.
Serving Configs
The widget auto-fetches the tenant config at runtime when tenant-id and api-base-url (or config-base-url) are set:
GET {config-base-url || api-base-url}/tenants/{tenant-id}The response must be a valid TenantConfig JSON object. Alternatively, pass the config object directly via the tenantConfig JS property:
js
const widget = document.querySelector('asc-comment-widget');
widget.tenantConfig = {
id: 'my-tenant',
api: { baseUrl: 'https://api.example.com', tenantId: 'my-tenant' },
branding: { displayName: 'My Tenant' },
};