SupabaseClientInterceptor class abstract

Extends a SupabaseClient from the outside, without changing how the application calls it.

An interceptor can wrap the PostgrestTableExecutor that runs the requests of the typed table API, SupabaseClient.table, and of the typed function calls, PostgrestRpc.rows and PostgrestRpc.value, and receives the client once it is fully constructed. The untyped SupabaseClient.from and PostgrestRpc.call, storage, functions and realtime traffic never passes through an interceptor.

Interceptors are given to the SupabaseClient constructor, or to Supabase.initialize in Flutter:

final supabase = SupabaseClient(url, key, interceptors: [offline]);
Annotations
  • @experimental

Constructors

SupabaseClientInterceptor()
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

attach(SupabaseClient client) → void
Called once with the fully constructed client, after every service client exists.
dispose() → Future<void>
Called from SupabaseClient.dispose before the service clients are disposed. An error thrown here is logged and does not stop the other interceptors or the client from being disposed.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resume() → Future<void>
Called when the host application returns to the foreground, for example on AppLifecycleState.resumed in Flutter.
toString() → String
A string representation of this object.
inherited
wrapTableExecutor(PostgrestTableExecutor inner) → PostgrestTableExecutor
Returns the executor SupabaseClient.table and the typed function calls of SupabaseClient.rpc run their requests through. A function call arrives as a request with PostgrestTableOperation.rpc, which counts as a mutation unless PostgrestTableRequest.readOnly is set. Its PostgrestTableRequest.table has no primary key, and a call read with PostgrestResultShape.value has no rows to convert.

Operators

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