> For the complete Lynkow documentation index in agent-friendly format, see [llms.txt](/llms.txt).

# SiteService

**Publié le** : 2026-08-20
**Catégorie** : Services

# SiteService

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'
```