Related services: SiteService: lynkow.site.getConfig()

Client

Interface

The client returned by createClient: every LynkowClient service, plus the commerce services, locale management, events and image helpers.

Extends: LynkowClient

Property

Type

Optional

Description

analytics

AnalyticsService

No

Pageview and event tracking. Browser only.

availableLocales

string[]

No

Locales the site enables (e.g. ['en', 'fr']). Empty until the site<br>config is loaded: the browser client loads it at startup, and any<br>site.getConfig() call loads it.

blocks

BlocksService

No

Global blocks: site-wide data such as the header navigation or the footer.

branding

BrandingService

No

The "Made with Lynkow" badge. Browser only.

cart

CartService

No

The buyer's cart. Requires publishableKey. The SDK keeps the guest cart<br>token for you.

categories

CategoriesService

No

Content categories, as a list or a tree.

checkout

CheckoutService

No

Turns the current cart into an order. Requires publishableKey.

config

Readonly<{ baseUrl: string; cache: boolean; debug: boolean; siteId: string }>

No

The client's siteId, baseUrl, debug and cache settings, read-only.

consent

ConsentService

No

The cookie consent banner and the visitor's choices, built on cookies.

contents

ContentsService

No

Published blog articles.

cookies

CookiesService

No

The cookie banner configuration and consent logging.

customers

CustomersService

No

Buyer accounts: sign-up, sign-in, profile, order history and password<br>reset. Requires publishableKey.

enhancements

EnhancementsService

No

Browser behavior for rendered content, such as code-block copy buttons.

forms

FormsService

No

Form schemas and form submissions.

globals

BlocksService

No

Global blocks: site-wide data such as the header navigation or the footer.

legal

LegalService

No

Legal documents such as the privacy policy or the terms of service.

locale

string

No

The client's current locale. Without a configured, detected or set locale,<br>it reads 'fr' until a site config is read, then the site's default locale.

markets

MarketsService

No

The site's markets: countries, languages and currency. Requires publishableKey.

media

MediaHelperService

No

Image URL helpers for resized and responsive images.

orders

OrdersService

No

Guest order lookup through the token of an order link. Requires<br>publishableKey. A signed-in buyer reads orders through customers.

pages

PagesService

No

Site pages such as the homepage or the contact page, distinct from blog articles.

paths

PathsService

No

Every renderable path, path resolution and redirect matching, for static generation.

paymentMethods

PaymentMethodsService

No

The payment methods the site accepts at checkout, with logos. Requires publishableKey.

productCategories

ProductCategoriesService

No

The product category tree. Requires publishableKey.

productCollections

ProductCollectionsService

No

Product collections. Requires publishableKey.

products

ProductsService

No

Published products. Requires publishableKey.

reservations

ReservationsService

No

Availability and bookings of bookable products. Requires publishableKey.

reviews

ReviewsService

No

Approved reviews, review submissions and the site's review settings.

search

SearchService

No

Lynkow search, on the server or straight from the browser.

seo

SeoService

No

Plain-text SEO files: robots.txt, sitemap, llms.txt and page Markdown.

shippingOptions

ShippingOptionsService

No

Shipping options of one market. Requires publishableKey.

site

SiteService

No

The site configuration: identity, locales and branding setting.

tags

TagsService

No

Content tags.

variables

VariablesService

No

Site variables: named values such as a phone number, per locale.


ClientConfig

Interface

Options of createClient: LynkowConfig plus debug, cache and enhancements.

Extends: LynkowConfig

Property

Type

Optional

Description

baseUrl

string

Yes

Base URL of the Lynkow API, for local development. A trailing slash is<br>removed. Defaults to https://api.lynkow.com.

cache

boolean

Yes

Caches responses in the SDK: in memory on the server, in localStorage<br>in the browser. Off by default, so every call reaches fetch() and your<br>framework controls caching. Entries are scoped to this client's site.

clientIp

string

Yes

IP address of the buyer a server-side call is made for. Sent only together with<br>serverKey; the API ignores it otherwise.

customerToken

string

Yes

Session token of a signed-in buyer, to restore the session after a reload<br>or on the server. Customer calls send it as Authorization: Bearer.<br>customers.login() and customers.activation.confirm() replace it,<br>customers.logout() clears it. The SDK never stores it: keep it yourself,<br>for example in an HttpOnly cookie.

debug

boolean

Yes

Logs the SDK's activity to the console. Defaults to false.

enhancements

Pick<EnhancementsInitOptions, "activateScripts">

Yes

Defaults for lynkow.enhancements, applied from its automatic start. Set<br>activateScripts: false when your site renders CMS HTML on the server, or<br>its inline scripts run twice.

fetchOptions

RequestInit

Yes

fetch() options added to every request, such as Next.js caching<br>directives. A request's own fetchOptions are shallow-merged on top.

locale

string

Yes

