Laioutr provides a consent management layer in the frontend that separates “what the user has consented to” from “which vendor collects it.” Your app and other Laioutr apps (e.g. Google Tag Manager, analytics) use one consent store and one set of consent categories. The actual banner, cookie, and CMP (Consent Management Platform) are implemented by a consent adapter that you choose. You can use the built-in Cookiebot app or implement your own adapter for another provider (OneTrust, CookieYes, custom, etc.).
This way you get:
hasCategoryConsent('statistics') or hasCategoryConsent('marketing') and react to changes, no matter which CMP is behind it.The abstraction lives in @laioutr-core/frontend-core. Your Nuxt app must have this module so the consent store and the #frontend/consent types are available.
Consent is represented by a single state shape with five categories. Every adapter maps its provider’s categories into this shape so the rest of the app only deals with one model:
| Category | Typical use |
|---|---|
| necessary | Essential cookies (e.g. session, security). Usually always true and not user-toggleable. |
| functional | Preferences and functionality (e.g. language, cart). |
| statistics | Analytics and performance (e.g. GA, heatmaps). |
| marketing | Advertising and personalisation (e.g. ads, retargeting). |
| unclassified | Any category that doesn’t fit the above. |
The store keeps a single state object with these five booleans. When the user accepts or revokes categories in the CMP, the active adapter calls the store (via onConsentChange), and the store updates this state. Other code can read state (reactive) or use hasCategoryConsent(category) to gate behaviour.
The consent store is a global state (VueUse createGlobalState) that:
Only one adapter is active at a time. When you activate an adapter, the store calls its init(), subscribes to its onConsentChange, and applies its initial getConsentState() to the store state. Deactivating calls the adapter’s destroy() (if implemented) and resets state to safe defaults (only necessary true).
You use the store from any component or plugin via useConsentStore() (auto-imported when using frontend-core). Example: disable a feature until the user has given statistics consent:
const consentStore = useConsentStore();
if (consentStore.hasCategoryConsent('statistics')) {
// load analytics
}
Or show a “Cookie preferences” button that reopens the banner:
await consentStore.showConsentOverlay();
A consent adapter is the bridge between a concrete CMP (Cookiebot, OneTrust, etc.) and the Laioutr consent store. It implements a small interface so the store can drive and read consent in a uniform way.
Conceptually, an adapter must:
'cookiebot') so the store can register and activate it.The TypeScript types (ConsentAdapter, ConsentManagementState) are exported from #frontend/consent (aliased by frontend-core). Your consent app can depend on @laioutr-core/frontend-core and implement a class that satisfies ConsentAdapter, then register it in a Nuxt plugin (see below).
If you want to support a different CMP or a custom consent solution:
Once your adapter is active, the rest of the app and other apps (e.g. GTM) only use useConsentStore() and hasCategoryConsent / state; they do not need to know which CMP is used.
Laioutr ships a ready-to-use consent app for Cookiebot. It implements the consent adapter for Cookiebot’s banner and cookie, maps Cookiebot’s categories (necessary, preferences, statistics, marketing) to Laioutr’s consent state, and registers with the consent store so you don’t have to write adapter code yourself.
To use it, add the module to your app and set your CBID. Other features (e.g. GTM) will then read consent from the store and update their tags (e.g. Google Consent Mode) when the user accepts or revokes categories.
For setup, options, and behaviour, see the Cookiebot app documentation.
Apps that need to respect consent do not talk to Cookiebot (or any CMP) directly. They use the consent store:
analytics_storage, ad_storage) when the user grants statistics or marketing. It also sets default consent to “denied” so tags wait for consent.['statistics', 'marketing']). The tracking store only forwards events to that adapter if hasCategoryConsent is true for all of those categories. So analytics or marketing events are not sent until the user has consented.This keeps a clear separation: one consent provider (your chosen adapter), one state, and many consumers (tracking, GTM, custom logic) that all use the same API.
Authentification
Laioutr’s authentification support lets customers authenticate on their frontend. It includes a login form, a register form, a recover password form, and a logout button.
Currencies
Laioutr’s currencies support lets customers switch between multiple currencies on their frontend. It includes a currency switcher component and optional informational links.