Klaro CMP
What is Klaro?
Section titled “What is Klaro?”Klaro is a self-hosted, EU-sovereign consent management platform.
Granit.Http.Cookies.Klaro provides KlaroConsentResolver which reads the Klaro consent
cookie and maps service-level consent to Granit cookie categories.
context.Services.AddGranitCookies(cookies =>{ // ... register cookies ... cookies.UseKlaro();});Configuration
Section titled “Configuration”{ "Klaro": { "CookieName": "klaro" }, "Cookies": { "ThirdPartyServices": [ { "Name": "matomo", "Category": "Analytics", "CookiePatterns": ["^_pk_"] }, { "Name": "hubspot", "Category": "Marketing", "CookiePatterns": ["^__hs"] } ] }}Resolution logic
Section titled “Resolution logic”- Read the Klaro cookie from the request (name from
KlaroOptions.CookieName) - Parse as JSON:
{"serviceName": true/false, ...} - Find all service names mapped to the requested
CookieCategoryviaIThirdPartyServiceRegistry - Return
trueonly if all mapped services have consent granted - If no services are mapped for the category → return
false(fail-safe)