Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Basit-Ali0/Yggdrasil/llms.txt
Use this file to discover all available pages before exploring further.
Overview
All API endpoints use Supabase Authentication to verify user identity and enforce Row-Level Security (RLS) policies. The authentication system supports two methods:- Cookie-based SSR authentication - For server-side rendered pages
- Bearer token authentication - For client-side API requests
Authentication Methods
Cookie-based Authentication
When making requests from server-side rendered pages, authentication is handled automatically through HTTP-only cookies managed by Supabase SSR.Bearer Token Authentication
For client-side requests, include the user’s JWT access token in theAuthorization header:
Obtaining Access Tokens
From the Supabase Client
Using the Token in API Requests
Authentication Flow
The authentication system tries multiple strategies in order:- Bearer Token - Checks the
Authorizationheader forBearer <token> - SSR Cookies - Falls back to cookie-based session authentication
- Unauthenticated - Returns 401 error if both methods fail
Row-Level Security (RLS)
All database tables use Supabase Row-Level Security policies that filter data by the authenticated user’s ID:auth.uid() function resolves to the user ID from the JWT token, ensuring users can only access their own data.
Important Notes
Error Responses
401 Unauthorized
Returned when authentication fails or no valid session is found:Common Causes
- Missing or invalid JWT token
- Expired session
- Missing
Authorizationheader - Invalid cookie data
Security Best Practices
- Never expose JWT tokens in client-side logs or error messages
- Use HTTPS for all API requests to prevent token interception
- Refresh tokens before they expire to maintain session continuity
- Store tokens securely - use HTTP-only cookies when possible
- Validate tokens server-side - never trust client-side authentication alone