Service for retrieving the public site configuration.

Accessible via lynkow.site. Provides site-level metadata such as name, domain, locales, timezone, branding settings, and analytics consent mode. Cached for 10 minutes (MEDIUM TTL) since site configuration rarely changes.

Access via: lynkow.site

Methods

2 methods

clearCache

TypeScript
clearCache(): void

Invalidate the cached site configuration. Call after a settings change on the admin (branding, enabled locales, default author, search config) or on receipt of a site.updated webhook so the next getConfig() fetches fresh values.

Returns: void

TypeScript
// After enabling a new locale in the admin:
lynkow.site.clearCache()
const fresh = await lynkow.site.getConfig()

getConfig

TypeScript
getConfig(): Promise<SiteConfig>

Retrieves the complete public site configuration, including site identity (name, domain, logo, favicon), localization settings (default locale, enabled locales, i18n config with detection rules), branding options, and analytics consent mode. Cached for 10 minutes.

Returns: Promise<SiteConfig>

TypeScript
const config = await lynkow.site.getConfig()
console.log(config.enabledLocales)        // ['en', 'fr', 'de']
console.log(config.i18n.detection.enabled) // true
console.log(config.analytics.consentMode)  // 'opt-in'