Initializing
Flutter#
For supabase-flutter
, you will be using the static initialize()
method on Supabase
class.
Flutter initialize()
#
main.dart1Future<void> main() async { 2 await Supabase.initialize(url: 'https://xyzcompany.supabase.co', anonKey: 'public-anon-key'); 3 runApp(MyApp()); 4}
Access SupabaseClient
instance#
Once you initialize Supabase in your main()
method, you can access the SupabaseClient
instance from anywhere in your app.
1final supabase = Supabase.instance.client;
Other Dart Projects#
You can initialize a new Supabase client using the SupabaseClient()
method.
The Supabase client is your entrypoint to the rest of the Supabase functionality and is the easiest way to interact with everything we offer within the Supabase ecosystem.
Dart SupabaseClient()
#
1final supabase = SupabaseClient('https://xyzcompany.supabase.co', 'public-anon-key');