Initializing
You can initialize Supabase with the static initialize()
method of the Supabase
class.
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.
Parameters
The unique Supabase URL which is supplied when you create a new project in your project dashboard.
The unique Supabase Key which is supplied when you create a new project in your project dashboard.
Custom header to be passed to the Supabase client.
Custom http client to be used by the Supabase client.
Options to change the Auth behaviors.
Whether to use the `pkce` flow or the `implicit` flow. Defaults to `pkce`.
Parameter to override the local storage to store auth tokens.
Whether to automatically refresh the token when it expires. Defaults to `true`.
Options to change the Postgrest behaviors.
Schema to query with the Supabase client. Defaults to `public`.
Options to change the Realtime behaviors.
Level of realtime server logs to to be logged.
Options to change the Storage behaviors.
The number of times to retry a failed upload request. Defaults to `0`.
Future<void> main() async {
await Supabase.initialize(
url: 'https://xyzcompany.supabase.co',
anonKey: 'public-anon-key',
);
runApp(MyApp());
}
// Get a reference your Supabase client
final supabase = Supabase.instance.client;