Docs

Firebase code on Sovaria

Run Firestore (modular), Auth, Storage and callable-function code on Sovaria in every SDK: the same documents, queries, snapshots, batches, transactions and field transforms; how rules, auth and storage map.

Updated Oct 31, 2026

Sovaria's document collections have Firestore's model — collections, documents, subcollections, queries with cursors, live snapshots, batched writes, transactions and field transforms — and every SDK has Firebase's API for them. Move the data with Migrate from Supabase or Firebase; then change imports, not code.

import { createClient } from '@sovaria/sdk'
import { getFirestore, collection, doc, query, where, orderBy, limit, startAfter, onSnapshot,
  getDocs, setDoc, updateDoc, addDoc, writeBatch, runTransaction, serverTimestamp, increment, arrayUnion } from '@sovaria/sdk/firestore'

const sovaria = createClient(SOVARIA_URL, SOVARIA_ANON_KEY)
const db = getFirestore(sovaria)

const q = query(collection(db, 'rooms', roomId, 'messages'), where('hidden', '==', false), orderBy('sentAt'), limit(50))
const stop = onSnapshot(q, (snap) => snap.docChanges().forEach((c) => render(c.type, c.doc.data())))
await addDoc(collection(db, 'rooms', roomId, 'messages'), { text, sentAt: serverTimestamp() })
await updateDoc(doc(db, 'rooms', roomId), { count: increment(1), members: arrayUnion(userId) })
FirebaseSovaria
Firestore collection / doc / getDoc(s) / setDoc (merge) / addDoc / updateDoc / deleteDocThe same names (Firebase-style code (Firestore API)).
where / orderBy / limit / limitToLast / startAt / startAfter / endAt / endBefore, or() / and()The same (Querying documents).
onSnapshot with docChanges() and metadataThe same, over Sovaria's live listeners (Live listeners).
writeBatch, runTransactionThe same; transactions retry when a document they read changed (Transactions, batches and field transforms).
serverTimestamp, increment, arrayUnion, arrayRemove, deleteFieldThe same field transforms.
getCountFromServer, sum, average, findNearestThe same aggregates and vector search (Vector search on documents).
Security rulesCollection rules: who may read and write which documents, checked on every call (How access is decided).
signInWithEmailAndPassword(auth, e, p) / onAuthStateChangedsovaria.auth.signInWithPassword({ email: e, password: p }) / onAuthStateChange (Email and password).
uploadBytes(ref(storage, path), file) / getDownloadURLsovaria.storage.from(bucket).upload(path, file) / getPublicUrl or createSignedUrl (Working with files).
httpsCallable(functions, 'f')(data)sovaria.functions.call('f', data) (Deploying and running functions).
Firebase Remote Config, Analytics, Crashlyticssovaria.config, sovaria.analytics, sovaria.crashes (Product analytics).