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.pkce
in order to perform auth actions with pkce flow.
Constructors
-
SupabaseClient(String supabaseUrl, String supabaseKey, {String? schema, bool autoRefreshToken = true, Map<
String, String>? headers, Client? httpClient, int storageRetryAttempts = 0, RealtimeClientOptions realtimeClientOptions = const RealtimeClientOptions(), YAJsonIsolate? isolate, GotrueAsyncStorage? gotrueAsyncStorage, AuthFlowType authFlowType = AuthFlowType.implicit}) - Creates a Supabase client to interact with your Supabase instance.
Properties
- auth ↔ GoTrueClient
-
latefinal
- authUrl → String
-
final
- functions ↔ FunctionsClient
-
Supabase Functions allows you to deploy and invoke edge functions.
latefinal
- functionsUrl → String
-
final
- hashCode → int
-
The hash code for this object.
read-onlyinherited
-
headers
↔ Map<
String, String> -
Getter for the HTTP headers
read / write
- realtime ↔ RealtimeClient
-
latefinal
- realtimeUrl → String
-
final
- rest ↔ PostgrestClient
-
latefinal
- restUrl → String
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- schema → String
-
final
- storage ↔ SupabaseStorageClient
-
Supabase Storage allows you to manage user-generated content, such as photos or videos.
latefinal
- storageUrl → String
-
final
- supabaseKey → String
-
final
- supabaseUrl → String
-
final
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(
String fn, {Map< String, dynamic>? params, FetchOptions options = const FetchOptions()}) → PostgrestFilterBuilder - Perform a stored procedure call.
-
toString(
) → String -
A string representation of this object.
inherited
-
useSchema(
String schema) → PostgrestClient - Select a schema to query or perform an function (rpc) call.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited