The backend /Typed SDK

One client.
Typed from your schema.

Data, auth, storage, realtime and your own functions — from any JavaScript or TypeScript environment, with collection names and field types checked at compile time.

Typed from your schema

One client, five surfaces, one connection string

createRebaseClient gives you typed access to data, auth, admin, and storage via a single instance. Generate types with rebase generate-sdk for full IntelliSense.

import { createRebaseClient } from "@rebasepro/client";
import type { Database } from "./database.types";

const rebase = createRebaseClient<Database>({
  baseUrl: "https://api.myapp.com",
});

// Everything is dot-accessible:
rebase.data      // → collection queries
rebase.auth      // → sign in, sign up, sessions
rebase.admin     // → user/role management
rebase.storage   // → file upload/download
rebase.realtime  // → broadcast channels, presence

Your collections are properties, not strings

Access any collection as a typed property. No string lookups, no manual typing — just rebase.data.posts.

app.ts
1import { createRebaseClient } from '@rebasepro/client';
2import type { Database } from './generated/sdk/database.types';
3
4const client = createRebaseClient<Database>({ baseUrl: API_URL });
5
6const { data } = await client.data.
TypeScriptUTF-8Ln 6, Col 36
CRUD
// Find all published posts
const { data } = await rebase.data.posts.find({
  limit: 20,
  orderBy: ["createdAt", "desc"]
});

// Get single post
const post = await rebase.data.posts
  .findById("abc-123");

// Create
await rebase.data.posts.create({
  title: "Hello World",
  status: "draft"
});

// Update
await rebase.data.posts.update("abc-123", {
  status: "published"
});

// Delete
await rebase.data.posts.delete("abc-123");
Fluent query builder
// Chained queries
const { data } = await rebase.data.posts
  .where("status", "==", "published")
  .where("views", ">=", 100)
  .orderBy("createdAt", "desc")
  .limit(10)
  .find();

// Include relations
const { data: posts } = await rebase.data.posts
  .include("author", "tags")
  .find();

// Full-text search
const results = await rebase.data.posts
  .search("rebase tutorial")
  .limit(5)
  .find();

// Realtime listening
const unsub = rebase.data.posts
  .where("status", "==", "published")
  .listen(({ data }) => {
    console.log("Live update:", data);
  });

// Broadcast channel
const channel = rebase.realtime.channel("chat-room");

channel.onBroadcast("message", (payload) => {
  console.log("Received:", payload);
});

await channel.join();
rebase.auth

Sessions, without a second auth service

Full auth lifecycle — sign in, sign up, Google OAuth, token refresh, password reset, email verification, and session management. Works in browser and Node.js.

// Sign in
await rebase.auth.signInWithEmail(
  "user@app.com", "password"
);

// Google OAuth
await rebase.auth.signInWithGoogle(idToken);

// Listen for auth changes
rebase.auth.onAuthStateChange((event, session) => {
  console.log(event, session?.user);
});

// Session management
const sessions = await rebase.auth.getSessions();
await rebase.auth.revokeSession(sessionId);
rebase.admin + rebase.storage

Users, roles and files, from the same client

Manage users, roles and files programmatically — no panel required.

// User management
const { users } = await rebase.admin.listUsers();
await rebase.admin.createUser({
  email: "new@app.com",
  roles: ["editor"]
});

// Role management
const { roles } = await rebase.admin.listRoles();

// File storage
const { key, bucket, storageUrl } = await rebase.storage.putObject({
  file: myFile,
  key: "uploads/avatar.jpg"
});

// short-lived signed URL, or a permanent one for public objects
const { url } = await rebase.storage
  .getSignedUrl("uploads/avatar.jpg");

await rebase.storage.deleteObject("old.pdf");
rebase generate-sdk

The types come out of the collections

Run rebase generate-sdk to produce a database.types.ts file from your collection definitions. Pass it as a generic to createRebaseClient<Database> for full end-to-end type safety.

  • Auto-generated from your collection definitions
  • Full IntelliSense for rebase.data.<collection>
  • Property types, enums, and relations included
  • Regenerate on schema changes with one command
$ rebase generate-sdk
✓ Generated database.types.ts

// database.types.ts (auto-generated)
export interface Database {
  posts: {
    id: string;
    title: string;
    status: "draft" | "published";
    authorId: string;
    createdAt: Date;
  };
  users: {
    id: string;
    email: string;
    displayName: string | null;
  };
}

Typed from your own schema.

Scaffold a project and the client is generated from the collections you define. No hand-written types to drift.

~pnpm dlx @rebasepro/cli init