Securely connect your microapp to Supabase using JWT bridging for authentication and data access.
your-supabase-url
and your-anon-key
with your actual Supabase project values.
JWT Secret
useAuth()
useSupabase
hook creates a client with the user’s tokensub
claim as the user IDsub
is used by Supabase as auth.uid()
and contains the user IDmetadata.user
contains user information like email and profile picturemetadata.app
contains the microapp detailsaud
and role
are set to “authenticated” for Supabase compatibilityexp
is the expiration time (in seconds since epoch)iat
is the issued-at timegetUserJwtToken()
method or refresh the pageuseSupabase
hook automatically uses the latest token from useAuth()
getUserJwtToken()