Your backend can push to connected clients: “your export is ready”, “the order shipped”, “maintenance in five minutes”. It doesn’t need a live connection to do it.

Decide who may publish (Studio)

Services → Realtime → Settings → Apps may publish. Off: only your servers and flows publish; apps can still listen. For notification-style channels turn it off, and set the channel rule’s Publish policy to Secret keys & Studio (Channel rules).

Publish from your server

The result gives the message id. With a secret key a message has from: "server". A publishable key is subject to the channel’s Publish policy, which is how a browser publishes without a socket.

Publish from a flow

Flows can publish too. In the flow editor (Logic → Flows), add the Realtime publish step, choose the channel and event, and map the payload from earlier steps. No code is needed.

Webhook subscriptions

Services → Realtime → Subscriptions → Webhook subscriptions. Webhooks that fire on every publish. New webhook subscription: Use it to mirror live traffic to a log, an analytics tool or another service. The list shows Delivered counts; with none it says No webhook is subscribed to realtime events.

Pattern: tell one person

  1. Add a channel rule user:{{ auth.id }} (Kind Private), Subscribe Signed-in users, Publish Secret keys & Studio. A person can only open their own inbox.
  2. Each signed-in client subscribes to user:<their id>.
  3. Your server or a flow publishes to that channel when something happens.

Messages are not storage

A client that’s offline when you publish only receives the message if the channel keeps history and the client replays (History). For anything that must reach the person, save a record (a notification row) and publish a message telling the app to look.

Tips

  • Keep payloads small: identifiers and a little text.
  • Name events for what happened (order.shipped), not what the client should do.
  • Publish after the change is saved, so a client that reacts can read the data.

Channel rules

Publish policy.

Playground

Send a test publish.