Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
534 B ยท 17 lines
TypeScript
123456789101112131415161718import { cookies } from "next/headers";
import { COOKIE_NAME } from "./shared";import { preferencesSchema } from "./validation";
export async function getPreferredSettings() { const cookieStore = await cookies(); const cookie = cookieStore.get(COOKIE_NAME); const parsed = cookie ? JSON.parse(cookie.value) : {}; const settings = preferencesSchema.safeParse(parsed); if (!settings.success) return undefined; return settings.data;}
export type PreferredSettings = Awaited< ReturnType<typeof getPreferredSettings>>;