Files
vercel__eve/apps/docs/lib/geistdocs/md-tracking.ts
Andrew Barba f44e16a3e5 Hello Eve (#1)
Co-authored-by: Casey Gowrie <ctgowrie@gmail.com>
Co-authored-by: Allen Zhou <46854522+allenzhou101@users.noreply.github.com>
Co-authored-by: Rui Conti <ruiconti@gmail.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Timo Lins <1440854+timolins@users.noreply.github.com>
Co-authored-by: Felix Arntz <3531426+felixarntz@users.noreply.github.com>
Co-authored-by: Shar Dara <2982650+darafsheh@users.noreply.github.com>
Co-authored-by: John Phamous <johnphammail@gmail.com>
2026-06-16 18:10:54 +01:00

27 lines
775 B
TypeScript

import type { TrackMarkdownRequestEvent } from "@vercel/geistdocs/proxy";
import { siteId } from "@/geistdocs";
const PLATFORM_URL = "https://geistdocs.com/md-tracking";
/** Track a markdown page request via the Geistdocs platform. */
export async function trackMdRequest(event: TrackMarkdownRequestEvent): Promise<void> {
try {
const response = await fetch(PLATFORM_URL, {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
...event,
siteId: siteId ?? "geistdocs-unknown",
}),
});
if (!response.ok) {
console.error("MD tracking failed:", response.status, await response.text());
}
} catch (error) {
console.error("MD tracking error:", error);
}
}