Table of Contents

Class Client

Namespace
Supabase
Assembly
Supabase.dll

A class representing the Supabase Client, coordinating between all child APIs

public class Client : ISupabaseClient<User, Session, RealtimeSocket, RealtimeChannel, Bucket, FileObject>
Inheritance
Client
Implements
Inherited Members

Constructors

Client(IGotrueClient<User, Session>, IRealtimeClient<RealtimeSocket, RealtimeChannel>, IFunctionsClient, IPostgrestClient, IStorageClient<Bucket, FileObject>, SupabaseOptions)

Constructor supplied for dependency injection support.

public Client(IGotrueClient<User, Session> auth, IRealtimeClient<RealtimeSocket, RealtimeChannel> realtime, IFunctionsClient functions, IPostgrestClient postgrest, IStorageClient<Bucket, FileObject> storage, SupabaseOptions options)

Parameters

auth IGotrueClient<User, Session>
realtime IRealtimeClient<RealtimeSocket, RealtimeChannel>
functions IFunctionsClient
postgrest IPostgrestClient
storage IStorageClient<Bucket, FileObject>
options SupabaseOptions

Client(string, string?, SupabaseOptions?)

Creates a new Supabase Client.

public Client(string supabaseUrl, string? supabaseKey, SupabaseOptions? options = null)

Parameters

supabaseUrl string
supabaseKey string
options SupabaseOptions

Properties

Auth

Supabase Auth allows you to create and manage user sessions for access to data that is secured by access policies.

public IGotrueClient<User, Session> Auth { get; set; }

Property Value

IGotrueClient<User, Session>

Functions

Supabase Edge functions allow you to deploy and invoke edge functions.

public IFunctionsClient Functions { get; set; }

Property Value

IFunctionsClient

Postgrest

Supabase Postgrest allows for strongly typed REST interactions with the your database.

public IPostgrestClient Postgrest { get; set; }

Property Value

IPostgrestClient

Realtime

Supabase Realtime allows for realtime feedback on database changes.

public IRealtimeClient<RealtimeSocket, RealtimeChannel> Realtime { get; set; }

Property Value

IRealtimeClient<RealtimeSocket, RealtimeChannel>

Storage

Supabase Storage allows you to manage user-generated content, such as photos or videos.

public IStorageClient<Bucket, FileObject> Storage { get; set; }

Property Value

IStorageClient<Bucket, FileObject>

Methods

AdminAuth(string)

Returns a Stateless Gotrue Admin client given a service_key JWT. This should really only be accessed from a server environment where a private service_key would remain secure.

public IGotrueAdminClient<User> AdminAuth(string serviceKey)

Parameters

serviceKey string

Returns

IGotrueAdminClient<User>

From<TModel>()

Gets the Postgrest client to prepare for a query.

public ISupabaseTable<TModel, RealtimeChannel> From<TModel>() where TModel : BaseModel, new()

Returns

ISupabaseTable<TModel, RealtimeChannel>

Type Parameters

TModel

InitializeAsync()

Attempts to retrieve the session from Gotrue (set in SupabaseOptions) and connects to realtime (if options.AutoConnectRealtime is set)

public Task<ISupabaseClient<User, Session, RealtimeSocket, RealtimeChannel, Bucket, FileObject>> InitializeAsync()

Returns

Task<ISupabaseClient<User, Session, RealtimeSocket, RealtimeChannel, Bucket, FileObject>>

Rpc(string, object?)

Perform a stored procedure call.

public Task<BaseResponse> Rpc(string procedureName, object? parameters)

Parameters

procedureName string

The function name to call

parameters object

The parameters to pass to the function call

Returns

Task<BaseResponse>

Rpc<TModeledResponse>(string, object?)

Perform a stored procedure call.

public Task<TModeledResponse?> Rpc<TModeledResponse>(string procedureName, object? parameters)

Parameters

procedureName string

The function name to call

parameters object

The parameters to pass to the function call

Returns

Task<TModeledResponse>

A hydrated model

Type Parameters

TModeledResponse

A type used for hydrating the HTTP response content (hydration through JSON.NET)