Web vitals: prefer external RUM

This commit is contained in:
adilallo
2026-04-21 07:08:31 -06:00
parent aaa3e4d654
commit 2d58887a15
17 changed files with 713 additions and 372 deletions
+15
View File
@@ -0,0 +1,15 @@
import { z } from "zod";
/** POST /api/web-vitals — browser ingest payload */
export const webVitalIngestSchema = z.object({
metric: z.string().min(1).max(64),
data: z.object({
value: z.number().finite(),
rating: z.string().min(1).max(32),
}),
url: z.string().min(1).max(8192),
userAgent: z.string().max(512).optional().default(""),
timestamp: z.union([z.string(), z.number()]),
});
export type WebVitalIngestInput = z.infer<typeof webVitalIngestSchema>;