SupabaseS
Supabase5mo ago
Muezz

User ID in Jwt Payload

I am trying to migrate to the new API keys and using getClaims instead of getUser for the purpose of checking if the user is authenticated as per the youtube video.

getClaims returns an object of the following type:
type Claims = {
  claims: JwtPayload;
  header: JwtHeader;
  signature: Uint8Array;
}
type JwtPayload = {
  iss: string
  sub: string
  aud: string | string[]
  exp: number
  iat: number
  role: string
  aal: AuthenticatorAssuranceLevels
  session_id: string
}


How can I get the current user's ID from this?
Was this page helpful?