Openstatus www.openstatus.dev
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 17 lines 534 B view raw
1import { cookies } from "next/headers"; 2 3import { COOKIE_NAME } from "./shared"; 4import { preferencesSchema } from "./validation"; 5 6export async function getPreferredSettings() { 7 const cookieStore = await cookies(); 8 const cookie = cookieStore.get(COOKIE_NAME); 9 const parsed = cookie ? JSON.parse(cookie.value) : {}; 10 const settings = preferencesSchema.safeParse(parsed); 11 if (!settings.success) return undefined; 12 return settings.data; 13} 14 15export type PreferredSettings = Awaited< 16 ReturnType<typeof getPreferredSettings> 17>;