For AI agents: the documentation index is at llms.txt. Guide pages have a markdown version at the same path with .md appended, before any query string or fragment.

Swift: Get user claims from verified JWT

Parameters

Examples

Verify and get claims from current session

let claims = try await supabase.auth.claims()
print("User ID: \(claims.subject)")
print("Email: \(claims.email ?? "N/A")")
print("Role: \(claims.role ?? "N/A")")

Verify and get claims from a specific JWT

let customToken = "eyJhbGci..."
let claims = try await supabase.auth.claims(jwt: customToken)

Get claims from an expired JWT

let claims = try await supabase.auth.claims(
  options: ClaimsOptions(allowsExpired: true)
)

Verify JWT with custom JWKS

let customJWKS = JWKS(keys: myKeys)
let claims = try await supabase.auth.claims(
  options: ClaimsOptions(jwks: customJWKS)
)