Topic name can be any string.
Topic name can be any string.
Creates an event handler that listens to changes.
The following is placed here to display on supabase.com/docs/reference/javascript/subscribe.
One of "broadcast", "presence", or "postgres_changes".
Custom object specific to the Realtime feature detailing which payloads to receive.
Function to be invoked when event handler is triggered.
Sends a message into the channel.
Arguments to send to channel
The name of the event being sent
Optional
payload?: anyPayload to be sent
The type of event to send
Optional
opts: { Options to be used during the send process
Subscribe registers your client with the server
Optional
callback: ((status: REALTIME_SUBSCRIBE_STATES, err?: Error) => void)Optional
err: ErrorOptional
timeout: numberOptional
opts: { Leaves the channel.
Unsubscribes from server events, and instructs channel to terminate on server. Triggers onClose() hooks.
To receive leave acknowledgements, use the a receive
hook to bind to the server ack, ie:
channel.unsubscribe().receive("ok", () => alert("left!") )
Optional
timeout: numberOptional
opts: { Generated using TypeDoc
A channel is the basic building block of Realtime and narrows the scope of data flow to subscribed clients. You can think of a channel as a chatroom where participants are able to see who's online and send and receive messages.