Supporters
JOIN MY SPONSORS

Viewers

Connecting with the { announce: true } option broadcasts your identity when you join or leave, displaying your uid and alias in the event.

For this example, you are .... New arrivals appear as they join — but viewers already here before you remain invisible until they interact.

Online
+ 1 other
Activity
no activity yet...
viewers.ts
import { connect } from 'itty-sockets'

connect('ittysockets.com:demos/viewers', {
  announce: true,
  as: '...',
})
  .on('join', ({ uid, alias, users }) => {
    // a user joined — we know their uid + alias
  })
  .on('leave', ({ uid, alias, users }) => {
    // a user left
  })