> ## Documentation Index
> Fetch the complete documentation index at: https://docs.intelliq.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> API Reference for IntelliQ

## 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

```typescript theme={null}
// 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
    },
  },
});
```

<Note>
  You don't need to manually handle authentication tokens. The Supabase SSR
  middleware automatically manages the session through cookies.
</Note>

### Required Headers

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

```bash theme={null}
Cookie: sb-access-token=your-token; sb-refresh-token=your-refresh-token
```
