The open source Firebase alternative.
1 min readJun 6, 2020
Supabase adds realtime and restful APIs to Postgres without a single line of code. Susbase introspect your database and provide APIs instantly so you can stop building repetitive CRUD APIs and focus on building your products.
Install
npm install --save @supabase/realtime-js
Example
import { Socket } = '@supabase/realtime-js'
var socket = new Socket(process.env.REALTIME_URL)
socket.connect()
// Listen to only INSERTS on the 'users' table in the 'public' schema
var allChanges = this.socket.channel('realtime:public:users')
.join()
.on('INSERT', payload => { console.log('Update received!', payload) })
// Listen to all changes from the 'public' schema
var allChanges = this.socket.channel('realtime:public')
.join()
.on('*', payload => { console.log('Update received!', payload) })
// Listen to all changes in the database
let allChanges = this.socket.channel('realtime:*')
.join()
.on('*', payload => { console.log('Update received!', payload) })
Use Cases