Short answer: In Express, create one private channel per user on first use, publish the app notification server-side, and give the client a token scoped to that user channel.
The important design choice is trust, not transport speed: a browser must never be able to select another patient's or clinician's channel by changing a string.
The inbox record belongs in the same application handler as the publish request. That gives the notification a durable home even when the recipient is offline, while the realtime event remains a prompt to refresh or display the new item. I treat those as two delivery surfaces with different guarantees.
How should Node.js publish an app notification to a user channel?
A channel name is an identifier, not an authorization policy. In a shared workspace, a predictable value such as user-1842 is useful for routing but dangerous as a client-controlled subscription target.…