Locale sent with every request, one the site enables (e.g. 'fr'). A<br>request's own locale option overrides it. When omitted, the browser<br>client detects the visitor's locale at startup, and a server client sends<br>none, so the site's default locale applies.

publishableKey

string

Yes

Publishable key (lkw_pk_...) from the admin, Settings > Developers ><br>Storefront, sent as the X-Lynkow-Pk header. Required by the commerce<br>services, optional elsewhere. Safe to ship to the browser.

requestHeaders

RequestHeadersProvider

Yes

Called before each request with its method and URL, to add headers<br>computed for that request, such as the buyer IP read from the incoming<br>request on your server. Return undefined to add nothing. A header the<br>request already carries keeps its value, so the SDK's own headers and<br>fetchOptions.headers always win. Called once per request, never per<br>retry. A provider that throws fails the request with that error, except<br>the cookie consent record, which never fails.

retry

boolean | RetryConfig

Yes

Retry policy for reads that fail with HTTP 429, HTTP 503 or a network<br>error. On by default. Pass false to turn it off, or a<br>RetryConfig to tune it.

serverKey

string

Yes

The site's server key (lkw_srv_...), created on the Storefront settings page,<br>for a client created on your server only. A secret API token also works.<br>Sent with clientIp so rate limits count each buyer, not your server.<br>Throws when set in a browser.

siteId

string

No

UUID of your site, shown in the admin at the end of site creation as<br>NEXT_PUBLIC_LYNKOW_SITE_ID. Sent in the path of every request.<br>createClient() throws when it is empty.


LynkowClient

Interface

The content services, returned by the deprecated createLynkowClient. Client, returned by createClient(), adds the commerce services, locale management and events.

Property

Type

Optional

Description

analytics

AnalyticsService

No

Pageview and event tracking. Browser only.

blocks

BlocksService

No

Global blocks: site-wide data such as the header navigation or the footer.

branding

BrandingService

No

The "Made with Lynkow" badge. Browser only.

categories

CategoriesService

No

Content categories, as a list or a tree.

consent

ConsentService

No

The cookie consent banner and the visitor's choices, built on cookies.

contents

ContentsService

No

Published blog articles.

cookies

CookiesService

No

The cookie banner configuration and consent logging.

enhancements

EnhancementsService

No

Browser behavior for rendered content, such as code-block copy buttons.

forms

FormsService

No

Form schemas and form submissions.

globals

BlocksService

No

Global blocks: site-wide data such as the header navigation or the footer.

legal

LegalService

No

Legal documents such as the privacy policy or the terms of service.

pages

PagesService

No

Site pages such as the homepage or the contact page, distinct from blog articles.

paths

PathsService

No

Every renderable path, path resolution and redirect matching, for static generation.

reviews

ReviewsService

No

Approved reviews, review submissions and the site's review settings.

search

SearchService

No

Lynkow search, on the server or straight from the browser.

seo

SeoService

No

Plain-text SEO files: robots.txt, sitemap, llms.txt and page Markdown.

site

SiteService

No

The site configuration: identity, locales and branding setting.

tags

TagsService

No

Content tags.


LynkowConfig

Interface

Client options, extended by ClientConfig. Only siteId is required.

Property

Type

Optional

Description

baseUrl

string

Yes

Base URL of the Lynkow API, for local development. A trailing slash is<br>removed. Defaults to https://api.lynkow.com.

clientIp

string

Yes

IP address of the buyer a server-side call is made for. Sent only together with<br>serverKey; the API ignores it otherwise.

customerToken

string

Yes

Session token of a signed-in buyer, to restore the session after a reload<br>or on the server. Customer calls send it as Authorization: Bearer.<br>customers.login() and customers.activation.confirm() replace it,<br>customers.logout() clears it. The SDK never stores it: keep it yourself,<br>for example in an HttpOnly cookie.

fetchOptions

RequestInit

Yes

fetch() options added to every request, such as Next.js caching<br>directives. A request's own fetchOptions are shallow-merged on top.

locale

string

Yes

Locale sent with every request, one the site enables (e.g. 'fr'). A<br>request's own locale option overrides it. When omitted, the browser<br>client detects the visitor's locale at startup, and a server client sends<br>none, so the site's default locale applies.

publishableKey

string

Yes

Publishable key (lkw_pk_...) from the admin, Settings > Developers ><br>Storefront, sent as the X-Lynkow-Pk header. Required by the commerce<br>services, optional elsewhere. Safe to ship to the browser.

requestHeaders

RequestHeadersProvider

Yes

Called before each request with its method and URL, to add headers<br>computed for that request, such as the buyer IP read from the incoming<br>request on your server. Return undefined to add nothing. A header the<br>request already carries keeps its value, so the SDK's own headers and<br>fetchOptions.headers always win. Called once per request, never per<br>retry. A provider that throws fails the request with that error, except<br>the cookie consent record, which never fails.

retry

