SupabaseClient class

Creates a Supabase client to interact with your Supabase instance.

supabaseUrl and supabaseKey can be found on your Supabase dashboard.

You can access none public schema by passing different schema.

Default headers can be overridden by specifying headers.

Custom http client can be used by passing httpClient parameter.

storageRetryAttempts specifies how many retry attempts there should be to upload a file to Supabase storage when failed due to network interruption.

realtimeClientOptions specifies different options you can pass to RealtimeClient.

Pass an instance of YAJsonIsolate to isolate to use your own persisted isolate instance. A new instance will be created if isolate is omitted.

Pass an instance of gotrueAsyncStorage and set the authFlowType to AuthFlowType.pkcein order to perform auth actions with pkce flow.

Constructors

SupabaseClient(String supabaseUrl, String supabaseKey, {PostgrestClientOptions postgrestOptions = const PostgrestClientOptions(), AuthClientOptions authOptions = const AuthClientOptions(), StorageClientOptions storageOptions = const StorageClientOptions(), RealtimeClientOptions realtimeClientOptions = const RealtimeClientOptions(), Map<String, String>? headers, Client? httpClient, YAJsonIsolate? isolate})
Creates a Supabase client to interact with your Supabase instance.

Properties

auth GoTrueClient
latefinal
functions FunctionsClient
Supabase Functions allows you to deploy and invoke edge functions.
latefinal
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
Getter for the HTTP headers
getter/setter pair
realtime RealtimeClient
latefinal
rest PostgrestClient
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
storage SupabaseStorageClient
Supabase Storage allows you to manage user-generated content, such as photos or videos.
latefinal

Methods

channel(String name, {RealtimeChannelConfig opts = const RealtimeChannelConfig()}) RealtimeChannel
Creates a Realtime channel with Broadcast, Presence, and Postgres Changes.
dispose() Future<void>
from(String table) SupabaseQueryBuilder
Perform a table operation.
getChannels() List<RealtimeChannel>
Returns all Realtime channels.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAllChannels() Future<List<String>>
Unsubscribes and removes all Realtime channels from Realtime client.
removeChannel(RealtimeChannel channel) Future<String>
Unsubscribes and removes Realtime channel from Realtime client.
rpc<T>(String fn, {Map<String, dynamic>? params}) PostgrestFilterBuilder<T>
Perform a stored procedure call.
schema(String schema) SupabaseQuerySchema
Select a schema to query or perform an function (rpc) call.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited