Skip to content

Klaro CMP (removed)

Granit.Http.Cookies.Klaro was deprecated and has been removed. The supported CMP integration is Granit.Http.Cookies.CookieConsent (the @cookieconsent/core adapter), and UseCookieConsent() on GranitCookiesBuilder is the single public CMP entry point. The Granit.Http.Cookies core abstraction (IConsentResolver, cookie categories, registry) is unchanged — only the adapter differs.

context.Services.AddGranitCookies(cookies =>
{
// ... register cookies ...
cookies.UseCookieConsent(); // was: cookies.UseKlaro();
});

Configuration moves from Http:Cookies:Klaro to Http:Cookies:CookieConsent (CookieConsentOptions):

{
"Http:Cookies:CookieConsent": {
"CookieName": "cc_cookie",
"FunctionalCategoryName": "functional",
"AnalyticsCategoryName": "analytics",
"MarketingCategoryName": "marketing",
"SaleOrSharingCategoryName": "sale_or_sharing"
}
}

CookieConsentConsentResolver reads the cc_cookie consent cookie and maps its categories array to Granit CookieCategory values — the CMP category names are configurable per deployment. ThirdPartyServices mappings in Http:Cookies keep working as before.

The category names must match those configured in the front-end @granit/cookies-cookieconsent adapter — the defaults align with the @cookieconsent/core built-in category identifiers.