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.
accessToken Optional function for using a third-party authentication system with Supabase.
The function should return an access token or ID token (JWT) by obtaining
it from the third-party auth client library. Note that this function may be
called concurrently and many times. Use memoization and locking techniques
if this is not supported by the client libraries. When set, the auth
namespace of the Supabase client cannot be used.
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(), FunctionsClientOptions functionsOptions = const FunctionsClientOptions(), RealtimeClientOptions realtimeClientOptions = const RealtimeClientOptions(), Future<
String?> accessToken()?, Map<String, String> ? headers, Client? httpClient, YAJsonIsolate? isolate}) - Creates a Supabase client to interact with your Supabase instance.
Properties
-
accessToken
→ Future<
String?> Function()? -
final
- auth → GoTrueClient
-
no setter
- 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, dynamic get = false}) → PostgrestFilterBuilder<T> - Performs 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