import { supabase } from "https://deno.land/x/live@1.60.4/deps.ts";
const { RealtimeClient } = supabase;
Constructors
new
RealtimeClient(endPoint: string, options?: RealtimeClientOptions)Initializes the Socket.
Properties
Methods
channel(topic: string, params?: RealtimeChannelOptions): RealtimeChannel
connect(): void
Connects the socket, unless already connected.
connectionState(): CONNECTION_STATE
Returns the current state of the socket.
disconnect(code?: number, reason?: string): void
Disconnects the socket.
Returns all created channels
isConnected(): boolean
Returns true
is the connection is open.
log(): void
kind: string,
msg: string,
data?: any,
Logs the message.
For customized logging, this.logger
can be overridden.
push(data: RealtimeMessage): void
Push out a message if the socket is connected.
If the socket is not connected, the message gets enqueued within a local buffer, and sent out when a connection is next established.
removeAllChannels(): Promise<RealtimeRemoveChannelResponse[]>
Unsubscribes and removes all channels
removeChannel(channel: RealtimeChannel): Promise<RealtimeRemoveChannelResponse>
Unsubscribes and removes a single channel
setAuth(token: string | null): void
Sets the JWT access token used for channel subscription authorization and Realtime RLS.