Authentication

This API uses Supabase authentication with server-side rendering (SSR) middleware. Authentication is handled through cookies and the Supabase client.

How it works

  1. The API uses Supabase’s createServerClient for authentication
  2. Authentication state is maintained through cookies
  3. The middleware automatically handles:
    • Cookie parsing from requests
    • Cookie setting in responses
    • Supabase client initialization
// Example of how authentication is processed
const 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.

Required Headers

When making requests, ensure your cookies are properly sent with the request. The middleware will handle the rest of the authentication process.

Cookie: sb-access-token=your-token; sb-refresh-token=your-refresh-token