SDK reference
What your routes, components, server actions and workflows can call, member by member: signature, parameters, return value, errors, what row-level security allows, and an example. Generated from the TypeScript source the platform builds your app against.
Four packages, all provided by the platform (never add them to package.json). The type check runs every apply in strict mode against them and against your own tables, templates and config, so a wrong column or template var is an error at its file and line.
import { defineRoute, useQuery, useTable, Link } from "@appbricx/ui"; // routes/, components/
import { defineAction, v } from "@appbricx/server"; // server/
import { on, cron, webhook } from "@appbricx/workflows"; // workflows/
import { defineApp } from "@appbricx/define"; // app.config.tsPages
- Routes and navigation
@appbricx/ui. Every file under routes/ is a page: routes/index.tsx is /, routes/experiences/[id].tsx is /experiences/:id, and routes/_layout.tsx wraps the routes below it. A route exports its meta (who may open it, the row it is about, its title and SEO) and a default React component. (10 members) - Data
@appbricx/ui. Read and write the app's tables from pages and components. Every read and write is a request to the app's data API as the signed-in user, so your row-level security policies (db/access/*.sql) decide what each person sees and changes. Rows are typed from db/schema. (6 members) - Sign-in
@appbricx/ui. Who is signed in, and the calls that sign people in, up and out. The ways in (password, sign-in links, Google) and who may sign up are set in app.config.ts auth; a role's profile table links each account to its row. (3 members) - Live updates
@appbricx/ui. Keep a page's reads current as rows change, and talk on channels (chat, typing, who is here). Every change is re-read as each subscriber under row-level security, so nobody receives a row they couldn't read. (5 members) - Components, icons and config
@appbricx/ui. Your own React components under components/ (any React works; defineComponent adds typed, defaulted props and a catalog entry), icons from any Iconify set or your icons/*.svg, and the app's public config values. (10 members) - Server actions
@appbricx/server. Typed server code in server/*.ts. An exported defineAction is callable from any page as a plain async function; it runs on the platform as the caller, after its input is checked, so row-level security and your triggers apply to everything it does. (27 members) - Workflows
@appbricx/workflows. Durable workflows in workflows/*.ts: run when a row is created, updated, moves into a state or is deleted, on a schedule, or on an inbound webhook. Every step is recorded, so a run can sleep for days, wait for a signal and retry without sending an email twice. (19 members) - App config
@appbricx/define. app.config.ts: the app's brand, locale, sign-in, roles and their profile tables, config and secret names, outbound hosts, realtime and analytics. It runs in a sandbox with no clock, randomness or network and must export plain data. (1 members)
Every member
Routes and navigation
defineRoute, <Link>, <NavLink>, useNavigate, useParams, useSearchParams, useRoute, useLocation, useCanOpen, <ErrorBoundary>
Sign-in
Live updates
Components, icons and config
defineComponent, lazyComponent, p.string, p.uuid, p.number, p.bool, p.json, <Icon>, useConfig, useClock
Server actions
defineAction, v.string, v.uuid, v.email, v.number, v.integer, v.boolean, v.enum, v.array, v.object, v.any, ctx.db.get, ctx.db.list, ctx.db.create, ctx.db.update, ctx.db.remove, ctx.me, ctx.config, ctx.secrets.ref, ctx.secrets.get, ctx.http.fetch, ctx.signal, ctx.email, ctx.sms, ctx.pdf, ctx.log, ctx.now
Workflows
on.created, on.updated, on.transition, on.deleted, cron, webhook, step.run, step.now, step.sleep, step.sleepUntil, step.waitFor, step.sql, step.ctx, step.send.email, step.send.sms, step.send.notify, step.prompt, step.pdf, step.url