Skip to content

Configuration Reference

Full field-by-field reference for the TenantConfig schema.

Root Fields

FieldTypeRequiredDefaultDescription
idstringUnique tenant identifier. Lowercase alphanumeric + hyphens only, e.g. welt, bild, business-insider
apiTenantApiAPI connection settings
brandingTenantBrandingDisplay name and optional visual identity
themeRecord<string, string>{}CSS custom property overrides — keys must start with --
featuresTenantFeatureFlagssee belowFeature flag overrides
behaviorTenantBehaviorsee belowBehavioral configuration
localeTenantLocalesee belowLocale and i18n settings

api — API Connection

FieldTypeRequiredDefaultDescription
baseUrlstring (URL)Base URL of the community API for this tenant
tenantIdstringTenant identifier sent as a header with every API request
timeoutMsnumberOptional request timeout in milliseconds

branding — Identity

FieldTypeRequiredDefaultDescription
displayNamestringHuman-readable tenant name, used in aria labels
logoUrlstring (URL)Optional logo URL for the widget header
primaryColorstringOptional primary brand color — also settable via theme tokens

features — Feature Flags

FieldTypeDefaultDescription
votingEnabledbooleantrueEnable upvote/downvote controls
repliesEnabledbooleantrueAllow replies to comments
editEnabledbooleantrueAllow comment editing (within 15-minute window)
deleteEnabledbooleantrueAllow comment deletion
aiPersonasEnabledbooleanfalseShow AI-generated engagement comments
debateEnabledbooleanfalseEnable debate/structured discussion mode
sortingEnabledbooleantrueShow sort controls in widget header
moderationLabelsVisiblebooleanfalseShow moderation status indicators to end users

behavior — Behavioral Config

FieldTypeDefaultDescription
defaultSortMode'new' | 'score' | 'controversial''new'Default sort order when widget loads
maxReplyDepthnumber (0–10)3Maximum nesting depth for replies. 0 = flat list
commentsPerPagenumber (1–100)20Number of top-level comments loaded per page
repliesPerPagenumber (1–50)10Number of replies loaded per comment
autoLoadRepliesbooleanfalseIf true, expand replies automatically; if false, show a "load replies" button

locale — i18n

FieldTypeDefaultDescription
defaultLocalestring (BCP 47)'de-DE'Default language tag, e.g. de-DE, en-US
supportedLocalesstring[]['de-DE']All available locales for this tenant
translationsUrlstring (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' },
};