Supabase Client Provider
API Contract
REST
/api/v1/auth
5 endpoints
GET
/api/v1/auth/api/v1/auth/session
Get current authenticated session and auth state
Public
Response Example
{
"user_id": "user_sup_abc123",
"email": "kari.nordmann@frivillig.no",
"org_id": "org_x9y8z7",
"role": "peer_mentor",
"session_expires_at": "2026-03-27T10:00:00Z",
"auth_state": "signed_in"
}
GET
/api/v1/auth/api/v1/auth/state
Get current auth state enum value
Public
Response Example
{
"auth_state": "signed_in",
"user_id": "user_sup_abc123",
"checked_at": "2026-03-26T10:00:00Z"
}
POST
/api/v1/auth/api/v1/auth/initialize
Initialize Supabase client connection
Public
Request Example
{
"url": "https://xyzabc.supabase.co",
"anon_key": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
Response Example
{
"initialized": true,
"project_url": "https://xyzabc.supabase.co",
"initialized_at": "2026-03-26T10:00:00Z"
}
PUT
/api/v1/auth/api/v1/auth/session
Refresh current session token
Public
Request Example
{
"refresh_token": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4..."
}
Response Example
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "bmV3UmVmcmVzaFRva2Vu...",
"expires_at": "2026-03-27T10:00:00Z"
}
DELETE
/api/v1/auth/api/v1/auth/session
Sign out and invalidate current session
Public
Response Example
{
"signed_out": true,
"auth_state": "signed_out"
}