The API uses Supabase’s createServerClient for authentication
Authentication state is maintained through cookies
The middleware automatically handles:
Cookie parsing from requests
Cookie setting in responses
Supabase client initialization
Copy
// Example of how authentication is processedconst supabase = createServerClient(supabaseUrl, supabaseAnonKey, { cookies: { getAll() { return parseCookieHeader(request.headers.cookie ?? ""); }, setAll(cookiesToSet) { // Cookies are automatically set in the response }, },});
You don’t need to manually handle authentication tokens. The Supabase SSR
middleware automatically manages the session through cookies.