Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deco/deps.ts>supabase.SupabaseClient

Git-based Visual CMS for Deno, </> htmx and Tailwind apps. Deploy on any Deno-compatible host.
Go to Latest
class supabase.SupabaseClient
Re-export
import { supabase } from "https://deno.land/x/deco@1.75.1/deps.ts";
const { SupabaseClient } = supabase;

Supabase Client.

An isomorphic Javascript client for interacting with Postgres.

Constructors

new
SupabaseClient(
supabaseUrl: string,
supabaseKey: string,
)

Create a new client for use in the browser.

Type Parameters

optional
Database = any
optional
SchemaName extends string & keyof Database = "public" extends keyof Database ? "public" : string & keyof Database
optional
Schema extends GenericSchema = Database[SchemaName] extends GenericSchema ? Database[SchemaName] : any

Properties

private
_getAccessToken
private
_handleTokenChanged
private
_initRealtimeClient
private
_initSupabaseAuthClient
private
_listenForAuthEvents
protected
authUrl: string
protected
changedAccessToken: string | undefined
protected
optional
fetch: Fetch
protected
functionsUrl: string
protected
headers: { [key: string]: string; }
protected
realtime: RealtimeClient
protected
realtimeUrl: string
protected
rest: PostgrestClient<Database, SchemaName>
protected
storageKey: string
protected
storageUrl: string
protected
supabaseKey: string
protected
supabaseUrl: string
auth: SupabaseAuthClient

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

readonly
functions: FunctionsClient

Supabase Functions allows you to deploy and invoke edge functions.

readonly
storage: SupabaseStorageClient

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

Methods

Creates a Realtime channel with Broadcast, Presence, and Postgres Changes.

from<TableName extends string & keyof Schema["Tables"], Table extends Schema["Tables"][TableName]>(relation: TableName): PostgrestQueryBuilder<Schema, Table>

Perform a table operation.

from<ViewName extends string & keyof Schema["Views"], View extends Schema["Views"][ViewName]>(relation: ViewName): PostgrestQueryBuilder<Schema, View>
from(relation: string): PostgrestQueryBuilder<Schema, any>

Returns all Realtime channels.

removeAllChannels(): Promise<("ok" | "timed out" | "error")[]>

Unsubscribes and removes all Realtime channels from Realtime client.

removeChannel(channel: RealtimeChannel): Promise<"ok" | "timed out" | "error">

Unsubscribes and removes Realtime channel from Realtime client.

rpc<FunctionName extends string & keyof Schema["Functions"], Function_ extends Schema["Functions"][FunctionName]>(
fn: FunctionName,
args?: Function_["Args"],
options?: { head?: boolean; count?: "exact" | "planned" | "estimated"; },
): PostgrestFilterBuilder<Schema, Function_["Returns"] extends any[] ? Function_["Returns"][number] extends Record<string, unknown> ? Function_["Returns"][number] : never : never, Function_["Returns"]>

Perform a function call.