Dart Reference v2.0

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
    url
    REQUIRED
    string

    The unique Supabase URL which is supplied when you create a new project in your project dashboard.

    anonKey
    REQUIRED
    string

    The unique Supabase Key which is supplied when you create a new project in your project dashboard.

    headers
    Optional
    Map<String, String>

    Custom header to be passed to the Supabase client.

    httpClient
    Optional
    Client

    Custom http client to be used by the Supabase client.

    authOptions
    Optional
    FlutterAuthClientOptions

    Options to change the Auth behaviors.

    postgrestOptions
    Optional
    PostgrestClientOptions

    Options to change the Postgrest behaviors.

    realtimeClientOptions
    Optional
    RealtimeClientOptions

    Options to change the Realtime behaviors.

    storageOptions
    Optional
    StorageClientOptions

    Options to change the Storage behaviors.


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;