Related services: CookiesService:
lynkow.cookies.getConfig(),lynkow.cookies.logConsent()| ConsentService:lynkow.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
The visitor's answer per cookie category: true allows the category's
scripts, false blocks them. Returned by
ConsentService.getCategories and sent with the 'consent-changed'
client event.
Property | Type | Optional | Description |
|---|---|---|---|
|
| No | Analytics cookies and scripts. When |
|
| No | Consent to marketing and advertising cookies (ad networks,<br>retargeting). Required before loading scripts classified as<br> |
|
| No | Strictly necessary cookies. Always |
|
| No | Consent to personalization and preference cookies (theme, language,<br>non-essential UI state). Required before loading scripts classified<br>as |
ConsentMode
TypeAlias
How the site asks for cookie consent: 'opt-in' blocks optional cookies
until the visitor accepts, 'opt-out' allows them until the visitor
refuses, 'notice-only' informs without offering a choice.
type ConsentMode = "opt-in" | "opt-out" | "notice-only"ConsentShowOptions
Interface
Options for ConsentService.show.
Property | Type | Optional | Description |
|---|---|---|---|
|
| Yes | A CookieConfig you already fetched, for example on the server, used instead of a new request. |
|
| Yes | Show the banner even when the site set |
CookieCategory
Interface
A cookie consent category grouping related cookies and scripts. Users accept or reject entire categories (not individual cookies).
Property | Type | Optional | Description |
|---|---|---|---|
|
| No | Description explaining what cookies in this category do.<br>Displayed in the consent banner's detailed/customize view. |
|
| No | Machine-readable category identifier.<br>Standard values: |
|
| No | Human-readable category name displayed in the consent banner. |
|
| No |
|
CookieConfig
Interface
A site's cookie consent configuration: mode, banner texts and styling,
categories and gated scripts. Returned by cookies.getConfig() and
consent.getConfig().
Property | Type | Optional | Description |
|---|---|---|---|
|
| Yes | Corner radius of the banner and its buttons, in pixels, from 0 to 50. |
|
| Yes | Size of the banner and preferences buttons.<br>- |
|
| No | The site's enabled categories, in display order, with texts in the requested locale. |
|
| Yes | Consent mode, see ConsentMode. Under |
|
| Yes | URL to a dedicated cookie policy page (separate from the privacy policy).<br> |
|
| No | Whether the cookie consent banner is enabled for this site.<br>When |
|
| Yes | Banner font size in pixels, from 11 to 17. |
|
| No | Banner layout style. Currently only |
|
| Yes | Maximum banner width in pixels, from 280 to 1200 (default 580). Ignored below a 600px viewport. |
|
| Yes |
|
|
| No | Screen position of the floating consent banner.<br>- |
|
| Yes | Accent color as |
|
| Yes | URL to the site's privacy policy page.<br> |
|
| Yes | Whether to show the "Customize" button that lets users pick categories individually.<br>When |
|
| Yes | Whether the banner shows by itself on a first visit. When |
|
| No | Localized text strings for the banner UI.<br>All strings are ready for display without further formatting. |
|
| No | Color theme for the banner:<br>- |
|
| Yes | Banner colors for the light and dark schemes. Use the one matching theme, or the site's current scheme under |
|
| 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. |
|
| Yes | Version of the banner text in this locale: a 64-character SHA-256 hex digest of the texts and category labels. Consent logs record the same value. |
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.
type CookiePreferences = Record<string, boolean>CookieTexts
Interface
Banner texts in the requested locale: the site's own wording, or Lynkow's default wording for any text the site left unchanged.
Property | Type | Optional | Description |
|---|---|---|---|
|
| No | Label for the "Accept All" button that grants consent for all categories. |
|
| No | Label for the "Customize" button that opens the detailed category preferences. |
|
| No | Main description/message shown in the cookie banner.<br>Typically explains that the site uses cookies and links to the privacy policy. |
|
| No | Link text pointing to the privacy/cookie policy page. |
|
| No | Label for the "Reject All" button that only allows necessary cookies. |
|
| No | Label for the "Save" button in the detailed preferences view.<br>Saves the user's per-category choices. |
ThirdPartyScript
Interface
A third-party script that should be injected into the page based on the user's consent for its category. Only inject this script's HTML when the user has accepted the corresponding cookie category.
Property | Type | Optional | Description |
|---|---|---|---|
|
| No | Cookie consent category this script belongs to: the |
|
| No | Unique identifier for this script configuration.<br>Stable across requests; can be used as a React key or for deduplication. |
|
| No | Human-readable name for this script.<br>For admin reference; not typically displayed to end users. |
|
| No | Raw HTML content to inject into the page.<br>May contain |