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

Invalidates the cached site configuration. Call this if you know the site settings have changed (e.g. after a locale is added) and want to force a fresh fetch on the next getConfig() call.

Returns: void


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'