© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•7mo ago•
2 replies
Muezz

User ID in Jwt Payload

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

getClaims
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
}
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?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

requesting_user_id() function to get 'sub' from Clerk JWT
SupabaseSSupabase / help-and-questions
4y ago
Get JWT from another user
SupabaseSSupabase / help-and-questions
8mo ago
Access user_metadata property from JWT in RLS
SupabaseSSupabase / help-and-questions
3y ago
SignIn with user id
SupabaseSSupabase / help-and-questions
4y ago