mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-28 04:57:42 +02:00
i18n×5 (settings-footnote → 'kein Web-Analytics'), security-headers CSP (stats.mana.how raus, GlitchTip bleibt), website-blocks (Provider-Enum 'umami' raus, plausible bleibt; Analytics/Inspector/Test), privacy-faq DE/EN, infra gpu-box .env/compose/README. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
28 lines
910 B
TypeScript
28 lines
910 B
TypeScript
import { z } from 'zod';
|
|
|
|
/**
|
|
* Analytics block — injects a tracking snippet into the published
|
|
* page. Opt-in, no cookies by design (Plausible is cookieless).
|
|
*
|
|
* The block renders nothing visible in edit/preview; in public mode
|
|
* it emits a single <script> tag. No PII collection (no visitor IDs,
|
|
* no fingerprinting), no admin UI access required.
|
|
*/
|
|
export const AnalyticsSchema = z.object({
|
|
provider: z.enum(['plausible']).default('plausible'),
|
|
/** Plausible: the domain property. */
|
|
siteKey: z.string().max(128).default(''),
|
|
/**
|
|
* Optional script-host override for self-hosted instances. Leave
|
|
* empty for the default provider CDN. Validated as full https URL.
|
|
*/
|
|
scriptUrl: z.string().max(512).default(''),
|
|
});
|
|
|
|
export type AnalyticsProps = z.infer<typeof AnalyticsSchema>;
|
|
|
|
export const ANALYTICS_DEFAULTS: AnalyticsProps = {
|
|
provider: 'plausible',
|
|
siteKey: '',
|
|
scriptUrl: '',
|
|
};
|