Rezin Core Rezin Core
Docs

Moving in and out

From their client calls to ours

What the common calls of the Supabase and Firebase client libraries become on Rezin Core. Rezin Core's API is plain HTTPS and JSON; there is no client library to install yet, so each call below is a request you can make with fetch.

Every request carries your project's key in apikey. A signed-in user's requests also carry authorization: Bearer <token>, the token sign-in gave you.

const API = 'https://api.rezincore.com';
const headers = { apikey: PUBLISHABLE_KEY, authorization: `Bearer ${token}`, 'content-type': 'application/json' };

Sign-in

SupabaseFirebaseRezin Core
auth.signUp({ email, password })createUserWithEmailAndPasswordPOST /v1/auth/signup
auth.signInWithPassword(...)signInWithEmailAndPasswordPOST /v1/auth/signin
auth.getUser()auth.currentUserGET /v1/auth/user
auth.signOut()signOutPOST /v1/auth/signout
auth.signInWithOtp({ email })sendSignInLinkToEmailPOST /v1/auth/magiclink
auth.signInWithOAuth({ provider })signInWithPopupThe provider flow in Google and GitHub sign-in

Details, bodies and answers: Accounts and sign-in and Email flows.

Data

SupabaseRezin Core
from('todos').select('*')GET /v1/data/todos
.eq('state', 'open')GET /v1/data/todos?state=eq.open
.order('created_at', { ascending: false }).limit(20)?order=created_at.desc&limit=20
from('todos').insert({ title })POST /v1/data/todos with the row as JSON
from('todos').update({ state: 'done' }).eq('id', 7)PATCH /v1/data/todos?id=eq.7
from('todos').delete().eq('id', 7)DELETE /v1/data/todos?id=eq.7

Filters, paging and what the data API will not do: The data API. Joins across tables and calling database functions by name are not offered through the data API; put that logic in a view, or in a function.

From Firestore the change is larger, because documents became rows: collection('shops').doc('s1').get() becomes GET /v1/data/shops?id=eq.s1, and a subcollection shops/s1/orders becomes GET /v1/data/orders?parent_id=eq.s1.

Files

SupabaseFirebaseRezin Core
storage.from('b').upload(path, file)uploadBytes(ref, file)PUT /v1/storage/b/<path> with the file as the body
storage.from('b').download(path)getBytes(ref)GET /v1/storage/b/<path>
storage.from('b').list(prefix)listAll(ref)GET /v1/storage/b?prefix=<prefix>
storage.from('b').remove([path])deleteObject(ref)DELETE /v1/storage/b/<path>
storage.from('b').createSignedUrl(path, 3600)getDownloadURL(ref)POST /v1/storage/b/sign

Storage has the details.

Live updates

SupabaseFirebaseRezin Core
channel(...).on('postgres_changes', ...)onSnapshot(query, ...)A WebSocket subscription to a table: Realtime

Live updates are switched on table by table and respect row-level security: each listener is told only about rows it may read.

Server-side code

SupabaseFirebaseRezin Core
Edge Functions (Deno)Cloud FunctionsFunctions: one JavaScript module, export default async (request, context) => Response
Database webhooksFirestore triggersWebhooks, to an address or to one of your functions
pg_cronScheduled functionsA function's timetable

In your access rules

SupabaseRezin Core
auth.uid()core.app_user()
to authenticatedcore.app_user() is not null
(no equivalent; one project is one tenant)core.app_org(), the caller's organization

Securing tables explains organizations and has rule templates.

This page as Markdown · llms.txt · Rezin Core is in development and available by invitation.