Yoni Obia
12/01/2025, 12:44 PMMohyddine AL-Lahham
12/01/2025, 12:57 PMsupabase-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.Yoni Obia
12/01/2025, 1:37 PM