Docs

Live listeners

Get a document or a query's results, then every change to them as it happens: added, modified and removed.

Updated Oct 17, 2026Open in console

A live listener is a query (or one document) that stays open. You get the current results first, then a snapshot with the changes every time a write affects them. Each listener sees only what its own user may read: the query re-runs as that user, with your collection rules and row policies.

affected?diffAny writeset · update· commit ·deleteChange streamonlycollectionswithRe-run as the listener's userGuard + rowpoliciesRealtimedoclisten:<id>· owner onlyYour appadded ·modified ·removed
const stop = await sov.collection('rooms/r1/messages')
  .orderBy('at', 'desc').limit(50)
  .onSnapshot((snap) => {
    render(snap.docs)
    for (const c of snap.changes) console.log(c.type, c.doc.id)   // added | modified | removed
  }, (err) => console.warn(err))

const stopDoc = await sov.doc('users/alice').onSnapshot((doc) => setProfile(doc.data))
stop(); stopDoc()

How it behaves

  • Only the user who started a listener can subscribe to its channel, and nobody can publish on it.
  • Listeners expire after 10 minutes unless renewed; the SDKs renew every 5 minutes. Renewing checks the collection rules again, so revoked access stops within one renewal.
  • After a reconnect, or when an update was missed, the SDKs re-run the query once and report the difference, so a snapshot never silently drifts.
  • Writes to collections nobody listens to cost nothing extra.
  • Each update is one realtime message and counts toward monthly realtime messages; listener channels don't count toward realtime channels.

Plan limits

LimitFreeProUltraTeamEnterprise
Live listeners open at once (docs.max_listeners)1002,00010,00025,000100,000
Documents one listener tracks (docs.listener_max_docs)5001,0002,0005,00010,000

Over the cap, starting a listener returns 403 PLAN_LIMIT_REACHED.

Something unclear or missing on this page?Tell us