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
Payload to be sent
The type of event to send
Options to be used during the send process
Subscribe registers your client with the server
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!") )
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.