Dokümantasyon
Realtime
SSE ve WebSocket. Scope: realtime:subscribe.
Kanallar
WAL NOTIFY → liap-realtime.
Tarayıcı WS: access_token query veya Sec-WebSocket-Protocol: liap.<token>.
| Method | Path | Açıklama |
|---|---|---|
| GET | /realtime/stream?table=todos | SSE |
| WS | wss://{EDGE}/realtime/ws?table=todos | WebSocket |
| GET | /realtime/presence?channel= | Presence |
| POST | /realtime/broadcast | Broadcast (204) |
SSE
Node.js
const res = await fetch(
`${EDGE}/realtime/stream?table=todos`,
{ headers: { 'X-Liap-Key': API_KEY } },
)
const reader = res.body.getReader()
const dec = new TextDecoder()
for (;;) {
const { done, value } = await reader.read()
if (done) break
console.log(dec.decode(value))
}WebSocket
Node.js
import WebSocket from 'ws'
const ws = new WebSocket(
`${EDGE.replace(/^http/, 'ws')}/realtime/ws?table=todos`,
{ headers: { 'X-Liap-Key': API_KEY } },
)
ws.on('message', (buf) => console.log(String(buf)))