Spaces:
Build error

File size: 274 Bytes
8e944c6
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
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;
}