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

# Authentication API

> Authentication endpoints and flows.

# Authentication API

Authentication is handled by **Supabase Auth** directly — not through custom API endpoints.

## Client-Side Auth

Use the Supabase client SDK in `apps/web`:

```typescript theme={null}
import { createClient } from "@/lib/supabase/client";

// Login
const supabase = createClient();
const { data, error } = await supabase.auth.signInWithPassword({
  email: "user@example.com",
  password: "password",
});

// Signup
const { data, error } = await supabase.auth.signUp({
  email: "user@example.com",
  password: "password",
  options: {
    data: { full_name: "John Doe" },
  },
});
```

## API Token Verification

The NestJS API verifies tokens via the `SupabaseGuard`:

```typescript theme={null}
@UseGuards(SupabaseGuard)
@Get("protected")
getProtected(@Req() req) {
  const user = req.user; // Verified Supabase user
  return { userId: user.id };
}
```
