meteor-pubsub
Installation
SKILL.md
Meteor publications and subscriptions
Publications stream a set of documents to subscribed clients and keep them live. The publication is the only place server-side authorization can filter rows before they reach the client.
Decision flow
- Does the client need this data reactively? If no, prefer a method (one-shot read). If yes, use a publication.
- Is the data user-specific? Filter by
this.userIdinside the publish function. Without that filter, documents leak across users. - Can the publication be expressed as a single cursor? Return it directly.
- Does it need one async lookup before choosing a cursor? Use an async publish handler, await the lookup, then return the cursor.
- Does it need per-document async joins, custom aggregation output, or an
external reactive source? Drop to the low-level
this.added/this.changed/this.removedAPI.