Pusher or Ably
A hosted service that holds the open connections for you.
Pick it when You deploy on Vercel or similar and need live updates without running a server.
Skip it if You want zero extra vendors or very low cost at high message volume.
- Works with serverless hosts
- Handles reconnecting and scaling
- A few lines to publish an event
- Another bill that grows with connections
- Your live features depend on them
- Quick to set up
- Cheap while small
- Easy to leave
- Room to grow
PriceFree tier, then pay per connection and message
How to connect it
- Create an app in the dashboard and copy the keys.
- Publish an event from your server when data changes.
- Subscribe to the channel in the browser with the public key.
- Use private channels so only allowed users can listen.
PUSHER_APP_IDPUSHER_KEYPUSHER_SECRETPUSHER_CLUSTER
import Pusher from "pusher";
const pusher = new Pusher({
appId: process.env.PUSHER_APP_ID!,
key: process.env.PUSHER_KEY!,
secret: process.env.PUSHER_SECRET!,
cluster: process.env.PUSHER_CLUSTER!,
});
await pusher.trigger("room-42", "new-message", { text: "Hello" });