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.
VerifiedClaims, with typed properties such as subject, email, role, sessionID, and expiresAt.claims() verifies the access token of the current session, and refreshes an expired session first. claims(jwt:) verifies the token you pass.kid header is verified on the device against the project's JSON Web Key Set.user(jwt:): a token signed with a symmetric key (HS256), a token without a kid, and a token whose key the client cannot find.exp or sub claim fails verification. The anon key and the service role key have no sub, so claims(jwt:) rejects them.The JWT to verify. Use `claims(options:)` to verify the access token from the current session.
Options for JWT verification. Can specify `allowsExpired` to skip expiration check and `jwks` to provide custom JSON Web Key Set.
let claims = try await supabase.auth.claims()
print("User ID: \(claims.subject)")
print("Email: \(claims.email ?? "N/A")")
print("Role: \(claims.role ?? "N/A")")
let customToken = "eyJhbGci..."
let claims = try await supabase.auth.claims(jwt: customToken)
let claims = try await supabase.auth.claims(
options: ClaimsOptions(allowsExpired: true)
)
let customJWKS = JWKS(keys: myKeys)
let claims = try await supabase.auth.claims(
options: ClaimsOptions(jwks: customJWKS)
)