Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

RealtimePresence

import { RealtimePresence } from "https://esm.sh/@supabase/supabase-js@2.101.0/dist/index.d.mts";
class RealtimePresence {
constructor(channel: RealtimeChannel, opts?: RealtimePresenceOptions);
private presenceAdapter;
channel: RealtimeChannel;
get state(): RealtimePresenceState;
}

§Constructors

§
new RealtimePresence(channel: RealtimeChannel, opts?: RealtimePresenceOptions)
[src]

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

§
presenceAdapter
[src]