How-to guides
Listen to database changes in realtime
Realtime pushes database changes to every open screen, so lists, dashboards and chats stay current without polling.
Subscribe
const channel = supabase
.channel('todos-changes')
.on('postgres_changes',
{ event: '*', schema: 'public', table: 'todos' },
(payload) => console.log(payload.eventType, payload.new))
.subscribe()Filter
.on('postgres_changes',
{ event: 'INSERT', schema: 'public', table: 'messages', filter: 'room_id=eq.42' },
onMessage)Clean up
supabase.removeChannel(channel)Security
Realtime respects the same access rules as your API, so users only receive changes to rows they’re allowed to read.
Questions
Do I need to enable anything?
Realtime is part of every project; subscribe from the client with supabase-js.
Related
- Row Level Security (RLS) explained with examples
- Add Google and GitHub sign-in with supabase-js
- Passwordless magic link login
- Semantic search with pgvector
- Quickstart
- supabase-js client docs
Updated 2026-10-23.