Skip to content

Tadabase AI SDK & API

Browser SDK reference

The `tada` client and the useJson hook, available in your React code.

How it reaches your data

The browser SDK — imported as tada from src/lib/tada.ts — never calls Tadabase directly. It calls THIS app's own backend at /api/svc/*, which forwards to the Tadabase Domain API. That keeps custom logic and secrets server-side, and gives you offline queuing, automatic sign-out on expiry, and error surfacing for free.

The tada namespaces

NamespaceWhat it does
tada.recordslist / get / create / update / delete, plus filters, search, summaries, grouping, connected fields, subforms, and batch update/delete.
tada.meThe signed-in user's own profile (get / update) and a resolved RLS permissions report (what they can actually do).
tada.logsRead the app's audit / activity streams — logins, sessions, record changes, emails, imports/exports, workflow runs.
tada.viewsRead builder-defined saved views.
tada.workflowsTrigger a workflow (by record, loaded records, or matching conditions) and track its run.
tada.pdfsRender a PDF Page or fill a PDF Form — url or base64.
tada.exports / tada.importsKick off and track CSV exports and imports.
tada.filesUpload files and fetch fresh download URLs.
tada.emailsSend builder-defined emails.
tada.sessionsForce-logout a user's active login sessions.
tada.aiPromptsRun a builder-defined AI Prompt and get its generated fields back.
tada.notificationsRealtime updates from background jobs (imports/exports today) over a private per-user channel.

useJson

The data hook. Give it an async function — usually a tada.* call, or a fetch to one of your own /api/* routes — and it returns SWR-style loading / error / data / refetch state.

tsx
const { data, error, isLoading, refetch } = useJson(() =>
  tada.records.list('tickets', { limit: 25 }),
);

Auth helpers

Beyond the login / signup / magic-link / password methods on tada, three helpers cover the common UI checks:

HelperReturns
tada.isAuthed()true if a session token is present.
tada.user()The signed-in user (with roles), or null.
tada.logout()Revokes the token server-side, clears the local session.
tsx
import { tada } from '@/lib/tada';

const user = tada.user();
if (!user) return <SignInPrompt />;
// user.roles → [{ name: 'Manager' }]
Ready to build

Skip the docs.
Just describe it.

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

Start Building