Related services: CookiesServicelynkow.cookies.getConfig(), lynkow.cookies.logConsent() | ConsentServicelynkow.consent.acceptAll(), lynkow.consent.destroy(), lynkow.consent.getCategories(), lynkow.consent.getConfig(), lynkow.consent.hasConsented(), lynkow.consent.hide(), lynkow.consent.logConsent(), lynkow.consent.rejectAll(), lynkow.consent.reset(), lynkow.consent.setCategories(), lynkow.consent.show(), lynkow.consent.showPreferences()

ConsentCategories

Interface

Consent categories

Property

Type

Optional

Description

analytics

boolean

No

Analytics cookies

marketing

boolean

No

Marketing cookies

necessary

boolean

No

Always true, not modifiable

preferences

boolean

No

Preference cookies


CookieCategory

Interface

A cookie consent category grouping related cookies and scripts. Users accept or reject entire categories (not individual cookies).

Property

Type

Optional

Description

description

string

No

Description explaining what cookies in this category do.<br>Displayed in the consent banner's detailed/customize view.

id

string

No

Machine-readable category identifier.<br>Standard values: 'necessary', 'analytics', 'marketing', 'preferences'.<br>Used as the key in CookiePreferences when recording consent.

name

string

No

Human-readable category name displayed in the consent banner.

required

boolean

No

Whether this category is required and cannot be toggled off by the user.<br>Always true for the 'necessary' category (essential cookies).<br>When true, the toggle is disabled/checked in the consent UI.<br>When false, the user can opt in or out of this category.


CookieConfig

Interface

Full cookie consent banner configuration. Returned by cookies.getConfig(). Contains all settings needed to render and manage a GDPR-compliant consent banner.

Property

Type

Optional

Description

borderRadius

number

Yes

Border radius in pixels for the banner container and buttons.<br>Use 0 for sharp corners, 8-12 for rounded, 9999 for pill-shaped buttons.

categories

CookieCategory[]

No

Cookie categories that users can accept or reject.<br>Always includes at least a 'necessary' category with required: true.<br>Order matches the display order in the preferences UI.

consentMode

"opt-in" | "opt-out"

Yes

How consent is handled:<br>- 'opt-in': all non-necessary cookies are blocked until the user explicitly accepts.<br> This is the GDPR-compliant default for EU sites.<br>- 'opt-out': all cookies are active by default; user can reject them.<br> Less restrictive, suitable for non-EU sites.<br><br>Only present when enabled is true.

cookiePolicyUrl

string | null

Yes

URL to a dedicated cookie policy page (separate from the privacy policy).<br>null when no cookie policy URL has been configured.<br>Some sites use a single privacy policy; others maintain a separate cookie policy.

enabled

boolean

No

Whether the cookie consent banner is enabled for this site.<br>When false, no banner should be shown and no consent logic is needed.

fontSize

number

Yes

Font size in pixels for the banner text.<br>Constrained to the range 11-17. Values outside this range are clamped.

layout

"floating"

No

Banner layout style. Currently only 'floating' is supported<br>(a dismissable card overlay, not a full-width bar).

position

"bottom-left" | "bottom-right"

No

Screen position of the floating consent banner.<br>- 'bottom-left': anchored to the bottom-left corner<br>- 'bottom-right': anchored to the bottom-right corner

primaryColor

string

Yes

Primary accent color for buttons and interactive elements.<br>Format: 6-digit hex with # prefix (e.g. '#3b82f6').<br>Applied to the "Accept All" button and toggle switches.

privacyPolicyUrl

string | null

Yes

URL to the site's privacy policy page.<br>null when no privacy policy URL has been configured.<br>Should be rendered as a clickable link in the banner.

showCustomizeButton

boolean

Yes

Whether to show the "Customize" button that lets users pick categories individually.<br>When false, only "Accept All" and "Reject All" buttons are shown.

showOnFirstVisit

boolean

Yes

Whether to automatically show the banner on the user's first visit.<br>When false, the banner must be triggered manually (e.g. via a footer link).<br>Only present when enabled is true.

texts

CookieTexts

No

Localized text strings for the banner UI.<br>All strings are ready for display without further formatting.

theme

"light" | "dark" | "auto"

No

Color theme for the banner:<br>- 'light': white/light background with dark text<br>- 'dark': dark background with light text<br>- 'auto': follows the user's OS/browser color scheme preference<br><br>When 'auto', use themeStyles to get the exact colors for each scheme.

themeStyles

{ dark: { bgColor: string; primaryColor: string; textColor: string }; light: { bgColor: string; primaryColor: string; textColor: string } }

Yes

Per-theme color overrides for light and dark modes.<br>Only relevant when theme is 'auto'.<br>When theme is 'light' or 'dark', use the corresponding sub-object.

thirdPartyScripts

ThirdPartyScript[]

Yes

Third-party scripts to inject based on the user's consent preferences.<br>Each script is tied to a category; only inject scripts whose category<br>the user has accepted. Empty array when no scripts are configured.


CookiePreferences

TypeAlias

Map of cookie category IDs to the user's consent decision. true means the user accepted that category; false means rejected. Used when calling cookies.logConsent() to record preferences.

TypeScript
type CookiePreferences = Record<string, boolean>

CookieTexts

Interface

Localized text strings for the cookie consent banner. All fields are pre-configured by the site admin and ready for display.

Property

Type

Optional

Description

acceptAll

string

No

Label for the "Accept All" button that grants consent for all categories.

customize

string

No

Label for the "Customize" button that opens the detailed category preferences.

description

string

No

Main description/message shown in the cookie banner.<br>Typically explains that the site uses cookies and links to the privacy policy.

privacyPolicy

string

No

Link text pointing to the privacy/cookie policy page.

rejectAll

string

No

Label for the "Reject All" button that only allows necessary cookies.

save

string

No

Label for the "Save" button in the detailed preferences view.<br>Saves the user's per-category choices.