Hello ! Is it possible to split my supabase featur...
# supabase-kt
y
Hello ! Is it possible to split my supabase feature into submodule, supabase:auth, supabase:database etc.. ? From what I understood in the doc we should have only one SupabaseClient instance across the entire app and the plugins must be installed at the creation of that instance
m
You can split your Supabase logic into submodules (e.g.,
supabase-auth
,
supabase-database
, etc.), but you should still have only one
SupabaseClient
in the entire app. A good approach is to make your project multimodule and create a dedicated core module (e.g.,
core:supabase
). Inside that module, you: • Configure and instantiate the single
SupabaseClient
• Install all needed plugins there (Auth, PostgREST, Realtime, Storage…) • Expose the client through DI (Koin/Hilt) Then each feature module (
feature:auth
,
feature:profile
,
feature:posts
, etc.) depends on the core module and receives the already-configured
SupabaseClient
through DI. This keeps the architecture clean, avoids duplicate clients, and respects Supabase’s recommended setup.
y
Yeah indeed creating a wrapper and then in supabase:auth implement only the auth
👍 1