Reads the public site configuration (name, domain, locales, branding, analytics consent mode),
available as lynkow.site. The client does not cache it: use fetchOptions for your framework's cache.
Access via: lynkow.site
Methods
2 methods
clearCache
clearCache(): voidClears the cache entries of this service. getConfig() writes none, so this does nothing
for a client that never cached a site configuration.
Returns: void
lynkow.site.clearCache()getConfig
getConfig(options?: BaseRequestOptions): Promise<SiteConfig>Fetches the site's identity, locale settings, branding options and analytics consent mode.
Not cached by the client, so a plan or branding change shows on the next call.
Throws LynkowError NOT_FOUND for an unknown site, FORBIDDEN for an inactive site
or a request origin that does not match the site's domain, and PAYMENT_REQUIRED when the
subscription no longer covers public delivery.
Parameter | Type | Description |
|---|---|---|
|
| Request options. |
Returns: Promise<SiteConfig>
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'