boolean | RetryConfig

Yes

Retry policy for reads that fail with HTTP 429, HTTP 503 or a network<br>error. On by default. Pass false to turn it off, or a<br>RetryConfig to tune it.

serverKey

string

Yes

The site's server key (lkw_srv_...), created on the Storefront settings page,<br>for a client created on your server only. A secret API token also works.<br>Sent with clientIp so rate limits count each buyer, not your server.<br>Throws when set in a browser.

siteId

string

No

UUID of your site, shown in the admin at the end of site creation as<br>NEXT_PUBLIC_LYNKOW_SITE_ID. Sent in the path of every request.<br>createClient() throws when it is empty.


OutgoingRequest

Interface

The request a RequestHeadersProvider is called for.

Property

Type

Optional

Description

method

string

No

The HTTP method, upper case: 'GET', 'POST', 'PATCH' or 'DELETE'.

url

string

No

The full URL, query string included.


RequestHeadersProvider

TypeAlias

The requestHeaders option of LynkowConfig: returns the headers to add to one request, or undefined for none.

TypeScript
type RequestHeadersProvider = (request: OutgoingRequest) => HeadersInit | undefined | Promise<HeadersInit | undefined>

RetryConfig

Interface

Retry policy for transient failures, on by default. Reads (GET and the text endpoints such as sitemap and robots) are retried on HTTP 429, HTTP 503 and network errors, with exponential backoff that honors Retry-After. Writes are sent once. Pass retry: false to turn retries off.

In a Next.js server render, Next answers a request identical to an earlier one with the first response unless it carries an abort signal, so a retry there gets the same 429 or 503 back.

Property

Type

Optional

Description

backoffMs

number

Yes

Base backoff in milliseconds when the response has no Retry-After: the<br>nth retry waits about backoffMs * 2^n plus jitter. Defaults to 500.

maxDelayMs

number

Yes

Longest single wait in milliseconds, also capping Retry-After. Defaults<br>to 20000.

retries

number

Yes

Retries after the first attempt. 0 turns retries off. Defaults to 3.


SiteConfig

Interface

The public site configuration returned by site.getConfig(). Global blocks are not part of it: use blocks.siteConfig(). With a locale, name, description and logoUrl are served in that language, else with the site default value, and the payload also carries locale, requestedLocale and isFallback. Without a locale it has none of these three.

Extends: LocaleResolution

Property

Type

Optional

Description

analytics

{ consentMode: "opt-in" | "opt-out" | "disabled" }

No

Analytics consent configuration for the site.

defaultLocale

string

No

Default locale code for the site (e.g. 'en', 'fr').<br>Content and API responses default to this locale when no locale is specified.<br>Always appears in enabledLocales.

description

string | null

No

Short site description for SEO and metadata.<br>null when no description has been set by the admin.<br>Served in the request locale, or the default-locale value when that<br>locale has no override.

domain

string

No

Primary domain without protocol (e.g. 'example.com', 'blog.example.com').<br>This is the canonical domain for building absolute URLs.

enabledLocales

string[]

No

Array of all enabled locale codes (e.g. ['en', 'fr', 'de']).<br>Always contains at least defaultLocale.<br>Use this to validate locale parameters or build locale-prefixed URLs.

faviconUrl

string | null

No

Full CDN URL to the site favicon.<br>null when no favicon has been uploaded.<br>Should be used in the <link rel="icon"> tag.

i18n

I18nConfig

No

Full i18n configuration including locale display metadata,<br>language switcher settings, and automatic detection behavior.<br>See I18nConfig for details.

id

string

No

Site UUID. Same value as the siteId used to initialize the client.<br>Format: UUID v4 (e.g. '550e8400-e29b-41d4-a716-446655440000').

isFallback

boolean

Yes

true when the identity fields were served in a locale other than requestedLocale. Absent<br>when the request carried no locale. The site read never answers 404 and ignores fallback: false,<br>so this can be true even then.

locale

string

Yes

BCP 47 locale code of the record actually served (e.g. 'en', 'fr').<br>Equals requestedLocale unless isFallback is true.

logoUrl

string | null

No

Absolute URL of the site logo, in the served language when it has its own. null when none is uploaded.

name

string

No

Site display name, as configured by the admin.<br>Used for site branding, document titles, etc.<br>Served in the request locale, or the default-locale value when that<br>locale has no override.

requestedLocale

string

Yes

BCP 47 locale code the request asked for (e.g. 'de'), as sent in the<br>locale request option or the client's configured locale.<br>Absent when the request carried no locale.

showBranding

boolean

No

Whether the Lynkow branding badge should be displayed on the site.<br>This is the effective public value after the site's badge policy is applied.

timezone

string | null

No

IANA timezone identifier for the site (e.g. 'Europe/Paris', 'America/New_York').<br>Used for displaying dates in the site's local time.<br>null when no timezone has been configured (defaults to UTC).