The open source Firebase alternative.

Kalinin Dmitry
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

--

--

Kalinin Dmitry
Kalinin Dmitry

Written by Kalinin Dmitry

Engineer. Constructivist. Lean manufacturing. Blockchain Enthusiast. IoT Enthusiast. https://github.com/null-none https://www.linkedin.com/in/kal1sha/

No responses yet