Overview
PulseGrid presence lets you track who is online in a channel, how many are online, and when people join or leave.
Setup
Use:
- presence()
- onlineCount()
- isOnline(identifierId)
Over websocket you can also request:
- requestPresenceSnapshot()
- checkPresence(identifierId)
Code example
const channel = pulsegrid.channel("demo-channel");
console.log(await channel.presence());
console.log(await channel.onlineCount());
console.log(await channel.isOnline("user_123"));
const chat = await channel.connect({
clientToken: token,
onMessage: (payload) => console.log(payload),
});
chat.requestPresenceSnapshot();
chat.checkPresence("user_123");
Notes
Useful for chat apps, collaboration tools, support systems, and anything that needs join/leave or online/offline tracking.