Vybase by Zyvraon · Auth, Hosting, Realtime DB, Storage, Functions, Android APK & 40+ Tool MCP Pro starts at ₹299/mo · Free projects never pause · Compare vs Supabase & Firebase →
Vybase Documentation

Database & Storage Guide

Save structured app data with declarative owner rules, SSE realtime streams, and auto-optimized file buckets.

Realtime Document Database (Firestore-Style on PostgreSQL)

Create collections in Console → Database (or via Vybase AI / MCP create_collection). Each collection defines simple read and write security rules:

  • Read rules: public (anyone with pk_...), authenticated (any signed-in user), owner (only the creator's documents), or server (sk_... only).
  • Write rules: authenticated, owner (default), or server.
  • Documents are up to 1 MB, support nested fields up to 8 levels deep, optional schema type validation, and GIN-indexed queries.
CRUD, Query Filters, Cursor Paging & Realtime SSE · ts
// Insert (server automatically sets owner_id from user token)
const { data: created } = await zyv.db.from("todos").insert({
  title: "Launch on Vybase",
  done: false,
  tags: ["launch", "web"],
});

// Query with filters (eq, neq, gt, gte, lt, lte, in, contains, like)
const { data: rows, nextCursor } = await zyv.db.from("todos").select({
  where: [["done", "eq", false], ["tags", "contains", "launch"]],
  order: ["created_at", "desc"],
  limit: 20,
});

// Update (null deletes a field), Upsert, Delete
await zyv.db.from("todos").update(created.id, { done: true });
await zyv.db.from("todos").set("custom-id", { title: "Pinned" }, { upsert: true });
await zyv.db.from("todos").delete(created.id);

// Realtime Server-Sent Events (enforces read rules per user)
const sub = zyv.db.from("todos").subscribe((ev) => console.log(ev.type, ev.doc));

Database REST Endpoints & Error Codes

Call POST|GET /db/v1/:collection, GET|PATCH|PUT|DELETE /db/v1/:collection/:id, or GET /db/v1/_realtime/:collection with x-zyvraon-key and optional Authorization: Bearer <token>.

Error codes: collection_not_found (404), document_not_found (404), sign_in_required (401), db_forbidden (403), db_invalid_query (400), db_invalid_document (422), document_too_large (413), db_full (507).

Object Storage & Dynamic Image Resizing

Create public or private buckets in Console → Storage. By default, signed-in users can upload strictly inside their own <user_id>/... folder.

Upload, Resize Public Images & Create Signed URLs · ts
const zyv = createClient("https://auth.zyvraone.site", "<pk_publishable_key>", {
  projectId: "<project_id>",
});

// Upload into user's folder
await zyv.storage.from("avatars").upload(`${user.id}/me.png`, file, { upsert: true });

// Public URL with automatic AVIF/WebP resizing
const thumb = zyv.storage.from("avatars").getPublicUrl(`${user.id}/me.png`, {
  width: 256,
  quality: 80,
});

// Private file temporary signed link (expires in 3600 seconds)
const { data: signed } = await zyv.storage.from("docs").createSignedUrl(`${user.id}/invoice.pdf`, 3600);