feat/analytics #9

Merged
GauthierWebDev merged 29 commits from feat/analytics into main 2025-04-18 15:05:51 +00:00
2 changed files with 8 additions and 2 deletions
Showing only changes of commit 86409da7ec - Show all commits

View File

@ -19,7 +19,10 @@ declare global {
namespace Vike {
interface PageContext {
cookies: Partial<{
consent: boolean;
consent: {
analytics: boolean;
customization: boolean;
};
theme: Theme;
}>;
}

View File

@ -15,7 +15,10 @@ export const vikeHandler: Get<[], UniversalHandler> = () => async (request, cont
urlOriginal: request.url,
headersOriginal: request.headers,
cookies: {
consent: cookies.get("consent", Boolean) || false,
consent: {
analytics: cookies.get("consent-analytics", Boolean) || false,
customization: cookies.get("consent-customization", Boolean) || false,
},
theme: cookies.get("theme") || "light",
},
};