requestsolution / lib /anon-id.ts
Jacksuyu's picture
Claude Opus 4.6
Initial release: Community Demand Board V0.1
8e944c6
Raw History Blame Contribute Delete
274 Bytes
import { cookies } from "next/headers";
export async function getAnonId(): Promise<string> {
const cookieStore = await cookies();
const anonId = cookieStore.get("anon_id")?.value;
if (!anonId) {
throw new Error("anon_id cookie not found");
}
return anonId;
}