Server SDK reference

The thin TadaServer client for your backend routes.

  • 4 min read
On this page
  1. What the server SDK is for
  2. Acting as the signed-in user
  3. Methods

What the server SDK is for #

The server SDK is a small class — TadaServer, in lib/tada-server.js — that talks straight to the Tadabase Domain API from inside your backend routes (routes/*.js). Use it when custom server logic has to run before or after a data call: combining tables, guarding a call with a secret, or shaping a response. For plain reads and writes from the UI, the browser SDK is richer and easier.

JavaScript
import { TadaServer } from '../lib/tada-server.js';

const tada = TadaServer.fromEnv();   // reads TADA_API_BASE_URL
if (!tada.configured) throw new Error('App not bound to a Tadabase backend');

Acting as the signed-in user #

Every data method takes the end-user's bearer token as its first argument. Pass it and RLS is enforced as that user — the same rules as everywhere else. Omit it only for genuinely public endpoints.

Methods #

MethodPurpose
request(path, { method, token, body, query })Low-level call. Returns { status, body }. Everything else builds on this.
login(username, password)Exchange credentials for a bearer token.
listTables(token)List the tables the user can reach (GET /data).
listRecords(token, slug, query)List records from one table — paginated, RLS-enforced.
triggerWorkflow(token, workflowId, recordId, runMode)Run a workflow on a record.
uploadFile(token, { bytes, name, type, fieldId, fieldSlug, recordId })Upload a file and optionally attach it to a record field.
getFile(token, fileId)File metadata plus a fresh download URL.

Skip the docs.Just describe it.

Tadabase AI builds it, hosts it and keeps it running. Real backend, real domain, real app.

Plain English. It asks follow-up questions like a real developer.

  • 14-day free trial, no card
  • Unlimited app users
  • Live on your own domain