Realtime
Tested with: Not yet available on Databasezy · describes the launch design
Realtime lets clients exchange messages, share who is online and receive database changes over a WebSocket at
/realtime/v1/websocket on the project endpoint.
How it works
Section titled “How it works”- Broadcast: low-latency messages to everyone on a channel, fanned out in the region that runs the project.
- Presence: a shared, conflict-free list of who is connected to a channel and their state.
- Postgres changes: inserts, updates and deletes from the tables you publish, read from a logical replication slot on the primary database. Postgres evaluates each subscriber’s row-level security against every changed row, so a client never receives a row it could not select.
- Connections are authorised with a publishable key or a user’s session token; the protocol follows realtime-js, so
supabase.channel()works against your endpoint.
Subscribe (at launch)
Section titled “Subscribe (at launch)”curl -X POST "https://<ref>.us-east.databasezy.com:8443/realtime/v1/api/broadcast" \ -H "apikey: <publishable-key>" \ -H "Authorization: Bearer <publishable-key>" \ -H "Content-Type: application/json" \ -d '{"messages":[{"topic":"room-1","event":"message","payload":{"text":"hi"}}]}'import { createClient } from "@supabase/supabase-js";
const supabase = createClient("https://<ref>.us-east.databasezy.com:8443", "<publishable-key>");
supabase .channel("room-1") .on("broadcast", { event: "message" }, ({ payload }) => console.log(payload)) .subscribe();# The realtime client is async: use acreate_clientfrom supabase import acreate_client
supabase = await acreate_client("https://<ref>.us-east.databasezy.com:8443", "<publishable-key>")channel = supabase.channel("room-1")channel.on_broadcast("message", lambda payload: print(payload))await channel.subscribe()// Cargo.toml: reqwest = { version = "0.12", features = ["json"] }, serde_json, tokiolet key = "<publishable-key>";let res = reqwest::Client::new() .post("https://<ref>.us-east.databasezy.com:8443/realtime/v1/api/broadcast") .header("apikey", key) .bearer_auth(key) .json(&serde_json::json!({ "messages": [{ "topic": "room-1", "event": "message", "payload": { "text": "hi" } }] })) .send() .await? .error_for_status()?;let json: serde_json::Value = res.json().await?;supabase .channel("todos") .on("postgres_changes", { event: "INSERT", schema: "public", table: "todos" }, (msg) => console.log(msg.new)) .subscribe();Pricing and limits
Section titled “Pricing and limits”| Meter | Price | Free | Solo | Team | Enterprise |
|---|---|---|---|---|---|
| Realtime messages Coming soon | $2.50 per million | 500K | 5M | 50M | Contract |
| Realtime peak connections Coming soon | $10 per 1,000 a month | 50 peak | 500 peak | 2,000 peak | Contract |
| Limit | Free | Solo | Team | Enterprise |
|---|---|---|---|---|
| Realtime connections per project Coming soon | 50 | 10,000 | 50,000 | Unlimited |
| Realtime messages per second Coming soon | 100 | 500 | 2,500 | Unlimited |