Getting started
Install the packages, register a locale, and connect the controller to your UI.
Install
Install the core and locale package with your preferred package manager.
pnpm add @consent-cuisine/core @consent-cuisine/cuisines
# npm install @consent-cuisine/core @consent-cuisine/cuisines
# yarn add @consent-cuisine/core @consent-cuisine/cuisines
# bun add @consent-cuisine/core @consent-cuisine/cuisinesCreate a controller
Import the storage adapter and the locale modules your application supports.
import { createConsentCuisine, createLocalStorage } from "@consent-cuisine/core";
import { frFR } from "@consent-cuisine/cuisines/fr-FR";Register the locale pack at initialization. Set cuisine to a variant ID, true for the locale default, or false for conventional cookie labels. policyVersion is part of the persisted record: update it whenever a consent change requires a new decision.
const consent = createConsentCuisine({
locale: "fr-FR",
cuisine: "croissant",
locales: [frFR],
storage: createLocalStorage(),
policyVersion: "2026-10"
});
createLocalStorage() is appropriate for browser code. If your storage belongs elsewhere, pass an object with get, set, and remove methods instead.
Render category labels
const categories = consent.getCategories();
categories[0].technical.label; // Cookies essentiels
categories[0].display.label; // Croissants essentielsEach item also includes id, required, and accepted. Use those values to render controls in any framework.
for (const category of consent.getCategories()) {
console.log(category.id, category.accepted, category.display.label);
}The display label never changes the data you persist or the category a vendor receives. See Cuisine packs for the available variants.