Listens to changes in a PostgreSQL Database and broadcasts them over websockets.
Status: ALPHA
This repo is still under heavy development and the documentation is still evolving. You're welcome to try it, but expect some breaking changes.
Docs are a work in progress. Start here: [https://supabase.io/docs/realtime/introduction]
import { Socket } = '@supabase/realtime-js'
var socket = new Socket(process.env.SOCKET_URL)
socket.connect()
// Listen to all changes in the database
var allChanges = this.socket.channel('*')
.join()
.on('*', payload => { console.log('Update received!', payload) })
// Listen to all changes from the 'public' schema
var allChanges = this.socket.channel('public')
.join()
.on('*', payload => { console.log('Update received!', payload) })
// Listen to all changes from the 'users' table in the 'public' schema
var allChanges = this.socket.channel('public:users')
.join()
.on('*', payload => { console.log('Update received!', payload) })
We welcome any issues, pull requests, and feedback. See https://supabase.io/docs/-/contributing for more details.
This repo is liscenced under Apache 2.0.
- https://github.com/cainophile/cainophile - A lot of this implementation leveraged the work already done on Canophile.