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 23, 2026

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 useraccesspolicies +row policiesRealtimedoclisten:<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.
  • All of a client's listeners share one realtime connection: the JavaScript SDK sends a random per-client client_channel, so ten onSnapshots are one WebSocket and one reconnect loop, and they are renewed in one request. The shared channel belongs to that client and its signed-in user only.
  • A listener doesn't run its query twice on start: once the connection is up, the SDK re-reads only if a change landed in between.
  • 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.
  • Collection groups: sov.collectionGroup('comments').onSnapshot(…) (or "collection_group": true on _listen) listens to every collection with that id; documents are keyed by their full path, and each renewal re-checks the rules per collection pattern.
  • 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.

#Coming from Firebase or Supabase?

PlatformWhat this is called there
FirebaseFirestore onSnapshot listeners
SupabaseSupabase Realtime Postgres Changes
SovariaLive listeners

Moving an existing app? Migrate from Supabase or Firebase imports users (with their passwords), data, files and rules.