Realtime Engine
Your database,
now alive.
Listen to every INSERT, UPDATE, DELETE over WebSockets. Broadcast messages, track presence, build collaborative apps — all from your Postgres.
subscribe.ts
import { createClient } from '@wowsql/js'
const wowsql = createClient(WOWSQL_URL, WOWSQL_KEY)
// Subscribe to INSERT events on messages table
const channel = wowsql
.channel('chat')
.on(
'postgres_changes',
{ event: 'INSERT', schema: 'public', table: 'messages' },
(payload) => {
console.log('New message:', payload.new)
// { id: 42, text: 'Hello!', user_id: '...' }
}
)
.subscribe()
// Broadcast to all connected clients
channel.send({
type: 'broadcast',
event: 'typing',
payload: { user: 'Alice' }
})presence.ts
// Track who's online — built in
const room = wowsql
.channel('online-users')
.on('presence', { event: 'sync' }, () => {
const state = room.presenceState()
console.log('Online now:', Object.keys(state).length)
})
.subscribe(async (status) => {
if (status === 'SUBSCRIBED') {
await room.track({
user_id: currentUser.id,
online_at: new Date().toISOString()
})
}
})Postgres Change Events
Subscribe to INSERT, UPDATE, DELETE events on any table. Filter by specific columns.
Broadcast
Send low-latency messages between clients. Perfect for typing indicators and cursor sharing.
Presence
Track who's online and sync shared state across all connected clients in real time.
Sub-100ms Latency
WebSocket connections for instant delivery. No polling, no lag, no compromise.
Auth-Aware
Realtime respects your access policies. Users only see changes they're authorized to see.
Auto Reconnect
Automatic reconnection with exponential backoff. Your app stays resilient.
Built for what's next
Real-time features for every use case.
Chat & Messaging
Live Dashboards
Multiplayer Games
Push Notifications
