Realtime channels
Public channels
Good for open events where users do not need special permission to listen.public-feed.globalRealtime channels
Private channels
Good for messages, private dashboards, account events, order updates, and user-specific rooms.private-chat.room.42Realtime channels
Presence channels
Good for online members, active viewers, live collaboration, delivery rooms, and team activity.presence-order.884import { authorizePrivateChannel } from "@domvia/realtime-server";
app.post("/realtime/auth", async (request, response) => {
const user = await requireSignedInUser(request);
const channelName = request.body.channel_name;
if (!user.canJoin(channelName)) {
return response.status(403).json({ message: "Forbidden" });
}
return response.json(
await authorizePrivateChannel({
key: process.env.DOMVIA_REALTIME_KEY,
secret: process.env.DOMVIA_REALTIME_SECRET,
socketId: request.body.socket_id,
channelName,
}),
);
});