Ā© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•7mo ago•
1 reply
IliasB

Using supabase-kt with per-request JWTs (GraphQL Kotlin backend, RLS enabled)

Hi everyone šŸ‘‹

I'm building a mobile app with:

* an Expo frontend (React Native),
* a Kotlin backend exposing a GraphQL API,
* and Supabase as the database (hosted, with RLS enabled).

What I'm trying to do:


For every request, the frontend sends a JWT in the Authorization header.
My backend verifies it and then needs to query Supabase on behalf of the user, so that RLS policies apply correctly.

I'm using
io.github.jan-tennert.supabase-kt
io.github.jan-tennert.supabase-kt
, version
2.1.2
2.1.2
, with the PostgREST plugin.
So far, the only way I've found to pass a custom JWT is by creating a new
SupabaseClient
SupabaseClient
per request with the user's token.
This works, but I'm worried about resource usage and scalability, especially with concurrent users.

My question:


āž”ļø Is there a way to inject a custom
Authorization
Authorization
header (JWT)
per request, without creating a new Supabase client each time?

Or alternatively, is there a recommended approach to safely and efficiently query Supabase with dynamic tokens from a Kotlin backend?

Thanks a lot for any tips or examples !
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

New supabase-kt
SupabaseSSupabase / help-and-questions
4y ago
Graphql with supabase
SupabaseSSupabase / help-and-questions
4y ago
Count in Supabase-kt
SupabaseSSupabase / help-and-questions
5mo ago
Python: Insertion with RLS enabled
SupabaseSSupabase / help-and-questions
14mo ago