RealtimePresence
import { RealtimePresence } from "https://esm.sh/@supabase/supabase-js@2.101.0/dist/index.d.mts";class RealtimePresence {}
§Constructors
§
Creates a Presence helper that keeps the local presence state in sync with the server.
@param channel
- The realtime channel to bind to.
@param opts
- Optional custom event names, e.g.
{ events: { state: 'state', diff: 'diff' } }.
@example
Example for a presence channel
const presence = new RealtimePresence(channel)
channel.on('presence', ({ event, key }) => {
console.log(`Presence ${event} on ${key}`)
})
§Properties
§
channel: RealtimeChannel
[src]§
state: RealtimePresenceState readonly
[src]